localhost:8080 Explained - What It Means, Its Uses, and How to Fix It
Learn what localhost:8080 means, what tools use port 8080, how to set up a service on it, and how to fix the common errors when it will not load.
localhost:8080 represents the IP address and port number of a web server installed on your
computer. Localhost indicates the server itself which is running on your own computer, while 8080
is the port number on which it is running on.
This guide begins with an explanation of the term followed by all the necessary information about how you can run a service on port 8080, troubleshooting in case of problems while connecting to it, and other related issues.
In case you ever need to access your local server from another machine or share it over the internet, a later section covers that, including tunneling with LocalXpose.
localhost:8080: Quick Overview
localhost is the hostname used for the IP address 127.0.0.1, which will always refer to your
local machine. 8080 is a port, an endpoint through which only one program can accept connections.
This specific port serves as a non-root replacement of the standard HTTP server port 80, hence its
prevalence.
Combined, http://localhost:8080 stands for âcommunicate with the Web server running on this
computer using port 8080.â The rest of the article describes what kind of Web server this would
typically be, how to start such a server yourself, and what to do when the page fails to load.
What localhost:8080 Actually Means
The URL http://localhost:8080/ consists of three parts to discuss.
-
First is the host. Here, localhost refers to an IP address (IPv4
127.0.0.1or IPv6::1) known by your system as localhost. Loopback traffic bypasses all your networking infrastructure: your network interface cards, routers, and the internet, and your computer serves as both the client and server side here. So your local dev server is unreachable to others using only its URL. -
Second is the port. While one IP address hosts various applications and services, they bind to a specific number from 0 to 65535, called a port. Your browser will find out which port the application is running on and sends the request to it; if you are trying to connect to port 8081 while there is a webserver at 8080, you will get absolutely nothing, because nobody is listening on 8081.
-
Third is the protocol. There are different protocols used by servers:
httpandhttps.httprequires less configuration and security checks (such as TLS certificate), but in the modern worldhttpsmight become more common, even on localhost. For instance,https://localhost:8080could be accessible only when the server is configured this way.
But why use 8080 rather than just 80? Most operating systems treat ports below 1024 as privileged ones. In order to bind a process to port 80 and 443, you need administrator access on Windows, whereas on Linux or Mac OS X, you need root access. Port 8080 happens to be above that threshold. Thus, any regular user may be able to bind to this port without the need for any special privileges.
What Uses Port 8080
Port 8080 is not reserved for any single product, but a large number of tools default to it. If something is already running on 8080 when you did not expect it, this list is a good place to start.
In case another process is already running on 8080 unexpectedly, then use this list as a starting point.
The Java ecosystem has used 8080 for decades, so the classics still show up most often:
- Apache Tomcat server.
- Spring Boot application.
- Jenkins web UI out of the box.
- Jetty standalone.
The latest gen of self-hosted and AI tooling behaves in similar fashion:
- code-server (VS Code in the browser) defaults to
127.0.0.1:8080. - LocalAI runs its OpenAI-compatible API on 8080.
- Open WebUI listens on port 8080 inside its container, which is why you see so many Docker examples mapping to it.
- webpack-dev-server long defaulted to 8080 for front-end builds.
- Many Docker tutorials publish container ports to port 8080 simply because it is the safe, known choice.
The takeaway: if you start a Java service, a self-hosted AI app, or a containerized example and donât specify a port, expect it to take port 8080. Therefore, you canât have two such tools running simultaneously without one being moved.
How to Set Up a Service on localhost:8080
Configuring a service to listen on 8080 is usually a one-line change. Here are the most common tech stacks:
Node and Express. Pass the port to listen:
const express = require('express');
const app = express();
app.get('/', (req, res) => res.send('Hello from port 8080'));
app.listen(8080, () => {
console.log('Listening on http://localhost:8080');
});
This starts an Express server that listens on port 8080 and replies to requests at the root path.
Spring Boot. It already defaults to 8080, but to set it to explicitly use the port, add this
under src/main/resources/application.properties:
server.port=8080
Or the YAML equivalent in application.yml:
server:
port: 8080
Both forms tell Spring Boot to bind to port 8080 rather than fall back to its default.
Nginx. In your server block, set the listen directive:
server {
listen 8080;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html;
}
}
This tells Nginx to accept connections on port 8080 and serve static files from the web root.
Apache. In httpd.conf (or a virtual host file), tell Apache to listen on 8080:
Listen 8080
This single directive makes Apache bind to port 8080 instead of the default 80.
Docker. Map a container port to host port 8080 with -p host:container. This example exposes an
Nginx container, which listens on 80 internally, to localhost:8080:
docker run -p 8080:80 nginx
This publishes the containerâs internal port 80 to port 8080 on your machine, so the site loads at
localhost:8080.
Once you are done setting up any of the above tech stacks, navigate to http://localhost:8080 on
your browser. If it loads correctly, youâve successfully completed your configuration. If not,
please see the next section that covers the why.
In the section below, youâll find several common reasons why localhost:8080 wonât load, along with
the appropriate solutions to each:
Why localhost:8080 Will Not Load (and How to Fix It)
Most people get stuck here. The web page is blank, the connection has refused, or the browser shows an error. Below are five common causes and how to resolve them:
-
Connection refused. In most cases, connection refused typically indicates ânothing is running on 8080â. It could be that the web server failed to start due to an error message or has crashed unexpectedly; alternatively, it might start on a different port than expected. Therefore, check the terminal where you launched the web server to confirm there were no errors, verify the port number from the web server logs, and ensure your process is still running. A connection refused error means ânobodyâs home,â NOT a permission or firewall issue.
-
Port already in use (
EADDRINUSE). In this case, an application is already using 8080. Thus, the new web server cannot bind and/or connect to that address. To free up port 8080, the other application must be terminated or a different port must be specified for the newly instantiated web server. To find and free up the port occupied by the other application, please refer to the respective command shown later in the next section. -
404 Not Found. A page not found error indicates that the server has responded (which eliminates both of the previous problems) but that the specific route or path does not exist on the server. Verify your route or context path. For example, some spring boots applications will serve out of a base path, and some static servers will return a 404 if the requested file does not exist at the specified location based on their configuration.
-
CORS errors between two ports (cross-origin resource sharing error). For example, if your front-end is running on
localhost:3000, and you access an API running onlocalhost:8080, then the browser considers that a cross-origin request because the port is part of the origin (even though they both have the same hostname - localhost). The solution is configuring the server with the correctAccess-Control-Allow-Originheader for your front-end origin or routing your API calls through your development serverâs proxy to appear to be the same origin to the browser. -
Host binding (
127.0.0.1versus0.0.0.0). When you bind your server to a loopback address127.0.0.1, you only allow access to client applications connecting from the same host running the server. This is fine during local development but is part of the reason you receive âconnection refusedâ from other machines in your network while your client application loads from your same host. To allow access from remote clients, you must bind your server to [::],0.0.0.0or all interfaces. More on that in the remote-access section.
Find and free port 8080
To see what is holding the port, use the command for your operating system.
Linux:
ss -ltnp | grep :8080
# or
sudo lsof -i :8080
macOS:
lsof -nP -iTCP:8080 -sTCP:LISTEN
Windows (PowerShell or Command Prompt):
netstat -ano | findstr :8080
Each command shows the process ID (PID) using the port. To free it, stop that process.
On Linux and macOS:
kill -9 <PID>
On Windows:
taskkill /PID <PID> /F
Then restart your new server. localhost:8080 should now load correctly.
How to Access localhost:8080 From Another Device or the Internet
By design, localhost:8080 is private to your device only. There are two ways to share it,
depending on how far the traffic needs to travel.
-
On the same network (LAN). If an additional machine is added to the same Network as yours (WiFi/Office), only two steps should be taken to provide access. First, Bind Server IP(s) to
0.0.0.0instead of127.0.0.1which allows all connections to that machine. Second, allow Ports 8080 through your operating systemâs Firewall. This will enable access to your Web Server throughhttp://YOUR-LAN-IP:8080in the other deviceâs web browser. For complete instructions, please refer to our other guide on how to access localhost from another computer. -
Over the internet (tunneling). When the person you are sharing with is not on your network, a remote client, a webhook from a third-party service, a teammate working from home, simply binding to â0.0.0.0â will not allow access. There is an alternative to opening up each Router Port for every potential client to connect to your localhost Web Server. A tunnel solves this cleanly by giving your local port a public URL without changing your network setup.
This is where LocalXpose fits. It is
a managed tunneling service that creates a secure
local tunnel from a public address straight to your
localhost:8080. You keep developing your server locally, and anyone with the link reaches your
running server over HTTPS. It supports custom subdomains and domains, HTTP and TCP tunnels, and the
kind of stable URLs that webhooks and demos need, so you can hand out one address instead of
reconfiguring infrastructure every time.
For the step-by-step setup, read how to expose your local server to the internet, and if you regularly need broader reach across machines, see how to access your local network remotely.
Frequently Asked Questions
What does localhost:8080 mean? localhost:8080 signifies that there is a web server operating on
your computer localhost=127.0.0.1 which is using the 8080 port to communicate with the user.
This means that the server is private and accessible only to you unless you choose to make it
public.
Why is port 8080 used instead of 80? Ports below 1024 (e.g., port 80) are considered privileged ports and can only be used by accounts with administrator or root access rights. Port 8080 is one of the ports above 1024, which allows normal users to bind their web servers to it without requiring elevated permissions. In addition, port 8080 is close in appearance to port 80, which results in a reasonable convention for an alternative web port.
What is port 8080 used for? Port 8080 is used frequently by web servers, including application development tools. Examples include: Tomcat, Spring Boot, Jenkins, Jetty. Newer tools that use port 8080 include: code-server, LocalAI, Open WebUI, webpack-dev-server, and the other numerous examples of Docker images.
Why canât I access localhost:8080? Typically, you wonât connect to localhost:8080 for any of
the following reasons: Your application is not running (Connection Refused error), another app is
already using the same port (EADDRINUSE), the application cannot access localhost:8080 (Not Found
error), a CORS block exists between two port (CORS error). You can find solutions to each of these
issues in the Troubleshooting section above.
How do I find what is using port 8080? Linux users can use ss -ltnp | grep :8080 or
sudo lsof -i :8080, macOS users can use lsof -nP -iTCP:8080 -sTCP:LISTEN, and Windows users can
use netstat -ano | findstr :8080. These commands will return the PID of the application that is
using port 8080, allowing you to stop it and free the port for your use.
Can I access localhost:8080 from another device? Yes. To connect to localhost:8080 from the
same LAN, your server must be bound to 0.0.0.0 and the port you are using must be open on your
firewall, connecting to your computerâs LAN IP. To connect to localhost:8080 across the internet,
you will need to use a service like LocalXpose to give the port a public URL.
Conclusion
localhost:8080 is simply a web server running on your own device, on the unprivileged port that
stands in for port 80. Once the meaning is clear, the rest follows: a long list of tools default to
8080, setting one up is usually a single line of configuration, and the load failures almost always
trace back to one of five causes you can now diagnose and fix.
When you need that local server accessed from outside your machine, start on the LAN by binding to
0.0.0.0, and reach for a tunnel when it has to travel over the internet. LocalXpose handles that
last step with a stable public URL pointed straight at your port.