Skip to main content
PORT 4000 / TCPDev & LocalhostExposure Risk: Low

Port 4000: GraphQL / Phoenix / Ghost — Apollo GraphQL Server & Elixir Phoenix Dev Port

Default port for Apollo Server, Elixir Phoenix framework, and Jekyll local previews.

Default Service
GraphQL / Phoenix / Ghost
Process: node / beam.smp
Transport Protocol
TCP
IANA Registered Port 4000
Docker Port Flag
-p 4000:4000
Container to Host Mapping

How to Check & Kill Process on Port 4000 (EADDRINUSE Fix)

macOS & Linux (lsof / kill)
# Find process using port 4000
sudo lsof -i :4000

# Instantly kill process on port 4000
lsof -ti:4000 | xargs kill -9
Windows (PowerShell & CMD)
# Find PID listening on port 4000
netstat -ano | findstr :4000

# Force kill by PID
taskkill /PID <PID_NUMBER> /F
Cross-Platform Node.js One-Liner
# Kill port 4000 via npx
npx kill-port 4000

# Or diagnose via Castov CLI
npx castov fix "EADDRINUSE :::4000"
Linux Firewall (UFW) & Connectivity Test
# Test if port 4000 is reachable
nc -zv localhost 4000

# Allow or deny port 4000 in UFW
sudo ufw allow 4000/tcp

Frequently Asked Questions about Port 4000

What is Port 4000 used for?

Port 4000 is the standard network port for GraphQL / Phoenix / Ghost (Apollo GraphQL Server & Elixir Phoenix Dev Port) operating over TCP. The typical system daemon or process is node / beam.smp.

How do I kill a process running on Port 4000 (EADDRINUSE)?

On macOS and Linux, run: lsof -ti:4000 | xargs kill -9 (or npx kill-port 4000). On Windows PowerShell/CMD, run: netstat -ano | findstr :4000 and then taskkill /PID <PID> /F.

Is it safe to expose Port 4000 to the internet?

Port 4000 has a Low security risk profile. Default port for Apollo Server, Elixir Phoenix framework, and Jekyll local previews.

Other Common Network Ports