Skip to Main Content


How to install apache2 webserver on a VPS (EASY!)


Apache2 is a one of the two notorious & popular webserver programs, and for good reason, here's how to install apache2 onto your Ubuntu 20.04 (Focal Fossa) device in 4 easy steps!

(1) Update Repositories using apt

Run the following command in your console to update any repositories and packages on your server instance:

sudo apt update

Note: if you want to skip using sudo and typing your password every time, run (root can skip sudo at all times without sudo -i):

sudo -i

(2) Install Apache2 itself

Now, install the apache2 package by running:

sudo apt install apache2

(3) Useful console commands for apache2

To start the apache2 service:

sudo systemctl start apache2

To make apache2 boot from startup automatically:

sudo systemctl enable apache2

To disable apache2 booting up from startup automatically:

sudo systemctl disable apache2

To stop the apache2 service:

sudo systemctl stop apache2

To reload the apache2 service, for instance after changes:

sudo systemctl reload apache2

To restart the apache2 service:

sudo systemctl restart apache2

(4) Configure firewalling for apache2

Go to your KUBBUR VPS panel's "FIREWALL" page and press "NEW RULE" for this modal to show up:

And fill in: Name can be anything you want (apache2 port for example), Source IP is the IP that is allowed to connect to the port (you can restrict this to your own IP for example, leave blank for no restriction), Destination IP should be the IP of your Virtual Server and Protocol is set to 'UDP', Source Port to as previously noted whatever you want to restrict it to (leave blank for no restrictions) and the Destination Port to the apache2 port you chose, default is 443, and Action is set to "ALLOW".

Then make another rule doing the exact same but making the Destination Port 80.

And you should be all done!

Need more help?

Speak to our support team to help you with your problem!

let's talk!

Made with ❤️ in Iceland

Copyright © 2021 - 2022 KUBBUR Limited. All rights reserved. KUBBUR is a brand of KUBBUR Limited, a duly registered company of England and Wales. Company no. 13999809. ICO no. ZB331924.

Minecraft® is a registered trademark of Mojang AB. This website is not affiliated with or endorsed by Mojang AB. Discord®, the Discord® logo and Discord Nitro® are registered trademarks of Discord, Inc. Ubuntu®, Kubuntu®, Lubuntu®, Xubuntu®, Canonical®, the Ubuntu® logo and the "Circle of Friends®" are registered trademarks of Canonical, Ltd. Intel®, and the Intel® logo are registered trademarks of Intel Corporation and its subsidiaries. AMD®, AMD Ryzen®, the AMD® and AMD® arrow logo, AMD EPYC®, and the AMD Ryzen® logo are registered trademarks of Advanced Micro Devices, Inc. Apex Hosting® is a registered trademark of Apex Hosting, LLC. MCProHosting® is a registered trademark of MCProHosting, LLC. PebbleHost® is a registered trademark of Daniel James Jackson.

All product names, brands, logos, trademarks and registered trademarks are property of their respective owners. Any use of the aforementioned on this website is for identification purposes only and does not imply endorsement.

KUBBUR Limited is a subsidiary of KVM Group Limited and Scaleblade, Ltd. of the United Kingdom.