localhost:4200: what runs on it and how to open it
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.
What runs on localhost:4200
- Angular dev server started with
ng serve
Commands to start and test port 4200
ng serveng serve --openng serve --port 4300npx ng serveFind 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
- 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/clior runnpx ng serveinside the project. - Blank page
- Look at the terminal for compile errors, and the browser console (F12) for runtime errors.
Other ports like 4200
| Port | Usually used by |
|---|---|
| localhost:3000 | React, Next.js, Express |
| localhost:5173 | Vite dev server |
| localhost:5000 | Flask |
| localhost:8000 | Django, PHP, Python |
| localhost:8080 | Tomcat, Spring Boot, Docker |
| localhost:8888 | Jupyter Notebook |
| localhost:9000 | PHP-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.
- Is localhost:4200 safe?
- Yes, as long as it stays on localhost. Only your own computer can reach localhost:4200. It becomes reachable from other devices only if you start the program on 0.0.0.0 or your computer's IP address. Development servers are for testing, so do not put them on the public internet.
- Can I use a different port instead of 4200?
- Yes. Most programs let you choose the port with a setting or a command option. Pick a free port above 1024 and open that number instead, for example localhost:4201.
- How do I check what is using port 4200?
- Use the port checker on this page. It shows the command for Windows, macOS and Linux and does not send anything to this site.
- Can I open localhost:4200 from my phone?
- Yes, if both are on the same Wi-Fi. Start the program so it listens on all addresses, then open your computer's IP address with :4200 on the phone. A firewall on the computer can still block it.
Free tools that help
- Common ports listSearch a list of common TCP and UDP port numbers: SSH 22, HTTP 80, HTTPS 443, MySQL 3306, PostgreSQL 5432 and more, with dev server ports.