Home / Localhost / localhost:4200

localhost:4200 (Angular): not working and fixes

Port 4200 is the Angular dev server. How to start it, change the port and fix common errors.

Open this address: http://localhost:4200This opens on your own computer. It only works if the program is running.

localhost:4200 is the default address for an Angular app started with ng serve. If it will not open, the server is not running or the port is taken.

localhost:4200 in a browser address bar reaches port 4200 on your computer, where Angular dev server is running

What runs on localhost:4200

Commands to start and test port 4200

Start Angular
ng serve
Open the browser automatically
ng serve --open
Use another port
ng serve --port 4300
If ng is not found
npx ng serve

Find what is using port 4200

Run these in a terminal on your computer. Nothing is sent to this site.

If localhost:4200 will not open

Open ng serve from another computer, phone or container
Angular’s ng serve listens on localhost by default. Use ng serve --host 0.0.0.0 to listen on all addresses. Newer Angular versions also check the host name, so you may need --allowed-hosts to name the hosts the dev server should answer.
Changes are not picked up (WSL, network drive, container)
File watching can miss changes there. ng serve --poll 2000 turns on polling with a 2000 millisecond interval.
The app calls an API and the browser blocks it
Point the dev server at a proxy file with ng serve --proxy-config proxy.conf.json, so requests to your API go through the dev server instead of straight from the browser.
HTTPS in development
ng serve --ssl serves the app over HTTPS. The browser will warn about the certificate in the same way as on any local HTTPS address.
Port 4200 is already in use
Angular offers another port, or stop the old server using the tool below.
ng is not recognized
The Angular CLI is missing. Install it with npm install -g @angular/cli or run npx ng serve inside the project.
Blank page
Look at the terminal for compile errors, and the browser console (F12) for runtime errors.

Other ports like 4200

PortUsually used by
localhost:3000React, Next.js, Express
localhost:5173Vite dev server
localhost:5000Flask
localhost:8000Django, PHP, Python
localhost:8080Tomcat, Spring Boot, Docker
localhost:8888Jupyter Notebook
localhost:9000PHP-FPM, SonarQube

Questions about localhost:4200

What is localhost:4200?
The default address of the Angular development server, started with ng serve.
How do I change the Angular port?
Run ng serve --port 4300, or set the port under the serve options in angular.json.

Updated 2026-10-20

Free tools that help

Related pages