Start MySQL and it's 3306; start PostgreSQL and it's 5432.
We usually accept these port numbers without thinking, but I suddenly wondered, "Who decided these numbers, and how?" Some are obviously standard, like 80 and 443, while others like 3000 and 8080 are commonly seen in local development.
So, using MySQL and PostgreSQL as an entry point, I looked into port numbers around databases, HTTP, and dev servers, mainly through official documentation and IANA registration data.
There seem to be two broad types of port numbers.
One is numbers strongly tied to standard specifications and IANA registrations, such as HTTP's 80, HTTPS's 443, FTP's 20/21, SSH's 22, and SMTP's 25. For these, the "reason the number is used today" is relatively clear.
The other is numbers that became established as the default settings of products and tools, such as MySQL's 3306, PostgreSQL's 5432, Tomcat's 8080, 3000 for Rails and Next.js, Flask's 5000, Django's 8000, and Jupyter's 8888. For these, the current default can be confirmed officially, but "why that number was chosen" is often not documented.
First, how are port numbers managed?
Port numbers are managed by IANA. RFC 6335 divides them broadly into the following three ranges.
| Range | Name | What it's for |
|---|---|---|
| 0-1023 | System Ports | Standard services such as HTTP, SSH, and DNS |
| 1024-49151 | User Ports | Range that applications and services register and use |
| 49152-65535 | Dynamic / Private Ports | Range for temporary or private use |
On Unix-like operating systems such as Linux, binding to a port below 1024 has long required privileges. These are the so-called "privileged ports."
Given this restriction, it seems quite natural that high ports such as 8080, 3000, 5000, 8000, and 8888 became popular for local development and application servers. You can start a server without root privileges.
However, being registered with IANA and being used by default by a piece of software are separate matters.
For example, 3000 is a familiar number in web development, but it isn't registered with IANA as a "web development port." Oracle Database's 1521 has long been treated as the default listener port for Oracle products, but the IANA registrant isn't Oracle. Kubernetes API Server's 6443 is commonly used as the default in Kubernetes, but isn't a Kubernetes registration at IANA.
In other words, even numbers firmly established in practice don't necessarily match their IANA registrant.
How far can we get with MySQL's 3306?
What can be officially confirmed about MySQL is that the default port of the classic MySQL protocol is 3306. The official MySQL documentation treats 3306 as the default, and the IANA registry also lists 3306 asmysql.
Looking at the IANA registration, the assignee/contact shows Monty's name. It seems fair to consider it a registration tied to Michael "Monty" Widenius, the author of MySQL.
However, for the key question of "why 3306," I couldn't find a clear explanation in the primary sources I checked this time.
A commonly seen explanation is that "it became 3306 because it was the free number after 3305." It sounds plausible, but it's difficult to assert based only on the official MySQL documentation and IANA registration I looked at.
So it seems safest to summarize MySQL 3306 like this.
| Aspect | View |
|---|---|
| Is it MySQL's default? | Confirmed officially |
Is it registered with IANA as mysql? | Confirmed |
| Who is the registration tied to? | Monty's name appears |
| Why the number 3306? | Unknown within the scope of this research |
PostgreSQL's 5432 is also hard to trace to a reason
For PostgreSQL as well, 5432 is registered with IANA as the PostgreSQL Database port. The assignee/contact shows Tom Lane's name.
Looking at old official PostgreSQL documentation, we can also confirm that default port 5432 was used from quite early on. At least, it seems fair to say that 5432 was established early in PostgreSQL's history.
However, here too, the official archives I looked at this time didn't explain "why 5432."
Since PostgreSQL descends from Berkeley POSTGRES, it's tempting to think the reason for 5432 dates back to the Berkeley days. But I think it's a bit risky to state that "the meaning of the number 5432 originates at Berkeley" based only on these materials.
MySQL 3306 and PostgreSQL 5432 are both numbers that "became established as product defaults and are also registered with IANA." The "origin of the number itself" is a separate question, and that seems to be an area with few primary sources.
Other databases' ports have similar circumstances
SQL Server's 1433 is described in Microsoft's official documentation as the TCP port used by the default instance. It's also registered with IANA asms-sql-s 1433. However, I couldn't find the origin of why 1433 in the primary sources this time.
Oracle Database's 1521 is a somewhat different case. Oracle's official documentation describes 1521 as the default port of the Oracle Net Listener. It's a very well-known number in the field.
But looking up 1521 at IANA, the registered name isncube-lm, not Oracle. Furthermore, regarding use by Oracle, IANA has the note "Unauthorized Use Known on port 1521."
So Oracle 1521 is "standard in the Oracle world" but hard to call "officially registered for Oracle at IANA." This mismatch was quite interesting.
For Redis's 6379 and MongoDB's 27017, the defaults in the official documentation can be confirmed. MongoDB 27017 is also registered with IANA. But the origin of the numbers themselves wasn't clear within this scope either.
Elasticsearch is a bit more complicated: the official documentation describes the default ofhttp.port as the range 9200-9300 and the default of transport.port as 9300-9400. In conversation people tend to say "Elasticsearch is 9200 and 9300," but strictly speaking it's better to separate "the value most likely to be used first" from "the range in the settings."
HTTP's 80 and HTTPS's 443 are quite clear
HTTP 80 and HTTPS 443 were among the ones with the clearest origin in this research.
RFC 1945 specifies that when the port is omitted in anhttp:// URL, 80 is assumed. In the current RFC 9110 as well, the default for http is TCP 80 and for https is TCP 443.
These seem to be numbers set by specification rather than by local-development convention.
Is 8080 "two 80s side by side"?
8080 is registered with IANA ashttp-alt. The description is HTTP Alternate, i.e., positioned as an alternate port for HTTP.
Tomcat also tries to bind to 8080 by default. Tomcat's documentation also explains that if you change the port, a number above 1024 is preferable. Considering the privileged-port restriction on Unix-like OSes, the reason for using a high port such as 8080 instead of 80 is easy to understand.
On the other hand, the commonly heard explanation that "8080 is two 80s side by side" didn't appear in the IANA, RFC, or Tomcat primary sources I checked.
Of course, I understand that it's easy to read it that way from the look of the number. But if writing based on primary sources, we can say up to "8080 is registered as an alternate port for HTTP," but it's better not to assert that "it became 8080 because two 80s were put side by side."
Is 3000 the standard port for web development?
3000 was a number that particularly stuck with me during this research.
3000 is used by many development tools and applications, including Rails, Express, Create React App, Next.js, and Grafana. When doing web development,localhost:3000 is a very familiar sight.
However, 3000 at IANA is not a web development port. Looking up 3000 at IANA, other uses such as HBCI appear.
So it seems better to view 3000 not as an "official web development port" but as a de facto standard widely established in the local development world.
Older Rails guides also use 3000, so we can confirm that Rails used 3000 from a relatively early time. But these materials alone don't let me go so far as to say "Rails is the origin of 3000."
The current sense is perhaps that popular projects like Rails used it, Express and Next.js and others also used it, and as a result the feeling that "for web development it's 3000" grew stronger.
5000, 8000, 8888, 4200, and 5173: the "origin" is hard, too
Flask uses 5000, Django 8000, Jupyter Notebook 8888, Angular CLI 4200, and Vite 5173 as defaults. In every case, the current default can be confirmed in the official documentation.
But the official documentation I looked at didn't explain why Flask got 5000, Django 8000, or Jupyter 8888.
For Vite's 5173 and Angular's 4200 as well, various theories are seen elsewhere. But if limiting to what can be confirmed from primary sources, it seems best to say "the current default can be confirmed, but the reason for the number is unknown."
Docker, Kubernetes, Prometheus, and others
For the Docker daemon's remote API, 2375 (non-TLS) and 2376 (TLS) are described as the conventional ports. Docker's documentation uses the word "conventional," so it's closer to view these as Docker operational convention than numbers fixed by a standard specification.
The Kubernetes API Server listens on 6443 by default. However, 6443 at IANA issun-sr-https, not Kubernetes. This is again an example where the product default and the IANA registered name don't match.
Prometheus uses 9090 as its default. The default can be confirmed in the official documentation, but I couldn't trace why 9090 within this scope.
Sorting out the seemingly folk-lore explanations
What I felt while researching is that port numbers tend to be discussed with "how it's used now" and "why that number was chosen" mixed together.
| Common explanation | View within what I researched |
|---|---|
| HTTP uses 80 | Confirmed in RFC |
| HTTPS uses 443 | Confirmed in RFC |
| 8080 is an alternate HTTP port | Confirmed at IANA |
| 8080 is two 80s side by side | Not confirmed in the primary sources this time |
| MySQL 3306 was the next free number after 3305 | Not confirmed in the primary sources this time |
| PostgreSQL 5432 comes from Berkeley and the reason is already explained | Use of 5432 is confirmed, but the reason for the number is not |
| 3000 is an official web development port | Not so at IANA; better viewed as a de facto standard |
| Oracle 1521 is for Oracle at IANA too | The IANA registrant is not Oracle |
| Elasticsearch's default is strictly 9200 and 9300 | Official settings describe it as a range |
| Kubernetes 6443 is for Kubernetes at IANA too | Not for Kubernetes at IANA |
Port number summary
Finally, here is a summary of the numbers covered.
| Port | Common use | View this time |
|---|---|---|
| 20/21 | FTP | Number from the standard protocol |
| 22 | SSH | Number from the standard protocol |
| 25 | SMTP | Number from the standard protocol |
| 53 | DNS | Number from the standard protocol |
| 67/68 | DHCP | Number from the standard protocol |
| 80 | HTTP | Default specified in RFC |
| 443 | HTTPS | Default specified in RFC |
| 8080 | HTTP alternate / Tomcat | Confirmed as an HTTP alternate port, but the wordplay origin is unconfirmed |
| 3000 | Rails / Express / Next.js, etc. | De facto for web development, but not a web standard at IANA |
| 3306 | MySQL | Official default and IANA registration confirmed, reason for the number unconfirmed |
| 5432 | PostgreSQL | Official default and IANA registration confirmed, reason for the number unconfirmed |
| 1433 | SQL Server | Official default and IANA registration confirmed, reason for the number unconfirmed |
| 1521 | Oracle Net Listener | Standard for Oracle, but the IANA registrant is not Oracle |
| 5000 | Flask | Official default confirmed, reason for the number unconfirmed |
| 6379 | Redis | Official default confirmed, reason for the number unconfirmed |
| 8000 | Django | Official default confirmed, reason for the number unconfirmed |
| 8888 | Jupyter Notebook | Official default confirmed, reason for the number unconfirmed |
| 1883 | MQTT | Standard MQTT port registered with IANA |
| 8883 | MQTT over TLS | Standard secure MQTT port registered with IANA |
| 2375/2376 | Docker daemon remote API | Conventional Docker ports |
| 27017 | MongoDB | Official default and IANA registration confirmed, reason for the number unconfirmed |
| 4200 | Angular CLI | Official default confirmed, reason for the number unconfirmed |
| 5173 | Vite | Official default confirmed, reason for the number unconfirmed |
| 6443 | Kubernetes API Server | Kubernetes default, but the IANA registrant is for another use |
| 9090 | Prometheus | Official default confirmed, reason for the number unconfirmed |
| 9200/9300 | Elasticsearch | Strictly, both HTTP and transport are described as ranges |
Thoughts after looking into it
The more familiar a port number is, the more you assume there must be some clear reason behind it. But when I actually looked, I got the impression that surprisingly few could be traced back to the origin of the number in primary sources.
Some, like HTTP 80 and HTTPS 443, are easy to explain within the standard specifications. On the other hand, numbers like MySQL 3306, PostgreSQL 5432, 3000, 5000, 4200, and 5173 are used as a matter of course now, but "why that number" doesn't seem to be talked about much.
This may be characteristic of software history. Something that began as a small default value spreads through users, documentation, sample code, Docker images, cloud configurations, and so on, and before long it's fixed as "just how things are."
So when talking about port numbers, it seems much clearer if you separate "that number is used now" from "the reason that number was chosen is known."
MySQL is 3306, PostgreSQL is 5432.
That these two are used is clear. But as for the original reason behind those numbers, at least within the scope of this research, it felt like some room was still left.