Default dev server ports
Every dev server and database starts with a default port, and several share one. Next.js, Nuxt, and Rails all use 3000, and Django and Laravel’s artisan serve both use 8000. This index lists the default port of each tool that has a page here, maps the ports that more than one tool claims, and links a page for each tool on what happens when its port is busy and how to change it.
Port collision map
| Port | Tools that default to it | Shared |
|---|---|---|
3000 | Next.js dev server, Nuxt dev server, Rails server | 3 tools share it |
3306 | MySQL server | One tool |
4173 | Vite dev server | One tool |
4200 | Angular dev server | One tool |
4321 | Astro dev server | One tool |
5000 | Flask development server | One tool |
5173 | Vite dev server | One tool |
5432 | PostgreSQL server | One tool |
6006 | Storybook dev server | One tool |
8000 | Laravel artisan serve, Django runserver | 2 tools share it |
33060 | MySQL server | One tool |
Ports shared by two or more tools: 3000 and 8000. Two of them cannot listen on the same port and address at once, so one needs a different port.
Frontend dev servers
- Port guide
Vite dev server
Vite tries the next available port by default, so the port it ends up on may not be the one you configured.
- Port guide
Next.js dev server
next dev moves to the next free port, but only if you did not choose one.
- Port guide
Nuxt dev server
From Nuxt 4.6, nuxt dev moves to another free port when the one it asked for is taken, logs which port it chose, and exits instead if you pass --strictPort.
- Port guide
Astro dev server
Astro tries the next available port when the one you gave is already in use, so the server may not be on 4321.
- Port guide
Angular dev server
ng serve checks the port before it starts.
Backend frameworks
- Port guide
Laravel artisan serve
php artisan serve tries the next port.
- Port guide
Django runserver
Django does not look for another port. runserver prints “Error: That port is already in use.” and exits with status 1, so nothing serves your project until you start it again on a free port, for example python manage.py runserver 8001.
- Port guide
Rails server
Rails does not look for another port. rails server resolves the port once, from -p, then the PORT environment variable, then 3000, so when that port is taken the web server cannot bind and the start fails.
- Port guide
Flask development server
Flask does not pick another port.
Databases
Dev tooling
What the map covers
The collision map and the lists cover the tools that have a page here, and nothing else. A port missing from the map is not necessarily free on your machine, because any program can hold any port. Check on your own system before you rely on a number.
How the pages are verified
Every port page cites the tool’s official documentation for its default port, what happens when that port is busy, and how to change it. Each source records the date it was checked. Defaults change between versions, so a page names the version where a behaviour depends on one. Where the page describes how Rig starts a tool, that detail comes from Rig’s source code.
How the pages are kept current
Every page records the date of its last substantive update. A port page is published only with an official source, at least one way to change the port, and an answer to a question specific to that tool. Drafts are not published and do not appear in the map.
Frequently asked questions
Does a port missing from the collision map mean it is free?
No. The map covers only the tools that have a page here. Any other program can hold a port, so check the port on your own system with the port in use command generator or the commands in the free-a-port guide.
Related
Section links
- Vite dev server default ports: 5173 and 4173
- Next.js dev server default port: 3000
- Nuxt dev server default port: 3000
- Astro dev server default port: 4321
- Angular dev server default port: 4200
- Storybook dev server default port: 6006
- Laravel artisan serve default port: 8000
- Django runserver default port: 8000
- Rails server default port: 3000
- Flask development server default port: 5000
- PostgreSQL server default port: 5432
- MySQL server default ports: 3306 and 33060