Blog · · The Expose team

localhost:8080: what runs on port 8080, why it won't load, and how to share it

What runs on localhost:8080, where Jenkins keeps its first password, the Tomcat manager login, and port-in-use fixes for macOS, Linux, Windows and Docker.

localhost:8080 is a web server on your own computer, listening on TCP port 8080. Port 8080 is the usual stand-in for port 80, the standard HTTP port, because it needs no root. On Linux, only a privileged process may listen on a port below 1024, and 8080 is above that line.

Open it in a browser on the same machine:

http://localhost:8080

localhost always means "this computer", so the address only works on the machine where the server runs. On your phone or a colleague's laptop it points at their own device. To open it elsewhere, see open localhost:8080 on your phone and share localhost:8080 with someone else.

What you see decides what to do next:

You see What it means Go to
A Jenkins "Unlock Jenkins" page or a login form Jenkins is running and wants its setup password Jenkins
A browser password prompt on /manager/html Tomcat's manager app, which has no users by default Tomcat manager
A Keycloak sign-in page Keycloak's admin console Keycloak
"This site can't be reached" or ERR_CONNECTION_REFUSED Nothing listens on port 8080 Connection refused
"Port 8080 was already in use" in your terminal Another program holds the port Port in use
A page from an app you didn't start Another program holds the port Find what uses port 8080

What runs on port 8080 by default
#

These tools listen on 8080 out of the box. Each row was checked in the tool's own documentation or source. Next.js, Rails and Express start on port 3000 instead, and Vite on port 5173.

Tool How it uses 8080 Change the port
Apache Tomcat <Connector port="8080" protocol="HTTP/1.1" ...> in conf/server.xml Edit port in that Connector element
Jenkins Web interface on 8080 --httpPort=8081, or Environment="JENKINS_PORT=8081" via sudo systemctl edit jenkins on Linux
Spring Boot Embedded web server on 8080 server.port=8081 in application.properties, or the SERVER_PORT environment variable
Keycloak HTTP on 8080 in development mode (start-dev) --http-port=8081 or KC_HTTP_PORT=8081
Vue CLI vue-cli-service serve on 8080 --port 8081, or devServer.port in vue.config.js
webpack-dev-server 8080 when no port is set --port 8081, or port: 'auto' for any free port
Docker images tomcat, jenkins/jenkins, adminer and nginx/nginx-unprivileged listen on 8080 inside the container Change the host side of -p, for example -p 8081:8080

Two details catch people out:

  • Keycloak only uses 8080 in development mode. In production mode (kc.sh start), HTTP is off and Keycloak listens on HTTPS port 8443. It uses 8080 only after you enable HTTP with --http-enabled=true.
  • Vue CLI moves on by itself. It treats 8080 as a starting point and searches for a free port from there. If 8080 is busy, your app may be on 8081 or higher, and the terminal shows the real address.

Why port 8080 instead of 80?
#

Port 80 is the default for HTTP, so http://localhost means http://localhost:80. On Linux, the ip(7) manual calls ports below 1024 "privileged ports". Only root, or a process with the CAP_NET_BIND_SERVICE capability, may listen on them. A development server on port 80 would need sudo.

Port 8080 needs no special rights, and it reads like 80. The IANA port registry lists 8080 as http-alt, "HTTP Alternate". Java servers, CI tools and dev servers default to it.

Is port 8080 HTTP or HTTPS?
#

Port 8080 is plain HTTP by convention. Open http://localhost:8080, not https://. If you type https://localhost:8080, the browser tries a TLS handshake with a server that doesn't speak TLS and shows an SSL error such as ERR_SSL_PROTOCOL_ERROR. The usual HTTPS counterpart is 8443. Tomcat's default connector redirects secure requests there, and Keycloak serves HTTPS on it.

localhost:8080 asks me to log in
#

A login screen on localhost:8080 usually means a server you installed is working as designed. Jenkins, Tomcat's manager and Keycloak all ask for credentials that you haven't set yet. Here is where each one keeps them.

Jenkins: Unlock Jenkins and the first admin password
#

A new Jenkins shows an "Unlock Jenkins" page and asks for an administrator password. Jenkins generates that password on first start, writes it to a file in the Jenkins home directory and prints it in the startup log. The paths below come from the Jenkins installation docs.

On Linux, from the Debian, Ubuntu or Red Hat packages:

sudo cat /var/lib/jenkins/secrets/initialAdminPassword

In Docker, with your container's name or ID:

