How to install Apache Server on Ubuntu Linux

Where necessary, you may need to have access to a VPS server so you can follow how to implement the steps in this article.  You can get a cheaper VPS Server from Contabo with 4vCPU cores, 8GM RAM, and 32TB Bandwidth for less than $5.50 per month. Get this deal here now

Table of Contents

Cloud VPS S

$5.50 Monthly
  • 4 vCPU Cores | 8GB RAM


$15.50 Monthly
  • 6 vCPU Cores | 16GB RAM


$17.50 Monthly
  • 8 vCPU Cores | 24GB RAM

Apache is a widely used open-source web server software developed and maintained by the Apache Software Foundation. It is often used to host websites and can serve a variety of content, including HTML pages, images, and dynamic content generated by scripts. Apache is known for its stability, flexibility, and security, and is commonly compatible with Linux Platforms.

So, to install Apache, here are the steps you need to follow:

Update the package list

You can update the package list by running the following command;

sudo apt update

Install Apache

After updating your system, you can now run the following command to install Apache;

sudo apt install apache2

Start the Apache service:

Usually, the Apache service can start automatically after installing, but if it doesn’t work, you will need to run the following command to start it;

sudo systemctl start apache2

Enable Apache to start automatically after reboot

The following command will start Apache automatically when your system reboots;

sudo systemctl enable apache2

Check the status of Apache

You can the following command to see if Apache is running on your system;

sudo systemctl status apache2

You can now use your server’s IP address to check if your Apache server is running in the browser. Assuming your server IP address is, then type this IP in your browser and check.

You can also configure the Apache default web page by visiting /var/www/html/ in your system by default. Please note that the above commands will install the Apache 2 version that is part of the official Ubuntu package repository, If you want to install a different version you will have to look for a third-party repository.

RECOMMENDED READING: Could not reliably determine the server’s fully qualified domain

Which ports can I open after installing Apache server

When you install the Apache web server, it typically listens for incoming requests on port 80 (HTTP) and/or port 443 (HTTPS) by default. Port 80 is the default port for HTTP traffic, so if you want to host a website on your Apache server and make it accessible to visitors via a web browser, you’ll need to open port 80 in your firewall.

Port 443 is the default port for HTTPS traffic, if you plan to use SSL/TLS encryption and use the https protocol, you’ll need to open port 443. However, in some cases, you may want to configure Apache to listen on a different port. This can be useful if you want to run multiple web servers on the same machine, or if you want to change the default ports for security reasons. It’s worth noting that for security reasons it’s a good practice to only open the ports that are needed for the service you’re running on the machine.

So, you can open ports 80 and 443, or the custom ports you have defined.

More Apache-related articles to explore

More Ubuntu-related articles to explore

Hire us to handle what you want

Hire us through our Fiverr Profile and leave all the complicated & technical stuff to us. Here are some of the things we can do for you:

  • Website migration, troubleshooting, and maintenance.
  • Server & application deployment, scaling, troubleshooting, and maintenance
  • Deployment of Kubernetes, Docker, Cloudron, Ant Media, Apache, Nginx,  OpenVPN, cPanel, WHMCS, WordPress, and more
  • Everything you need on AWS, IBM Cloud, GCP, Azure, Oracle Cloud, Alibaba Cloud, Linode, Contabo, DigitalOcean, Ionos, Vultr, GoDaddy, HostGator, Namecheap, DreamHost, and more.

We will design, configure, deploy, or troubleshoot anything you want. Starting from $10, we will get your job done in the shortest time possible. Your payment is safe with Fiverr as we will only be paid once your project is completed.