localhost:8080

http://localhost:8080

Port 8080 is the most popular alternative to standard HTTP port 80. It's commonly used for Apache Tomcat, Spring Boot applications, Jenkins CI/CD, development servers, and when port 80 is already occupied by another service.

→ Open localhost:8080

What Uses Port 8080?

Many applications and services default to port 8080:

  • Apache Tomcat - Java servlet container and application server
  • Spring Boot - Default embedded server port for Spring applications
  • Jenkins - CI/CD automation and build server
  • JBoss/WildFly - Java Enterprise application servers
  • Alternative web servers - When port 80 is already in use
  • HTTP proxy servers - Squid, Nginx proxy configurations
  • XAMPP alternative - When IIS or Skype uses port 80
  • Development environments - Testing and debugging
  • Docker containers - Mapped container ports
  • GlassFish - Java EE application server
  • Jetty - Lightweight Java web server

How to Start Server on Port 8080

Python Web Server

# Python 3.x - Simple HTTP server python -m http.server 8080 # Python 2.x - Simple HTTP server python -m SimpleHTTPServer 8080 # Access at: http://localhost:8080

Node.js HTTP Server

// Create server.js file const http = require('http'); const server = http.createServer((req, res) => { res.writeHead(200, {'Content-Type': 'text/html'}); res.end('Server running on port 8080!'); }); server.listen(8080, 'localhost', () => { console.log('Server running at http://localhost:8080/'); }); // Run: node server.js

PHP Built-in Server

# Start PHP development server on port 8080 php -S localhost:8080 # Serve specific directory php -S localhost:8080 -t public/ # Access at: http://localhost:8080

Apache Tomcat

# Windows cd C:\Program Files\Apache Software Foundation\Tomcat\bin startup.bat # Linux/Mac cd /opt/tomcat/bin ./startup.sh # Access Tomcat at: http://localhost:8080 # Tomcat Manager: http://localhost:8080/manager

Spring Boot Application

# application.properties server.port=8080 # Or set via command line java -jar myapp.jar --server.port=8080 # Access at: http://localhost:8080

How to Fix "localhost:8080 Not Working" Issues

Error: "This site can't be reached" or "Connection refused"

The server is not running or not listening on port 8080.

  • Verify the application/server is actually running
  • Check if process is listening on port 8080
  • Ensure firewall allows connections on port 8080
  • Try 127.0.0.1:8080 instead of localhost:8080
  • Check server logs for startup errors
  • Restart the server application

Error: "Port 8080 already in use" or "Address already in use"

Another application is already using port 8080.

  • Find which process is using port 8080 (see commands below)
  • Stop the conflicting application
  • Kill the process using port 8080
  • Use a different port like 8081, 8082, or 9090
  • Change application configuration to use alternative port

Error: "403 Forbidden" on localhost:8080

Permission or access denied issue.

  • Check directory permissions and file ownership
  • Review web server access configuration
  • Ensure index file exists (index.html, index.php)
  • Check .htaccess rules if using Apache
  • Verify user has read permissions
Check What's Using Port 8080:
# Windows - Find process on port 8080 netstat -ano | findstr :8080 tasklist | findstr [PID] # Kill process by PID taskkill /PID [process_id] /F # Linux - Find process on port 8080 sudo lsof -i :8080 sudo netstat -tulpn | grep :8080 sudo ss -tulpn | grep :8080 # Kill process by PID sudo kill -9 [PID] # Mac - Find process on port 8080 lsof -i :8080 sudo lsof -ti:8080 | xargs kill -9 # Show all listening ports netstat -an | grep LISTEN
Test Port 8080 Connection:
# Windows - Test if port is open Test-NetConnection localhost -Port 8080 # Linux/Mac - Test port with telnet telnet localhost 8080 # Test with curl curl http://localhost:8080 # Test with wget wget http://localhost:8080 # Use nc (netcat) to test nc -zv localhost 8080

Configure Apache to Use Port 8080

Change Apache from default port 80 to port 8080:

  1. Open Apache configuration file: httpd.conf
  2. Find line: Listen 80
  3. Change to: Listen 8080
  4. Find: ServerName localhost:80
  5. Change to: ServerName localhost:8080
  6. Save httpd.conf file
  7. Restart Apache web server
  8. Access site at http://localhost:8080

Apache config file locations:

  • XAMPP Windows: C:\xampp\apache\conf\httpd.conf
  • XAMPP Linux: /opt/lampp/etc/httpd.conf
  • Ubuntu: /etc/apache2/ports.conf and /etc/apache2/sites-available/000-default.conf
  • CentOS: /etc/httpd/conf/httpd.conf

Configure Tomcat Port 8080

Tomcat uses port 8080 by default, but you can change it:

  1. Open Tomcat server.xml configuration file
  2. Find Connector element: <Connector port="8080"
  3. Change port number to desired value
  4. Save server.xml file
  5. Restart Tomcat server
<!-- Change Tomcat port in server.xml --> <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> <!-- Change to different port --> <Connector port="9090" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />

Tomcat server.xml locations:

  • Windows: C:\Program Files\Apache Software Foundation\Tomcat\conf\server.xml
  • Linux: /opt/tomcat/conf/server.xml or /var/lib/tomcat/conf/server.xml
  • Mac: /usr/local/tomcat/conf/server.xml

Firewall Configuration for Port 8080

Windows Firewall

# Open port 8080 in Windows Firewall netsh advfirewall firewall add rule name="Port 8080" dir=in action=allow protocol=TCP localport=8080 # Remove firewall rule netsh advfirewall firewall delete rule name="Port 8080" protocol=TCP localport=8080

Linux Firewall (UFW)

# Allow port 8080 sudo ufw allow 8080/tcp # Check firewall status sudo ufw status # Remove rule sudo ufw delete allow 8080/tcp

Linux Firewall (firewalld)

# Allow port 8080 sudo firewall-cmd --permanent --add-port=8080/tcp sudo firewall-cmd --reload # Check open ports sudo firewall-cmd --list-ports

Docker Container on Port 8080

# Run container mapping port 8080 docker run -d -p 8080:80 nginx # Run Tomcat on port 8080 docker run -d -p 8080:8080 tomcat # Run custom app on port 8080 docker run -d -p 8080:3000 myapp # List containers with ports docker ps # Access at: http://localhost:8080

Nginx as Reverse Proxy on Port 8080

# nginx.conf configuration server { listen 8080; server_name localhost; location / { proxy_pass http://localhost:3000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } } # Test nginx configuration nginx -t # Restart nginx sudo systemctl restart nginx

Common Port 8080 Use Cases

Development and Testing

  • Running development server while production uses port 80
  • Testing applications without affecting main server
  • Multiple developers running servers on same machine

Enterprise Applications

  • Java EE applications on Tomcat/JBoss
  • Spring Boot microservices
  • Jenkins continuous integration builds

Conflict Resolution

  • IIS using port 80 on Windows
  • Skype using port 80 and 443
  • Multiple web servers on same system
Pro Tip: If port 8080 is occupied, common alternatives are 8081, 8082, 8888, 9090, and 3000. Most applications allow you to configure the port in their settings or via command-line arguments.

Port 8080 vs Other Ports

Port Common Use Protocol
80 Default HTTP web traffic HTTP
8080 Alternative HTTP, Tomcat, proxies HTTP
443 HTTPS secure web traffic HTTPS
8443 Alternative HTTPS port HTTPS
3000 Node.js, React development HTTP
8000 Django, Python development HTTP
8888 Jupyter Notebook, alternative web HTTP

Frequently Asked Questions

Why use port 8080 instead of 80?

Port 8080 is used when port 80 is already occupied, for security (non-privileged port above 1024), or by convention for specific applications like Tomcat.

How do I access localhost:8080 from another computer?

Replace localhost with your computer's IP address (e.g., http://192.168.1.100:8080). Ensure firewall allows connections and server is listening on 0.0.0.0 instead of just 127.0.0.1.

Is port 8080 secure?

Port 8080 uses HTTP which is not encrypted. For secure connections, use port 8443 with HTTPS/SSL. Never expose port 8080 directly to internet on production servers.

Can I run multiple services on port 8080?

No, only one service can listen on a port at a time. Use different ports (8081, 8082) for additional services, or use a reverse proxy to route requests.

Related Ports and Resources