docker exec jenkins cat /var/jenkins_home/secrets/initialAdminPassword

docker logs jenkins prints the same password.

On Windows, the default install keeps the file in C:\Program Files\Jenkins\secrets\initialAdminPassword. Jenkins also writes the password to jenkins.err.log in the Jenkins home directory. If you installed Jenkins somewhere else, the "Unlock Jenkins" page shows the path for your machine.

Paste the password, and the setup wizard asks you to install plugins and create the first admin user. Log in with that user from then on. If you skipped user creation, the username is admin and the password is still the one in initialAdminPassword.

Tomcat: the manager app login
#

Tomcat's start page links to the Manager App at http://localhost:8080/manager/html. It asks for a username and password, and no username works on a fresh install. According to Tomcat's manager docs, "access to the Manager application is completely disabled by default". The conf/tomcat-users.xml that ships with Tomcat has every user commented out.

Add a user with the manager-gui role to conf/tomcat-users.xml, inside the <tomcat-users> element:

<role rolename="manager-gui"/>
<user username="tomcat" password="pick-a-long-password" roles="manager-gui"/>

Restart Tomcat and log in with that username and password. manager-gui gives access to the HTML interface only. The manager-script role is for the text interface that build tools use.

If you get "403 Access Denied" instead of a login prompt, the request didn't come from your own machine. Tomcat's webapps/manager/META-INF/context.xml contains a RemoteCIDRValve with allow="127.0.0.0/8,::1/128", so the manager only answers requests from localhost. In Docker, requests from your host usually reach Tomcat from a Docker network address, not from 127.0.0.1, so they get the same 403.

Keycloak: the admin console
#

Keycloak's admin console is at http://localhost:8080/admin. Keycloak has no default admin user. Its Docker guide creates one when the container starts:

docker run -p 127.0.0.1:8080:8080 \
  -e KC_BOOTSTRAP_ADMIN_USERNAME=admin \
  -e KC_BOOTSTRAP_ADMIN_PASSWORD=admin \
  quay.io/keycloak/keycloak:26.8.2 start-dev

Without those two variables, open http://localhost:8080 from the same machine and create the admin user in the form there. Keycloak's docs say this form only works over a local connection.

Any other login page
#

If you didn't install Jenkins, Tomcat or Keycloak, some other program is on port 8080. Many admin tools use it, Adminer among them. Find the process to see which one it is.

localhost:8080 refused to connect
#

"This site can't be reached", "refused to connect" or ERR_CONNECTION_REFUSED means your computer has nothing listening on port 8080. Work through these causes in order.

  1. The server isn't running, or it crashed on start. Check the terminal or log where you started it. Spring Boot, for example, stops with "Web server failed to start. Port 8080 was already in use." when the port is taken. Run the port check below. If nothing is listening, start the server again and read the first error.
  2. The server picked another port. Vue CLI moves to the next free port when 8080 is busy, and a server.port, --port or PORT setting overrides the default. The startup output names the real port.
  3. Docker publishes the wrong port, or none. A container's port is only reachable from your machine if you publish it with -p HOST:CONTAINER. -p 8080:8080 maps port 8080 on your machine to port 8080 in the container. If the app inside the container listens on another port, such as 80, use -p 8080:80. Check what a container publishes with docker ps, in the PORTS column.
  4. The app inside the container listens on 127.0.0.1 only. Docker forwards published traffic to the container's network interface, not to the container's own loopback. The browser then shows a reset or empty response instead of the page. Make the app listen on 0.0.0.0 inside the container.
  5. Keycloak runs in production mode. kc.sh start serves HTTPS on 8443 and leaves 8080 closed. Use start-dev locally, or open https://localhost:8443.

If the server answers but shows a 404, the server is fine and the path is wrong. Tomcat, for example, deploys myapp.war under http://localhost:8080/myapp/, not at the root.

Port 8080 is already in use
#

Each tool reports a taken port in its own way:

Web server failed to start. Port 8080 was already in use.      # Spring Boot
Bind for 0.0.0.0:8080 failed: port is already allocated         # Docker
Error: listen EADDRINUSE: address already in use :::8080        # Node.js

You have two fixes: stop the program that holds the port, or run your app on another port such as 8081. First find out what holds it.

Find what uses port 8080
#

On macOS:

lsof -nP -iTCP:8080 -sTCP:LISTEN

On Linux:

sudo ss -ltnp 'sport = :8080'
# or
sudo lsof -nP -iTCP:8080 -sTCP:LISTEN

