How to Install Apache Web Server on Ubuntu 20.04

 Install Apache Web Server on Ubuntu 20.04

In this article, we will have explained the necessary steps to install and configure Apache Web Server on Ubuntu 20.04 LTS. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.

Apache is an open-source web server that’s available for Linux servers free of charge. It is highly customizable and can be integrated with other modules. Installing and configuring Apache for basic setup is quite easy.


  • Operating System with Ubuntu 20.04
  • Server IPv4 Address with Superuser Privileges (Root Access)
  • Gnome Terminal for Linux Desktop
  • PuTTy SSH client for Windows or macOS
  • Powershell for Windows 10/11
  • Familiar with APT Commands

Install Apache Web Server on Ubuntu

Step 1. First, before you start installing any package on your Ubuntu server, we always recommend making sure that all system packages are updated.

sudo apt update
sudo apt upgrade

Step 2. Install Apache.

Apache is already available in ubuntu default software repositories. To install Apache, install the latest meta-package apache2 by running:

sudo apt install apache2

Once installed, verify the version of the Apache server as follows:

apache2 -version

Step 3. Firewall Configuration.

Once the installation is finished, you’ll need to adjust your firewall settings to allow HTTP traffic. UFW has different application profiles that you can leverage for accomplishing that. To list all currently available UFW application profiles, you can run:

sudo ufw app list

To only allow traffic on port 80, use the Apache profile:

sudo ufw allow in "Apache"

You can verify the change with:

sudo ufw status
Status: active

To                         Action      From
--                         ------      ----
OpenSSH                    ALLOW       Anywhere                                
Apache                     ALLOW       Anywhere                  
OpenSSH (v6)               ALLOW       Anywhere (v6)                    
Apache (v6)                ALLOW       Anywhere (v6)

Step 4. Accessing Apache web server.

You can do a spot check right away to verify that everything went as planned by visiting your server’s public IP address in your web browser:


That’s all you need to do to install Apache Web Server on Ubuntu 20.04 Focal Fossa. I hope you find this quick tip helpful. Don’t forget to share your valuable queries/suggestions in the below comment box & also drop your worthwhile feedback.