Fix XAMPP Apache Port 80 in Use or Port Conflict Error
Getting a “Port 80 in use” error in XAMPP? Here’s how to solve Apache port conflicts on Windows, macOS, and Linux/Ubuntu in easy steps.
🧩 Introduction
XAMPP often fails to start Apache because Port 80 (HTTP) is already used by another application. This is one of the most common issues when working with local servers.
In this guide, we’ll show you how to:
- Identify what’s using Port 80
- Change Apache’s port
- Fix the issue on Windows, macOS, and Linux/Ubuntu
❗ What Causes It?
- Skype, IIS, Docker, VMware, or even antivirus software using Port 80
- Apache not shutting down cleanly
- Firewall/antivirus blocking ports
🖥️ Fix on Windows
✅ Option 1: Find What’s Using Port 80
- Open Command Prompt as Administrator:
netstat -aon | findstr :80
- Note the PID (Process ID).
- Run:
tasklist | findstr [PID]
Replace[PID]
with the number from the previous command. - Close the program or disable the service using it (e.g., Skype, IIS).
✅ Option 2: Change Apache’s Port
- Go to XAMPP Control Panel > Apache > Config > httpd.conf
- Find:
Listen 80
and change to:Listen 8080
- Also change:
ServerName localhost:80
to:ServerName localhost:8080
- Save and close.
- Update httpd-ssl.conf (if needed):
- Change:
Listen 443
to:Listen 4433
- Change:
- Restart Apache.
- Access XAMPP via:
http://localhost:8080
🍏 Fix on macOS
✅ Check Port Usage
- Open Terminal:
sudo lsof -i :80
- Identify the process name (e.g., httpd, nginx, Skype).
- Kill the process (if safe):
sudo kill -9 [PID]
✅ Change Apache Port
- Open:
sudo nano /Applications/XAMPP/xamppfiles/etc/httpd.conf
- Change:
Listen 80
to:Listen 8080
- Change:
ServerName localhost:80
to:ServerName localhost:8080
- Restart Apache:
sudo /Applications/XAMPP/xamppfiles/xampp restartapache
- Visit:
http://localhost:8080
🐧 Fix on Linux/Ubuntu
✅ Check Port Usage
sudo netstat -tuln | grep :80
OR
sudo lsof -i :80
Kill the process:
sudo kill -9 [PID]
✅ Change Apache Port
- Edit Apache config:
sudo nano /opt/lampp/etc/httpd.conf
- Update:
Listen 8080 ServerName localhost:8080
- Restart Apache:
sudo /opt/lampp/lampp restart
- Visit:
http://localhost:8080
✅ Bonus Tip: Auto-Redirect to New Port
If you’re using port 8080, create a browser bookmark for:
http://localhost:8080/dashboard/
You can also use .htaccess
to redirect from /
to the correct port or add a shortcut in your IDE.
📌 Conclusion
The “Port 80 in use” error is annoying but very common. With the steps above, you can either free up the port or simply reconfigure Apache to use an alternate port on any platform.
💬 Got a Different Port Issue?
Comment with your port conflict or system logs and I’ll help you solve it!