Both print the process name and its PID. Without sudo, Linux hides processes that belong to other users, such as a Jenkins service.

On Windows, in Command Prompt:

netstat -ano | findstr :8080
tasklist /FI "PID eq 1234"

The last column of netstat is the PID. Put it into tasklist to see the program name.

On Windows, in PowerShell:

Get-Process -Id (Get-NetTCPConnection -LocalPort 8080 -State Listen).OwningProcess

For Docker containers that publish port 8080:

docker ps --filter publish=8080

Stop the process
#

On macOS and Linux, with the PID from above:

kill 1234

Use kill -9 1234 only if the process ignores the first signal. If the PID belongs to a service that starts at boot, stop the service instead, or it comes back. For a Jenkins package on Linux:

sudo systemctl stop jenkins

On Windows:

taskkill /PID 1234 /F

For a container:

docker stop CONTAINER_NAME

A stopped container doesn't hold its port. A container that restarts on its own, for example with --restart=always, takes the port back, so remove it with docker rm -f CONTAINER_NAME if you don't need it.

Windows says the port is in use, but nothing is listening
#

Windows can reserve ranges of ports for Hyper-V, WSL 2 or Docker Desktop. A reserved port fails to bind even though netstat shows nothing on it. List the reserved ranges:

netsh interface ipv4 show excludedportrange protocol=tcp

If 8080 falls inside a range, use another port, or restart the service that reserved it.

localhost:8081: when 8080 is taken
#

8081 is the port most people move to when 8080 is busy. Jenkins' own Linux docs use 8081 as the example when "a port is in use". To run your app there:

# Spring Boot
SERVER_PORT=8081 ./mvnw spring-boot:run

# Jenkins on Linux: run `sudo systemctl edit jenkins` and add
# [Service]
# Environment="JENKINS_PORT=8081"

# Keycloak
bin/kc.sh start-dev --http-port=8081

# Vue CLI
npx vue-cli-service serve --port 8081

# webpack-dev-server
npx webpack serve --port 8081

# Any Docker image: change the host side only
docker run -p 8081:8080 jenkins/jenkins:lts-jdk21

Then open http://localhost:8081.

Some tools use 8081 as their own default, so check that it's free before you move there:

  • Sonatype Nexus Repository. The sonatype/nexus3 image publishes port 8081: docker run -d -p 8081:8081 --name nexus sonatype/nexus3.
  • Metro, the React Native bundler. Metro's configuration docs say the port "Defaults to 8081". React Native's docs suggest npm start -- --port=8088 when 8081 is taken.
  • mongo-express. The Docker image's docs publish it on http://localhost:8081.
  • A second Vue CLI app. Vue CLI searches upward from 8080 for a free port, so a second app started while the first holds 8080 usually ends up on 8081.

The same lsof, ss and netstat commands work for 8081. Replace the port number.

Open localhost:8080 on your phone
#

Your phone can't open localhost:8080, because on the phone localhost is the phone. If both devices are on the same Wi-Fi, Expose's local network sharing gives you an address the phone can open, and a QR code to scan:

expose share http://localhost:8080 --lan --qr-code

Expose prints a LAN URL with your computer's network address and a port, and a QR code in the terminal. Nothing goes through an Expose server, so you need no account and no internet connection. You need the Expose client 4.2 or later.

Expose's LAN listener prefers port 8080 as well. Your app already holds it, so Expose takes another free port. Open the LAN URL exactly as Expose prints it, or choose the port with --lan=9000.

Some limits apply:

  • The LAN URL is plain HTTP. Browsers only allow features such as the camera, the clipboard and service workers on HTTPS pages. Use a public tunnel, below, when you need HTTPS.
  • Everyone on the network can open it. On shared Wi-Fi, add --basicAuth="user:secret".
  • Your firewall has to allow incoming connections for expose.

Many servers on 8080 already listen on every network interface. If yours does, the phone can also open http://YOUR-LAN-IP:8080 directly, firewall permitting. Find the address with ipconfig getifaddr en0 on macOS, hostname -I on Linux or ipconfig on Windows. --lan helps when the app listens on 127.0.0.1 only, as in the Keycloak command above, and it adds the QR code and the request dashboard.

Share localhost:8080 with someone else
#

To show your app to a client, a tester or a teammate in another place, or to receive webhooks from GitHub or Stripe, you need a public URL. A tunnel gives you one without touching your router:

expose share http://localhost:8080

