How should I select the port number for a new tool?

I'm creating an internal collaboration tool that will use a central server (on an intranet) and one or more ports for socket communication to clients. I know that many ports are reserved for particular purposes and others are conventionally used for certain types of traffic.

How should I go about picking a default port that is least likely to have been "claimed" by someone else for their tool? Is there a database that identifies all known (even unconventional) port usage?


Yes, IANA maintains the official service and port number registry.

The process for getting a port number assigned to you is documented in RFC 6335. A review process is required for any port assignment, but it is much stricter for ports < 1024; such assignments require (among other things) that your protocol is documented in an RFC.

(Note that this process is relatively new and that there are many assigned ports which were grandfathered in.)

For < 1024, ports 1021 and 1022 are reserved for experimentation; above that, for experimentation you can simply use a dynamic port >= 49152.


In most cases it is better to just use HTTP, as sooner or later there will be a firewall you need to cross. Most OSs allow the HTTP address space to be divided up between processes.