Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am building a web-server. Can I send web documents through any port I like, or are there limitations?

If so, what are they?

share|improve this question
Yes, you can. It's done quite often, actually. The limitation is that you can't use a port that's used (or reserved) by another service. Can you explain more about your situation and why you'd want to do this to make this a more practical question? – slhck Jan 19 '13 at 11:54
in general, yes. On linux, its a good idea to use a port over 1024 if you're non root (else you may need to start the program as root, and drop its privileges after that, or run it on another port and forward it through the OS firewall) - I'm not aware of any such issues on windows. – Journeyman Geek Jan 19 '13 at 11:55
@slhck theres no specific reason, other than i am building a mini webserver, and in choosing a port am wondering if I should use a specified one, or an arbitrary one, or a unique one just to be different. – Hithere Paperbag Jan 19 '13 at 12:18
up vote 2 down vote accepted

Basically: Yes, you can server webpages on any port from port number 0 to port number 65535. (216 port numbers).


  1. Make sure the port is not already in use.
  2. Try to avoid other well known port numbers to avoid needless confusion.
  3. Ports below 1024 are considered privileged.
  4. Port 80 is the default port for HTTP. If you use a non standard port (and no port forwarding in your border) then you will need to tell your browser which port to use to fetch webpages. E.g. by using http://yourwebsitename.tld:1234 (where 1234 is a port number).
share|improve this answer
8080 is a pretty common 'alt' website port that might be worth considering. – Journeyman Geek Jan 19 '13 at 12:26
It is, probably because it is easy to remember. Much the same as the alternative 2222 for ssh (normally on port 22). – Hennes Jan 19 '13 at 12:27
Bear in mind that a number of companies block access to non-standard ports numbers - so people who work there won't be able to access your web server. – Richard Jan 19 '13 at 14:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.