localhost:4200

Port 4200 means one thing: Angular. Every Angular CLI project runs ng serve and opens on 4200. It's been Angular's home since AngularJS became Angular 2+ and the CLI became the standard way to develop.

Open localhost:4200

Quick Start

# Create new Angular project
ng new my-app
cd my-app
ng serve

# Output:
# ** Angular Live Development Server is listening on localhost:4200
# Open your browser on http://localhost:4200/

Change Angular Port

# Command line
ng serve --port 3000

# Or in angular.json
"serve": {
  "options": {
    "port": 3000
  }
}

Proxy API Requests

Angular app on 4200, backend on 3000? Set up a proxy:

// proxy.conf.json
{
  "/api": {
    "target": "http://localhost:3000",
    "secure": false
  }
}

// Run with proxy
ng serve --proxy-config proxy.conf.json

Common Issues

ProblemSolution
Port 4200 in useng serve --port 4201
Live reload not workingCheck WebSocket, try --poll
CORS errorsUse proxy config for API calls
Slow compilationUpgrade Angular CLI, check memory

Useful ng serve Flags

ng serve --open          # Auto-open browser
ng serve --host 0.0.0.0  # Allow network access
ng serve --ssl           # Enable HTTPS
ng serve --configuration production  # Prod mode

Related Ports

PortCommon Use
3000React, Node.js
5173Vite
8080Backend APIs