Installing Apache Web Server on Ubuntu 22.04

The Apache Web Server is a popular open source web server software. We will show you how to install it on an Ubuntu 22.04 server to host your own website or web application.

Planning your own web project? With Apache as your web server, you can easily host websites and web applications. The initial installation on Ubuntu 22.04 is a straightforward process – just follow the four steps below.

How to: Installing Apache Web Server on Ubuntu 22.04

Step 1: Update your system

We recommend that you first update your Ubuntu 22.04 system before you start the installation. This will ensure that you have the latest software packages. To do this, open a terminal and enter the following commands:

sudo apt update
sudo apt upgrade

Enter your password when prompted and confirm the update.

Step 2: Install the software

Use the following command to install the Apache server from the Ubuntu repositories:

sudo apt install apache2

Press “Y” and then “Enter” when prompted for confirmation. To download and install Apache Web Server on your system.

Step 3: Start and activate the Apache service

The Apache service starts automatically as soon as the installation has been completed successfully. Use the following command to ensure that it is loaded automatically at every system startup:

sudo systemctl enable apache2

Start the Apache service with the following command:

sudo systemctl start apache2

Step 4: Check the installation

Open your web browser and enter the IP address of your Ubuntu 22.04 server in the address bar. You should see the default Apache start page, which confirms that the Apache Web Server was successfully installed.

Fire up your web projects!

Congratulations, you are now ready to host your own websites or web applications on your server! Remember to adjust the firewall settings and follow the Apache server configuration security recommendations to protect your website.