Port 8080 (HTTP Alternate)

Port 8080 is registered with IANA as the alternate HTTP port (HTTP Alternate), and it's commonly used by web and application servers that listen alongside…

Key facts

Port
8080
Protocols
TCP
Range
Registered port, 1024-49151
IANA service name
http-alt

IANA assigns ports in this range to services on request, under RFC 6335.

About port 8080

Port 8080 is registered with IANA as the alternate HTTP port (HTTP Alternate), and it's commonly used by web and application servers that listen alongside port 80 or instead of it. The port runs over TCP, and it usually serves plain, unencrypted HTTP.

IANA registers port 8080 for the http-alt service, with a reference to port 80.

What port 8080 is used for

  • Application behind a reverse proxy: applications written in Node.js or Python, for example, listen on port 8080, while the web server receives visitors on ports 80 and 443 and forwards their requests to the application.
  • Development and testing: many development servers listen on port 8080 by default, so they don't clash with the main web server.
  • Containers: in Docker, it's common to map the container's port 80 to the server's port 8080, for example -p 8080:80.
  • Admin interfaces: some software shows its admin interface on port 8080.

Port 8080 in the firewall

In most cases, there's no need to open port 8080 to the internet. When the application listens on port 8080 behind a reverse proxy on the same server, visitors arrive through ports 80 and 443, and the application can listen only on 127.0.0.1.

When direct access to port 8080 is needed, for example for testing, allow it only from specific addresses:

  • UFW: ufw allow from 203.0.113.10 to any port 8080 proto tcp
  • firewalld: firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="203.0.113.10" port port="8080" protocol="tcp" accept'

Note: a port mapped from a Docker container may be reachable from outside even when a UFW rule blocks it, because Docker adds its own firewall rules. To limit such a port to the server itself, map it only to 127.0.0.1, for example -p 127.0.0.1:8080:80.

Risks and security

Port 8080 usually carries unencrypted HTTP, and admin interfaces or development versions of applications sometimes listen on it. That's why it's important to know which services listen on it, and not to leave them exposed without a reason:

  • Serve the site to visitors over HTTPS, on port 443, and keep port 8080 behind the reverse proxy.
  • Set the application to listen on 127.0.0.1 when there's no need for direct outside access.
  • Protect admin interfaces with a strong password and by limiting access by IP address.
  • Check from time to time which ports are open on the server, and shut down development services that are no longer in use.

Commands to check and configure

  • ss -tlnp | grep ':8080 '

    Shows which process is listening on port 8080, and on which address.

  • curl -I http://127.0.0.1:8080

    Checks from the server itself that the application on port 8080 responds, and shows the response headers.

  • curl -I http://example.com:8080

    Checks from outside whether port 8080 is reachable, and what it serves.

  • nc -zv example.com 8080

    Checks whether port 8080 on the server is open and reachable.

  • docker ps --format "{{.Names}} {{.Ports}}"

    Shows the running containers and the port mapping of each one.

  • docker run -d -p 127.0.0.1:8080:80 nginx

    Starts a container and maps its port to port 8080 on the server, on 127.0.0.1 only.

  • ufw allow from 203.0.113.10 to any port 8080 proto tcp

    Allows access to port 8080 only from the given IP address (UFW).

  • firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="203.0.113.10" port port="8080" protocol="tcp" accept'

    Allows access to port 8080 in firewalld only from the given IP address. Then run firewall-cmd --reload.

Port 8080 in the IANA registry

Port Protocol Service IANA registry description
8080 TCP http-alt HTTP Alternate (see port 80)
8080 UDP http-alt HTTP Alternate (see port 80)

Data source: IANA Service Name and Transport Protocol Port Number Registry (opens in a new tab)

Port 8080 FAQ

What's the difference between port 8080 and port 80?

Both are used for HTTP. Port 80 is the default port, so browsers connect to it when the address doesn't include a port number. With port 8080, you have to state the port in the address, for example example.com:8080, which is why it's used mainly for applications behind a reverse proxy, development, and testing.

How do I serve an application listening on port 8080 at a regular address, without a port number?

Set up a web server as a reverse proxy: it receives visitors on ports 80 and 443, handles the SSL certificate, and forwards requests to the application on port 8080. The Nginx cheat sheet has examples of this setup.

Why does my site open only when I add port 8080 to the address?

The application listens on port 8080, and nothing on ports 80 and 443 forwards requests to it. Setting up a reverse proxy, or setting the application to listen on the regular port, lets visitors reach it at an address without a port number.

Is the connection on port 8080 encrypted?

Not by default. Port 8080 usually serves plain HTTP. The common way to encrypt the connection is to serve the application to visitors over HTTPS, on port 443, through a reverse proxy.

Shopping cart

Your cart is emptyYou can start with one of our popular plans.

Site search

Accessibility

Text size
100%
Accessibility statement