24

I have been looking for some documentation on alternatives to port forwarding to port 80. I have a dedicated Linux machine on a home router, and apparently utilizing port 80 is not an option.

Are there good alternative HTTP ports? (Or, I am open to some work-around to this situation as well.)

1
  • Is port 443 for HTTPS blocked as well? It is becoming more popular lately to force HTTPS, and one sure way to do that is to close port 80. But why is 80 not an option? If you are not the root user, you cannot bind to anything below 1024. – DKing Nov 14 '18 at 16:30
17

Many ISPs block port 80 (HTTP) and port 25 (SMTP), as well as some other ports to home users. Typically, their response to this is that these protocols are "business related" or something along those lines. I assume this is the case for you.

Port 80 is the standard for HTTP. When you typer superuser.com into your browser's address bar, it assuming two things:

  1. Since you left the protocol out, it assumes HTTP (http://superuser.com)
  2. Since you left the port out, it assumes port 80, based on the HTTP assumption (http://superuser.com:80)

Since port 80 is not an option, you need to find an alternative port. There is no official HTTP alternative port.

When port 80 is used for one address/webserver, it's fairly common to use port 8080 or 8000 for another site on the same address/webserver. This is most likely because they are similar enough to 80 that they are easy to remember. I have seen this done for external facing sites as well.

Alternatively, you can use any port you want. See this list of standard and unofficial ports. You could run it on port 23, if you didn't plan on using telnet to your Linux machine. In a web browser, you would just type domain.com:23.

3
  • 1
    Thank you Keltari, I appreciate it. Through this post you actually taught me A LOT, and I am very thankful. The next thing for me to investigate after selecting an alternate port is what steps to take (if any) to ensure I can 'be found' by the external 'world' (so that my small Web site can be noticed by, for example, employers whom I am tying to display proof of my Web efforts). – David Jun 8 '13 at 13:42
  • 14
    IANA defines 591, 8008 and 8080 as http_alt or HTTP Alternate. That's pretty much as official as it gets... – Calimo Mar 20 '15 at 14:14
  • the wikipedia entry for List_of_TCP_and_UDP_port_numbers (en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers) also states: "The range 49152–65535 (215+214 to 216−1) contains dynamic or private ports that cannot be registered with IANA. This range is used for private, or customized services or temporary purposes and for automatic allocation of ephemeral ports." so you can also officially use any port in that range, i.e 49152–65535, although I don't know if those qualify as 'good' alternatives. – david.barkhuizen Aug 23 '15 at 5:15
24

There are actually 3 HTTP alternative ports: 591, 8008 and 8080.

They are assigned by IANA as "HTTP Alternate", which makes them pretty much as official as it gets.

If you run Linux as a non-privileged user (non-root) you can listen to any port above 1024, so 8008 and 8080 are good candidates. Then to access the server from your browser, you will need to specify the port in the url, such as http://localhost:8080.

You may also use ports in the range 49152–65535. They are labeled as "Dynamic Ports" and will never be assigned by IANA, however because of that they may already be used by other software. This means that you can't trust that a given port will be available for you to use at any given time and have to check the availability of the port each time you want to use it.

Note that port 8000 is sometimes used for HTTP, but IANA assigned it to iRDMI (Intel Remote Desktop Management Interface). While it is unlikely to be an issue in a private environment, it is best to refrain from using it for HTTP given better alternatives are available.

1
  • For the alternative ports, does this you need to explicitly type out the domain with the alternative port at the end of the URL? – cacoder Jan 15 '18 at 20:08
-2

As everyone else on here has said, it is basically pointless to host a web server on any port other than port 80... unless you're hosting it from home. Many ISPs throttle outbound TCP/UDP ports 80 and 443 (IANA defines as HTTP and HTTPS, respectively), and in this case, using those ports will detract from site loading speeds, etc. However, IANA has assigned 3 HTTP-ALT ports for both TCP and UDP. These are: 591, 8008 and 8080. Using these ports is also acceptable, but you will be making the life of server admins hell.

Source of port numbers: https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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