localhost:3000

Building a React app? Working with Express? That URL you keep refreshing — localhost:3000 — is the default dev server for most of the JavaScript ecosystem. Ruby on Rails popularized it, Node.js adopted it, and now React, Next.js, and Express all use it out of the box.

Open localhost:3000

What Uses Port 3000?

FrameworkStart CommandDefault Port
React (Create React App)npm start3000
Next.jsnpm run dev3000
Express.jsnode server.js3000
Ruby on Railsrails server3000
Gatsbygatsby develop8000
GrafanaService3000

Quick Start

React

npx create-react-app my-app
cd my-app
npm start
# Opens http://localhost:3000

Next.js

npx create-next-app my-app
cd my-app
npm run dev
# Opens http://localhost:3000

Express.js

const express = require('express');
const app = express();

app.get('/', (req, res) => {
  res.send('Hello World');
});

app.listen(3000, () => {
  console.log('Server running on http://localhost:3000');
});

Port 3000 Already in Use?

Most common error: EADDRINUSE: address already in use :::3000

Find What's Using Port 3000

# Mac/Linux
lsof -i :3000

# Windows
netstat -ano | findstr :3000

Kill the Process

# Mac/Linux
kill -9 $(lsof -t -i:3000)

# Windows (replace PID with actual number)
taskkill /PID 12345 /F

Or Use a Different Port

# React
PORT=3001 npm start

# Next.js
npm run dev -- -p 3001

# Express
app.listen(process.env.PORT || 3001);

Can't Connect to localhost:3000?

ProblemSolution
ERR_CONNECTION_REFUSEDServer isn't running. Check terminal for errors.
Page loads but blankCheck browser console (F12) for JS errors
CORS errorsBackend needs to allow localhost:3000 origin
Hot reload not workingClear cache, restart dev server

Why Port 3000?

Port numbers below 1024 require admin/root privileges (like 80 for HTTP). Port 3000 is high enough to avoid that hassle, low enough to remember easily, and became convention after Rails and Node.js popularized it. When 3000 is busy, most tools auto-increment to 3001.

Related Ports

PortCommon Use
3306MySQL database
5173Vite dev server
5432PostgreSQL database
8080Tomcat, Spring Boot, alternative HTTP
8000Django, Python HTTP server