How to Install Apache on Ubuntu Updated on August 16, 2021 by InMotion Hosting Contributor 2 Minutes, 0 Seconds to Read 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. Please note that you will need root access to complete this guide. Topics Include: Installing ApacheConfiguring UncomplicatedFirewall Managing ApacheTesting Apache Install Apache on your Dedicated Hosting server to start establishing your online presence today! Installing Apache Before you can install Apache, you will first want to make sure to update the software package using the following command: sudo apt update 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. If ufw is not already enabled, enable it with the following command: sudo ufw enable With ufw enabled, you can allow Apache connections using the following command: sudo ufw allow 'Apache' 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.0If the installation process was successful, you should see the following splash page: Congratulations, you have now installed Apache on your Ubuntu server! Share this Article InMotion Hosting Contributor Content Writer InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals! More Articles by InMotion Hosting Related Articles How to Add mod_expires to your .htaccess How to Hide Your Apache Version and Linux OS From HTTP Headers How to Enable HTTP/2 in Apache How to Install the ModSecurity Apache Module How to Install Apache on CentOS 7 Replace Apache Servername in HTTP Headers View request type, URL, and response codes from Apache access log View level of traffic with Apache access log Apache Codes How to Add Apache Modules