How To Install Apache on Ubuntu 25.04 (Step-by-Step Guide For 2025)

How To Install Apache on Ubuntu 25.04 (Step-by-Step Guide For 2025)

Here is how you can install Apache HTTP Server on Ubuntu 25.04 (Lunar Lobster) :

✨ Step 1 : Update package lists and upgrade

sudo apt update
sudo apt upgrade -y

🚀 Step 2 : Install Apache2

sudo apt install apache2 -y

✅ Step 3 : Verify Apache is running

sudo systemctl status apache2

You should see active (running) in the output. To check via browser, visit http://localhost (or your server's IP), you should see the "Apache2 Ubuntu Default Page".

🔒 Step 4 : Configure firewall (if using UFW)

sudo ufw allow 'Apache Full'
sudo ufw enable
sudo ufw status

🧩 Step 5 : Optional - Manage Apache modules and services

  • Enable/disable modules :
sudo a2enmod rewrite
sudo a2dismod status
  • Restart Apache after changes :
sudo systemctl restart apache2
  • Reload configuration without full restart :
sudo systemctl reload apache2

📁 Step 6 : Deploy your site

  • Place website files in /var/www/html (default).
  • For virtual hosts, create files in /etc/apache2/sites-available/, then :
sudo a2ensite yoursite.conf
sudo systemctl reload apache2

🔧 Quick Commands Summary

sudo apt update
sudo apt install apache2 -y
sudo systemctl status apache2
sudo ufw allow 'Apache Full'
sudo ufw enable

Tags :