How to install Apache web server on Ubuntu

Table of Contents

Step 1 – Prerequisites

There are only two prerequisites for the installation of the Apache web server on Ubuntu, the first one can be considered mandatory and the other one optional, the first one is to update all the packages of the Operating System, the second one is to have a user who has been provided with admin rights, aka sudo user.

Step 2 – Apache vs Apache2

There is something that could be a little bit confusing when dealing with the installation of the Apache web server on Linux servers, You will notice more sooner than later that the word “apache” is used when installing Apache on Red Hat based distros, and on the other hand, the word “apache2” is used on Debian based distros, that’s the reason why for Ubuntu we’re going to use “apache2” as you will see in this article.

  • Apache —> Red Hat based distros (Fedora, CentOS, Rocky, etc)
  • Apache2 –> Debian based distros (Ubuntu, Linux Mint, Kali, etc)

Step 3 – Install Apache on Ubuntu

As you will see the installation of Apache web server is really simple, it’s just a matter or executing the right command (see below), that is of course the easy part, the real work starts immediately after that, you’ll have to configure your firewall to allow HTTP and HTTPS and be sure that this new service is set to start when the server is rebooted, these are just two tasks mentioned between a few more.

				
					sudo apt install apache2
				
			

Feel free to use the command above, hover your cursor over the up right corner of the box to see the COPY option that allows You to quickly copy the code with a simple click.

Check Apache current status

Immediately after the Apache’s installation is completed you can check the current status by using the following command. Do not forget to use “sudo” before the command if you are not the super user root.

				
					systemctl status apache2
				
			

Feel free to use the command above, hover your cursor over the up right corner of the box to see the COPY option that allows You to quickly copy the code with a simple click.

Where to go next?

Now that Apache has been installed there are a few settings that must be completed before our web server is ready to server web pages, see list below: