Era Host hosting
EraHost – Free Domain, Cheap Hosting!
Client Area
Support 24/7
Menu

What Is Port 8080 Used For and How Is It Applied?

5 min read
07.07.2025

What Is Port 8080?

Port 8080 is a widely used TCP port commonly associated with alternative HTTP web services. While the standard HTTP port is 80, developers and administrators frequently use 8080 for various purposes.

Port 8080 Network Usage Applications
Port 8080 — alternative HTTP. Tomcat, Jenkins, dev servers.

For related port/firewall topics, see https://localhost:110501 — Fix Invalid Port Error (diagnosing nothing-on-port errors).

Primary Uses of Port 8080:

  • Testing web servers without interfering with production services running on port 80.
  • Running development environments and staging servers.
  • Hosting web applications like Java Tomcat, Node.js services, or proxy servers.
  • Administrative web interfaces for network tools and monitoring dashboards.
Why Use Port 8080 Instead of Port 80?
1. Privilege Requirements: On Unix/Linux systems, binding to ports 1-1024 (including port 80) requires root/admin privileges. Port 8080 can be used by non-root users, making it safer for development.
2. Multiple Services: It allows running multiple web services on the same machine (e.g., production on :80, testing on :8080).
3. Conflict Avoidance: Helps avoid conflicts with existing web servers or applications.

Common Applications Using Port 8080

Application Purpose Typical Use Case
Apache/Nginx Web servers for hosting websites Development/staging servers, secondary web services
Tomcat Java-based application server Default port for many Tomcat installations
Node.js Hosting JavaScript backend services Development servers (Express.js, etc.)
Jenkins Continuous Integration (CI/CD) tool Web-based automation interface (often on :8080)
Squid Proxy Caching and forward proxy server Web proxy administration interface
Docker Containers Web applications in isolated environments Mapped container ports to host port 8080
Grafana Web-based monitoring dashboards Alternative monitoring interface

How to Use Port 8080 on Your Server

1. Check If Port 8080 Is Open and Accessible

First, verify if port 8080 is already in use and if it's reachable from outside your server.

Check local usage:

sudo ss -tlnp | grep :8080
# OR
sudo netstat -tlnp | grep :8080

Test remote connectivity (from another machine):

nc -zv yourserver.com 8080
# OR
telnet yourserver.com 8080
  • If successful, the port is open and listening.
  • If blocked, proceed to configure the firewall.

2. Allow Port 8080 in Your Firewall

If the port is blocked, open it in your system firewall.

On Ubuntu/Debian (UFW):

sudo ufw allow 8080/tcp
sudo ufw reload
sudo ufw status # Verify the rule

On CentOS/RHEL/Fedora (Firewalld):

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

On cloud providers (AWS, Google Cloud, Azure):

  • You must also configure the security group or firewall rules in your cloud console to allow inbound TCP traffic on port 8080.

3. Configure a Web Server to Use Port 8080

For Apache:

  1. Edit the main configuration or ports file:
    sudo nano /etc/apache2/ports.conf  # Ubuntu/Debian
    # OR
    sudo nano /etc/httpd/conf/httpd.conf  # CentOS/RHEL
  2. Add or modify the Listen directive:
    Listen 8080
  3. In your virtual host configuration, ensure it's set to port 8080:
    <VirtualHost *:8080>
  4. Restart Apache:
    sudo systemctl restart apache2  # Ubuntu/Debian
    # OR
    sudo systemctl restart httpd  # CentOS/RHEL

For Nginx:

  1. Edit your site configuration:
    sudo nano /etc/nginx/sites-available/your-site
  2. Modify or add a server block:
    server {
        listen 8080;
        server_name yourserver.com;
        root /var/www/html;
        index index.html index.php;
    
        # Rest of your configuration...
    }
  3. Test configuration and restart:
    sudo nginx -t
    sudo systemctl restart nginx

4. Access Your Web Service on Port 8080

Once configured, open a browser and navigate to:

http://yourserver.com:8080
# or
http://SERVER_IP_ADDRESS:8080

If you see your web page or application, port 8080 is working correctly.

Linux VDS
High performance for your projects
  • Root access and flexible setup
  • Control panel
  • NVMe disks
  • DDR5
Linux VDS

How to Forward Port 8080 to Port 80

If you want users to access your service without specifying :8080 in the URL, you can forward traffic from port 80 to 8080.

Security Note: Ensure the service on port 8080 is properly secured before exposing it through port 80. Consider using HTTPS (port 443) for production sites.

Using iptables (Linux):

sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080

To make the rule persistent (on Ubuntu/Debian):

sudo apt-get install iptables-persistent -y
sudo netfilter-persistent save

Using Nginx as a Reverse Proxy (Recommended):

Create or modify an Nginx site configuration to proxy requests:

server {
    listen 80;
    server_name yourdomain.com www.yourdomain.com;

    location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}
sudo nginx -t
sudo systemctl restart nginx

Summary

Task Command / Action
Check if port 8080 is open nc -zv yourserver.com 8080
Allow port 8080 in UFW (Ubuntu/Debian) sudo ufw allow 8080/tcp
Allow port 8080 in Firewalld (CentOS/RHEL) sudo firewall-cmd --add-port=8080/tcp --permanent
Configure Apache on port 8080 Add Listen 8080 in ports.conf or httpd.conf
Configure Nginx on port 8080 Modify server block: server { listen 8080; ... }
Test if port 8080 works Open http://yourserver.com:8080 in browser
Forward port 80 to 8080 Use iptables redirect or Nginx reverse proxy
Final Tip: For production environments, consider setting up SSL/TLS (HTTPS) for services on port 8080. You can use Let's Encrypt with a tool like Certbot and configure your web server to listen on port 8443 or use a reverse proxy on port 443.

Now you understand what port 8080 is used for and how to configure it on your server for development, testing, and production purposes!

Frequently asked questions
Historic: in the late 1990s, sysadmins testing web servers as non-root needed a port ≥ 1024 (Linux ports < 1024 require root). 8080 was visually intuitive ("two 80s") and unused. It got standardized in service registries as `http-alt` and stuck. Today any custom HTTP service on an unprivileged port defaults there.
Depends on what's listening. Tomcat's default 8080 with unpatched apps and the admin manager open = decade of exploits. Jenkins on open 8080 with anonymous access = RCE. Best practice: bind 8080 to localhost, put nginx/apache on 80/443 as reverse proxy, terminate TLS there. Direct exposure is only for short-lived dev/test scenarios.
`iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080`. Persists across reboot only if you save with `iptables-save` and have iptables-persistent installed. With nftables (modern Ubuntu/Fedora): `nft add rule ip nat prerouting tcp dport 80 redirect to :8080`. Better long-term: just run your service on 80 with `CAP_NET_BIND_SERVICE`.
Yes for production, no for dev. Production deployments of Tomcat are almost always behind a reverse proxy (Apache, Nginx) — Tomcat binds 127.0.0.1:8080 and the proxy listens on 80/443. Visible-to-internet 8080 invites scanning bots. In server.xml, change Connector port or the listening address.
Related articles
How to Use Port 8080 on a VPS: Complete Configuration Guide
What is PortQuiz.net? The Ultimate Port Testing Service Explained
421 Too Many Connections (10) From This IP — Shared IP Usage