localhost:3000

Port 3000 is the most crowded address in web development. React, Next.js, Express, Ruby on Rails, Remix, Nuxt, Astro, Grafana — they all default to 3000. It became the convention because Ruby on Rails chose it back in 2004 (Mongrel server defaulted to 3000), Node.js frameworks followed, and then the entire JavaScript ecosystem adopted it by osmosis.

The result: if you're running more than one project, you're guaranteed to hit "Port 3000 is already in use." This page covers everything running on 3000 and how to manage the traffic jam.

Quick Access: Open localhost:3000

What's Running on Your Port 3000?

# Find out instantly
# macOS/Linux
lsof -i :3000

# Windows
netstat -ano | findstr ":3000"
tasklist | findstr "PID_FROM_ABOVE"

Everything That Defaults to 3000

ToolStart CommandNotes
React (CRA)npm startDeprecated but still widely used
Next.jsnpm run devReact meta-framework, most popular
Express.jsnode server.jsIf coded with app.listen(3000)
Ruby on Railsrails serverThe OG 3000 user
Remixnpm run devFull-stack React framework
Nuxtnpm run devVue meta-framework
Astronpm run devSince Astro 4 (was 4321 before)
GrafanaService/DockerMonitoring dashboards
json-servernpx json-server db.jsonFake REST API for prototyping

Note: Vite (which powers modern React, Vue, and Svelte projects) uses port 5173 instead. If you scaffolded a project recently with npm create vite, you won't be on 3000.

Changing the Port

# Next.js
next dev -p 4000
# or in package.json: "dev": "next dev -p 4000"

# React (Create React App)
PORT=4000 npm start          # macOS/Linux
set PORT=4000 && npm start   # Windows CMD
$env:PORT=4000; npm start    # PowerShell

# Express.js — change in your code
const PORT = process.env.PORT || 4000;
app.listen(PORT);

# Ruby on Rails
rails server -p 4000

# Nuxt — nuxt.config.ts
export default defineNuxtConfig({
  devServer: { port: 4000 }
})

# Remix
remix dev --port 4000

"Something Is Already Running on Port 3000"

React's dev server (and several others) will ask you: "Something is already running on port 3000. Would you like to run on another port instead?" Hitting Y bumps you to 3001. That works for a quick fix, but for a proper workflow:

Kill the old process:

# macOS/Linux — find and kill
lsof -ti :3000 | xargs kill -9

# Windows — find PID then kill
netstat -ano | findstr ":3000"
taskkill /F /PID 12345

Ghost Node processes: Sometimes a crashed Node.js app leaves a zombie process holding the port. The kill commands above handle this. If it keeps happening, you might have a Node process spawning in the background (a watch script, a background worker, etc.).

The Full-Stack Port Layout

When building a full-stack app, you typically run frontend and backend on different ports. The standard convention:

ServicePort
Frontend (React/Next.js)3000
Backend API (Express)3001 or 8000
Database (PostgreSQL)5432
Cache (Redis)6379

Your frontend makes API calls to the backend. Since they're on different ports, the browser treats them as different origins and blocks requests (CORS). Two solutions:

// Solution 1: Proxy in Next.js (next.config.js)
async rewrites() {
  return [
    { source: '/api/:path*', destination: 'http://localhost:3001/api/:path*' }
  ]
}

// Solution 2: Enable CORS on the Express backend
const cors = require('cors');
app.use(cors({ origin: 'http://localhost:3000' }));

Port 3000 vs Other Dev Ports

PortEcosystemWhy It Exists
3000JavaScript, RubyRails convention from 2004
5173Vite (React/Vue/Svelte)Spells "SITE" on phone keypad
4200AngularAngular CLI's choice
8000Python, PHPDjango, Laravel default
8080JavaTomcat/Spring Boot default
5000Flask, .NETFlask/ASP.NET Core default