TL;DR:
Ever wondered why your dev servers always run on localhost:3000 or localhost:5173?
These ports have fascinating histories that t...
For further actions, you may consider blocking this person and/or reporting abuse
Thanks for this, have always sort of wondered why it defaulted to these ports and whether there was a deeper story.
I use port numbers of the form XY0Z, where X identifies the specific type of server (web server, event store, Postgres DB, logger, etc.) in project Y, and Z identifies the environment (dev, test, etc.) So 3104 is the web server in the dev environment in project 1, 5306 is the Postgres server in the staging environment in project 3, and so on. Everything is configured via .env files, so I can have multiple projects, each with multiple servers, all running at the same time without interference, and I can readily change environments with a simple script to swap .env files.
This even extends to production, where I use nginx to proxy a URL to the appropriate back end. So, for example, my.domain.com/project1 might be proxied to localhost:3107 behind nginx.
Interesting. Thanks for sharing.
Loved this write-up! ⚡️ It’s crazy how a few arbitrary defaults (like app.listen(3000)) ended up defining developer culture for decades.
The “Vite = 5173” bit was new to me — that’s a brilliant Easter egg!
I work on an AI-based marketing app called BusinessAdBooster.pro, and even there, dev habits like these sneak into production setups all the time. 😄
As an Angular developer I'm deeply assaulted not seeing port
4200history here! 🧐😂 (Wait for the Storybook guys and their4400request too 🤣)dev.to/kvetoslavnovak/mystery-of-v...
This was very informative and good read.
I am reminded of the art of nudging and sane defaults.
How people prefer to use and stick to defaults to easily cognitive load in their day to day life.
I have no idea why vite was useing 5173 not 80** until you explained this,that is awesome,thx
Port 3000 didn't start with nodejs. Express simply copied Ruby on Rails by using port 3000
So why 3000? - rubyonrails-talk - Ruby on Rails Discussions share.google/ylUvarfxE7lex8A2F
This is cool. Thanks 😊
There is also a public registry where companies or software can "claim" ports. If you go high up into these you will find valleys of ports that are completely open, very useful if using ports as part of local code for end users (first example that comes to mind is python multiprocessing shared memory can be mounted to a port to be accessible by any other independent python script)
The history is interesting, but I think most developers just pick whatever high port is free. Standardizing on 3000 or 8000 isn’t sacred and switching to random ports often avoids conflicts just as well.
I would have assumed Ruby on Rails was the source of the port 3000 convention. I feel like that was the first time I remember seeing its use in the wild back in the late aughts.
Awesome Article
i always use default 4200 and 8100
I suspect 8000 is also related to port 80 being used for http. Take 80, add a couple of zeros to get something big enough not to be in the privileged range, and you get 8000.
Thanks for sharing!
I’ll try using a port number I haven’t used before.
pretty neat, cool easter eggs!
Now I understand it better 😮💨
Great read!
Que bueno y chevre, estoy desarrollando un lenguaje de programación llamado MAWA, creado por mi.
How nice and cool, I'm developing a programming language called MAWA, created by me.
Think it as a building and the rooms inside the building is a great analogy that made me understand it in easier way.
Loved this deep dive!
Never realized how much history those simple port numbers carry
5173 being “VITE” is just genius
Cool. Thanks for sharing
I always wondered what 5173 refers to! I knew there must be an easter egg! Thank you!!
Thanks for breaking it down.
Tell a cold joke: If you are a fan of Stephen Chow movies, then 3000 naturally brings to mind the classic line: "夺命 3000" youtube.com/watch?v=elc3FdKxaOk
Very interesting read, thank you.
But VI would be six.