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.
Setting up a Static IP on Ubuntu configuration is essential for servers, remote access systems,…
Keeping the correct system clock is important for servers, desktop systems, scheduled tasks, and application…
An Ubuntu Hostname Change is a common administrative task used to rename Linux servers, desktops,…
Ubuntu Swap Space helps Linux systems stay responsive when physical RAM starts running low. Instead…
If you need secure remote desktop access on Linux, learning how to Install TeamViewer on…
If you want to test operating systems, build development labs, or safely run isolated environments,…