---
title: "How to Install Apache on Ubuntu"
description: "Before you can start hosting websites from your Ubuntu server, you will first need to install web server software. This software will function as a handler for your server, allowing users to connect..."
url: https://www.inmotionhosting.com/support/server/apache/how-to-install-apache-on-ubuntu/
date: 2020-04-30
modified: 2021-08-16
author: "InMotion Hosting Contributor"
categories: ["Apache"]
type: post
lang: en
---

# How to Install Apache on Ubuntu

Before you can start hosting websites from your **Ubuntu** server, you will first need to install **web server software**. This software will function as a handler for your server, allowing users to connect to the server over the public internet. While there are many different types of web server software available, one of the most popular is **Apache**. In this guide, we will outline how to install and configure Apache on your Ubuntu server [via SSH](https://www.inmotionhosting.com/support/server/ssh/connect-ssh/). Please note that you will need [root access](https://www.inmotionhosting.com/support/amp/obtain-root-access/) to complete this guide.

Topics Include:

- [Installing Apache](#install)
- [Configuring UncomplicatedFirewall](#configure)
- [Managing Apache](#manage)
- [Testing Apache](#test)

Install Apache on your [Dedicated Hosting](https://www.inmotionhosting.com/dedicated-servers) server to start establishing your online presence today!

## Installing Apache

1. Before you can install Apache, you will first want to make sure to update the software package using the following command: sudo apt update
2. Once the package has updated, you can then install Apache using the following command: sudo apt install apache2The installation process will prompt you to press a key to continue. Press the **Y key** and hit **enter**.

## Configuring UncomplicatedFirewall

Before Apache can start accepting connections, you need to allow the service in the Ubuntu firewall software, known as **ufw** or **UncomplicatedFirewall**.

1. If ufw is not already enabled, enable it with the following command: sudo ufw enable
2. With ufw enabled, you can allow Apache connections using the following command: sudo ufw allow 'Apache'
3. To confirm that the firewall is now allowing Apache connections, use the following command: sudo ufw status The output will then display which connections are now allowed in the firewall.

## Managing Apache

To **check the status** of the Apache service, run the following command:

sudo systemctl status apache2

If Apache is running properly, it should say **active** in the output.

Occasionally, making changes to your server may require you to **restart** Apache. You can do this via the following command:

sudo systemctl restart apache2

If you want to restart Apache without dropping active connections, you can **reload** Apache with the following command:

sudo systemctl reload apache2

## Testing Apache

- To confirm that Apache is installed properly and accepting connections over the public internet, you can test it by visiting your **server IP address** in your browser. For example, if your server IP is 123.456.789.0, you would navigate to this URL in your browser:https:// 123.456.789.0
- If the installation process was successful, you should see the following splash page:[![Apache Ubuntu Splash Page](/support/wp-content/uploads/2020/04/apacheubuntu2.png)](/support/wp-content/uploads/2020/04/apacheubuntu2.png)

Congratulations, you have now installed Apache on your Ubuntu server!
