Setting up Apache Ubuntu 26.04 is one of the fastest ways to launch a reliable web server for hosting websites and applications. Apache remains one of the most widely used open-source web servers thanks to its flexibility, stability, and extensive module support.
Ubuntu 26.04 includes Apache packages in its default repositories, making the installation process simple even for beginners. In this guide, you’ll learn how to install Apache, allow web traffic through the firewall, and configure a virtual host for hosting multiple websites.
Apache is trusted by developers, businesses, and Linux administrators worldwide. It supports dynamic modules, SSL integration, URL rewriting, and virtual hosting. Because Ubuntu 26.04 offers long-term support and updated packages, it provides a stable environment for running production websites.
Apache also works well with PHP, MySQL, and other popular web technologies, making it a solid choice for both personal and enterprise deployments.
Before installing Apache, refresh your Ubuntu package index:
sudo apt update
Next, install the Apache web server package:
sudo apt install apache2
Once the installation finishes, Ubuntu automatically starts the Apache service. You can verify its status with:
sudo systemctl status apache2
If Apache is running correctly, the service status will show as active.
Ubuntu systems commonly use UFW as the firewall manager. To allow both HTTP and HTTPS traffic, enable the Apache Full profile:
sudo ufw allow 'Apache Full'
After applying the rule, check the firewall status:
sudo ufw status
This step ensures visitors can access your server through ports 80 and 443 without connectivity issues.
To confirm Apache is working properly, open a browser and enter your server IP address:
http://your_server_ip
You should see the default Apache welcome page. This confirms the web server is installed and accessible from the network.
You can also test locally using:
curl http://localhost
Virtual hosts allow Apache to host multiple websites on the same server. Start by creating a website directory:
sudo mkdir -p /var/www/example.com
Then create a sample HTML file:
sudo nano /var/www/example.com/index.html
Next, create a virtual host configuration file inside /etc/apache2/sites-available/.
A standard configuration should include:
After saving the configuration, enable the site:
sudo a2ensite example.com.conf
Test the Apache configuration:
sudo apachectl configtest
Finally, restart Apache:
sudo systemctl restart apache2
Deploying Apache Ubuntu 26.04 is straightforward and beginner-friendly. With only a few commands, you can install a fully functional web server, secure firewall access, and configure virtual hosts for multiple domains.
Whether you are hosting a personal project, running a development environment, or deploying a production website, Apache on Ubuntu 26.04 provides a dependable and scalable solution for modern web hosting.
Apache Cassandra is a free, open-source NoSQL database designed for high availability and linear scalability with…
Rocket.Chat is a free, open-source team communication platform built with the Meteor framework. It is a…
MySQL is the most popular open-source relational database management system. It is fast, reliable, and scales…
Apache is the most widely used web server in the world. It is free, open-source, and…
NetBeans is a free, open-source, cross-platform IDE developed by the Apache Software Foundation. It was one…
Pip is the official package manager for Python and the standard way to install libraries from…