PortGate

Resources · Port reference · port 8080

Port 8080 (alternate HTTP): what it is and how to secure it

Port 8080 is where app servers, admin panels and dashboards end up published by accident. Nothing on it should face the internet directly.

Check command

sudo ss -tlnp | grep ':8080 '

Copied.

Port 8080 is the usual "second web port". Tomcat, Jenkins, Spring Boot, Traefik's dashboard, Adminer and many Docker images listen on it. On a server, it should be reachable only from the machine itself, with nginx, Caddy or another reverse proxy serving the public site on 443.

What port 8080 is for

8080 became the default for anything that serves HTTP but is not the main web server, because ports below 1024 need root. Common listeners:

  • Java app servers: Tomcat, Jetty, Spring Boot and Keycloak (older versions).
  • CI and admin tools: Jenkins, and the Traefik dashboard when --api.insecure=true is set.
  • Containers: many images document -p 8080:8080 as the quick start.

Why an open 8080 is risky

What is behind 8080 is often an admin interface, not a public website. Jenkins can run build scripts, so an exposed Jenkins with weak or no login is remote code execution. Tomcat's manager app can deploy a WAR file, which is the same thing. The Traefik insecure dashboard shows your routes and backends to anyone.

8080 is also usually plain HTTP, so any login typed into it crosses the internet unencrypted.

Check yours

On the server:

sudo ss -tlnp | grep ':8080 '
docker ps --format '{{.Names}}\t{{.Ports}}' | grep 8080

0.0.0.0:8080 or [::]:8080 means every interface. 127.0.0.1:8080 is local only, which is what you want.

From another machine:

curl -sI --max-time 5 http://YOUR_SERVER_IP:8080

Any response means the internet can reach it.

Fix it

Docker: publish the port on loopback only, then put the proxy in front:

services:
  app:
    ports:
      - "127.0.0.1:8080:8080"
docker compose up -d

UFW does not protect Docker-published ports: Docker writes its own iptables rules that are checked before UFW's. Binding to 127.0.0.1 is the fix that actually holds.

A service installed on the host: set its listen address to 127.0.0.1. For Tomcat, add address="127.0.0.1" to the HTTP <Connector> in server.xml. For Spring Boot, set server.address=127.0.0.1. For Jenkins, set --httpListenAddress=127.0.0.1 in its service settings.

Then serve it through nginx with HTTPS:

location / {
    proxy_pass http://127.0.0.1:8080;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Proto $scheme;
}

Common mistakes

  • Allowing 8080 in UFW "temporarily" during setup and never removing it.
  • Trusting UFW for a Docker container. See above.
  • Putting an admin tool on a public hostname with only the tool's own login in front. Add a VPN, an IP allow list or SSO in front of admin interfaces.

FAQ

Is port 8080 safe to open? Only for a service designed to be public, and even then prefer 443 through a proxy so it gets HTTPS.

Is 8080 more secure than 80 because it is unusual? No. Scanners check 8080 as often as 80.

How do I get warned? PortGate's Server Guard reports every public port, including Docker-published ones, and alerts when a new one opens.