localhost:8080: What Runs on It and How to Fix It

Port 8080 is the classic second web port, chosen by Java servers and many dev tools because port 80 needs admin rights. Apache Tomcat, Spring Boot, Jenkins and webpack-dev-server all start there by default. A refused connection means none of them is running; a startup failure means something else already holds 8080.

Tools that use port 8080 out of the box
ToolHow it startsChange the port with
Spring Boot./mvnw spring-boot:runserver.port=8081 in application.properties
Apache Tomcatbin/startup.shConnector port in conf/server.xml
Jenkins (war file)java -jar jenkins.war--httpPort=8081
webpack-dev-servernpx webpack serve--port 8081
http-server (npm)npx http-server-p 8081

Updated

Because so many unrelated programs default to 8080, the usual surprise is that the page loads but shows the wrong app, or that your server refuses to start because Jenkins or a forgotten container got there first. Work out which program you expect, then check which one is really listening.

Find and stop what holds port 8080

Mac, Linux and Windows commands

The first two lines are for macOS and Linux; the last two are for the Windows Command Prompt.

lsof -nP -iTCP:8080 -sTCP:LISTEN
kill <PID>

netstat -ano | findstr :8080
taskkill /PID <PID> /F

Move a Spring Boot app off 8080

Either line works; the property file change is permanent, the flag only applies to that run.

# src/main/resources/application.properties
server.port=8081

# or for one run
./mvnw spring-boot:run -Dspring-boot.run.arguments=--server.port=8081

Why so many tools picked 8080

On Linux and macOS, programs need elevated rights to listen on ports below 1024. Developers wanted a port that looked like 80 and needed no special rights, so 8080 became the convention for Java servers in the 1990s and stuck.

That history is why port 8080 is crowded. A Spring Boot app, a Jenkins service and a Docker container can all expect it on the same laptop.

Refused to connect: fixes by stack

Spring Boot: a failed bean or a database it cannot reach stops startup before Tomcat opens the port. Fix the first exception in the log. Tomcat on its own: check logs/catalina.out, and confirm the Connector element in server.xml really says 8080.

Docker: the container must publish the port (-p 8080:8080) and the app inside must listen on 0.0.0.0, not 127.0.0.1, or the host cannot reach it. webpack-dev-server: a compile error can leave the server up but the page blank, so read the terminal and the browser console.

If you only need a business website rather than a local project, We.Inc builds and previews the site in your browser, so there is no local server or port to manage.

How it works

  1. Look at the startup log of the server you meant to run and note the port it reports.
  2. Run the find command for your system to see which process holds 8080.
  3. Stop that process, or move your own server to 8081 with the setting in the table.
  4. Reload http://localhost:8080 and confirm the response comes from the right app.

Tips

  • Spring Boot prints 'Tomcat started on port 8080' when it is ready. No such line means the app failed earlier, so scroll up to the first exception.
  • On Windows, the Jenkins installer runs Jenkins as a service, so it grabs 8080 at every boot even when you never open it.
  • In Docker, -p 8080:80 means host port 8080 forwards to port 80 inside the container. Mixing up the order is a common cause of refused connections.
  • Some proxies and antivirus suites also listen on 8080. If the process name surprises you, search for it before killing it.

Frequently asked questions

What is localhost:8080 used for?

It is the default address of many Java application servers and development tools, including Tomcat, Spring Boot, Jenkins and webpack-dev-server. It points at a program on your own machine, not at a website on the internet.

Why does localhost:8080 refuse to connect?

No process is accepting connections on port 8080. Either the server never started, it crashed during startup, it uses a different port, or inside Docker the port was not published to your machine.

How do I free port 8080?

On Mac or Linux run lsof -i :8080 to get the process ID, then kill it. On Windows run netstat -ano | findstr :8080 and end the PID with taskkill /PID <PID> /F. If it is the Jenkins service, stop the service instead.

How do I run Spring Boot on a port other than 8080?

Set server.port=8081 in application.properties, use server.port: 8081 in application.yml, or pass --server.port=8081 on the command line. Setting server.port=0 asks the system for any free port.

Is 8080 the same as 80?

No. Port 80 is the standard HTTP port that browsers use when no port is typed. Port 8080 is just a common alternative, so you must type :8080 in the address for the browser to reach it.

Related: localhost:3000, localhost:8000, 502 Bad Gateway, HTTP status codes.

Start for free or see all free tools. We.Inc is free to start, with no card needed. AI building is on paid plans from $20 a month.

More in Guides

Product

Who It's For

Features

Resources

Company

View Sitemap