Expose prints a public HTTPS URL. Every request to it travels through the tunnel to localhost:8080, and your app answers as usual. Expose connects to localhost itself, so your app can keep listening on 127.0.0.1 only. A Docker container published with -p 127.0.0.1:8080:8080 works too. Visitors get your app directly, with no warning page in front of it, on every plan. While you share, http://127.0.0.1:4040 shows each request with its headers, body and response.

Install Expose first if you don't have it:

# macOS and Linux
curl -fsSL https://expose.dev/install.sh | sh

# Windows, in PowerShell
irm https://expose.dev/install.ps1 | iex

The first expose share opens your browser to sign in or create a free account. On the free plan, the URL is random and changes on every connection, and each connection has a time limit. Expose Pro, at $79 per user per year, adds a reserved subdomain with --subdomain=my-app, so the URL stays the same for webhooks and OAuth callbacks. The sharing docs list every option.

If you're new to tunnels, hosting from localhost explains how a tunnel compares with port forwarding and a deploy. If you can't change your router's settings at all, see port forwarding without router access.

The browser talks HTTPS to the tunnel, and the tunnel talks plain HTTP to your app. An app that builds absolute URLs from the request may then send visitors to http:// links, or redirect them to localhost:8080 after a login. Expose passes the public scheme and hostname in the X-Forwarded-Proto and X-Forwarded-Host headers. Tell your app to trust them, in your local environment only:

  • Spring Boot 4.2 and later: server.request.header.forwarded.strategy=web-server in application.properties. Up to Spring Boot 4.1, including 3.x, the property is server.forward-headers-strategy=NATIVE. Both are described in Spring Boot's proxy how-to.
  • Keycloak: start it with --proxy-headers xforwarded. Keycloak's reverse proxy guide warns that requests through a proxy otherwise fail its origin checks with 403 Forbidden.
  • Jenkins: set the Jenkins URL under Manage Jenkins, System, to the tunnel URL. Jenkins' reverse proxy troubleshooting page says that URL must match the one you use to access Jenkins, and that Jenkins reads X-Forwarded-Host and X-Forwarded-Proto for redirects.

A Vue CLI or webpack dev server on 8080 answers a tunnel URL with "Invalid Host header" instead. Add .sharedwithexpose.com to devServer.allowedHosts, as described in the Invalid Host header fix for each framework.

Be careful with admin pages
#

Many apps on 8080 are admin tools: a CI server that runs code, a servlet container that deploys it, an identity server. Anyone with the public URL can reach their login page.

Two localhost-only rules also stop protecting you once you share. Requests through the tunnel reach your app from 127.0.0.1, so Tomcat's manager valve lets them through. And Keycloak's first-admin form only works over a local connection, so create the Keycloak admin before you share, not after.

Put a login in front with --magic-auth, which asks visitors for an email address and only admits the addresses or domains you list:

expose share http://localhost:8080 [email protected],[email protected]

--basicAuth works too, except in front of an app that already uses HTTP basic authentication, such as Tomcat's manager. Stop expose with Ctrl+C when you're done, and the URL stops answering.

Questions
#

How do I open localhost:8080?
#

Type http://localhost:8080 into the address bar of a browser on the computer where the server runs. http://127.0.0.1:8080 is the same address. If the page doesn't load, start with connection refused.

Can someone else open my localhost:8080?
#

Not with that address. On their device, localhost points at their own computer. Someone on your Wi-Fi can open your computer's LAN address, for example with expose share http://localhost:8080 --lan. Someone anywhere else needs a public URL, for example from expose share http://localhost:8080.

Is it safe to leave port 8080 open?
#

A server on 8080 that listens on all network interfaces is reachable by every device on your network, unless your firewall blocks it. Behind a typical home or office router, it isn't reachable from the internet unless the router forwards the port or you share it through a tunnel. To keep a server to your own machine, make it listen on 127.0.0.1, or publish Docker containers with -p 127.0.0.1:8080:8080.

What is localhost:8080/login?
#

It's the login page of whatever app runs on port 8080. Jenkins uses /login, and Spring Security's default form login uses /login as well. If you don't know which app it is, find the process on port 8080.


Defaults and paths as documented on December 5, 2026: Tomcat 11 and its server.xml, Jenkins installation and initial settings, Spring Boot 4.2 and 3.5, Keycloak, Vue CLI, webpack-dev-server, Docker port publishing, Metro, React Native troubleshooting and the Docker Hub pages for tomcat, adminer, nginx-unprivileged, sonatype/nexus3 and mongo-express.