Frontend dev servers · TCP
localhost:3000
localhost:3000 is the default dev server port for Next.js, Nuxt, Ruby on Rails and Create React App. Grafana and Gitea also listen on 3000.
Opens on your own machine. It only loads if something is listening on port 3000.
- Protocol
- TCP
- IANA service
hbci- Default port of
- Next.js, Nuxt, Ruby on Rails, Create React App, Grafana, Gitea
- IANA registration
- HBCI; also records RemoteWare Client as an unassigned but widespread use
What uses port 3000
| Software | Status | Notes |
|---|---|---|
| Next.js | Default port | next dev and next start listen on 3000 and bind to 0.0.0.0 by default. If 3000 is busy and you did not set a port, next dev moves to the next free one. |
| Nuxt | Default port | nuxt dev serves on http://localhost:3000. |
| Ruby on Rails | Default port | bin/rails server binds to port 3000. |
| Create React App | Default port | npm start uses 3000. CRA is deprecated for new projects since February 2025. |
| Grafana | Default port | Web UI on 3000, set by http_port in the server config. |
| Gitea | Default port | HTTP_PORT defaults to 3000. |
| Express | Common choice | Express has no default port. Its hello world example uses 3000, so most tutorials do too. |
Why port 3000 is the web developer’s default
Port 3000 has no official meaning for web development. IANA lists it for HBCI, a German online banking protocol, and notes RemoteWare Client as a widespread unassigned use. Neither is something you are likely to run on a laptop, which is part of why the number has stayed free for dev servers.
The habit comes from Ruby on Rails, whose development server has listened on 3000 since its early versions. Node.js tutorials and the Express hello world example adopted the same number, and React tooling followed with Create React App and later Next.js. Today, if you see http://localhost:3000 in a terminal, the most likely source is a JavaScript framework.
Two servers on 3000 at once
Only one process can listen on a given port and address. When you start a second project while the first is still running, tools react differently:
- Next.js prints a warning and moves to 3001, then 3002 and so on, unless you set the port yourself with
-porPORT. - Create React App asks whether to run on another port.
- Rails and plain Express stop with an “address already in use” error.
If the browser shows a different app than the one you expected on localhost:3000, an older server is still running. The lookup commands below show which process it is.
Port 3000 and Grafana in Docker
Grafana also defaults to 3000, which clashes with a front-end dev server when you run a monitoring stack locally. The usual fix is to map Grafana to another host port, for example -p 3001:3000 with docker run, so the container still listens on 3000 internally but is reached at localhost:3001.
Find what is using port 3000
If you get "address already in use" or the wrong app answers on localhost:3000, look up the process that owns the port:
macOS and Linux
lsof -i :3000Stop it with kill <PID> using the PID from the output. On Linux without lsof, ss -ltnp | grep :3000 shows the same.
Windows
netstat -ano | findstr :3000The last column is the PID. Stop it with taskkill /PID <PID> /F.
Step by step, with the PowerShell version: how to fix "port already in use".
How to run on a different port
| Tool | How |
|---|---|
| Next.js | next dev -p 3001, or PORT=3001 next dev. PORT cannot be set in .env. |
| Nuxt | nuxt dev --port 3001, or set devServer.port in nuxt.config. |
| Ruby on Rails | bin/rails server -p 3001 |
| Create React App | PORT=3001 npm start on macOS and Linux, or put PORT=3001 in .env. |
| Grafana | Set http_port = 3001 under [server] in grafana.ini, then restart. |
| Express | Change the number passed to app.listen(), or read it from process.env.PORT. |
Common errors on localhost:3000
Error: listen EADDRINUSE: address already in use :::3000
Cause: Another process, often an earlier Node server that did not shut down, already holds port 3000.
Fix: Find the PID with lsof -i :3000 (macOS, Linux) or netstat -ano | findstr :3000 (Windows) and stop it, or start your app on another port.
A server is already running. Check tmp/pids/server.pid.
Cause: Rails found a PID file from a previous server that crashed or is still running.
Fix: Stop the old server. If it is no longer running, delete tmp/pids/server.pid and start again.
localhost refused to connect (ERR_CONNECTION_REFUSED)
Cause: Nothing is listening on port 3000: the dev server is stopped, crashed, or started on a different port.
Fix: Check the terminal where you started the server. Many tools print the real address, which may be 3001 if 3000 was taken.
Questions about port 3000
Why do so many tools use port 3000?
It is above 1024, so no administrator rights are needed, and it is easy to remember. Rails used it early on, Express examples followed, and React and Next.js tooling kept the habit.
Is port 3000 safe to use?
For local development, yes, but check what it binds to. Rails binds to localhost by default, so only your machine can reach it. Next.js binds to 0.0.0.0, so other devices on your network can reach it unless your firewall blocks the port. Use next dev -H 127.0.0.1 to keep it local. See 0.0.0.0 vs localhost.
What is the difference between localhost:3000 and 127.0.0.1:3000?
localhost is a name that usually resolves to 127.0.0.1 (IPv4) or ::1 (IPv6). Some servers listen on only one of the two, which is why one address can work while the other is refused.
Related guides
Sources
Checked against the sources below on . Defaults can change between releases; the tool's own documentation wins if it disagrees.