loading...

Open a router port for home Ubuntu Server 20.04

pa_catch profile image trycatch ・1 min read

Problem:

You've run your application on home server (e.g. Ubuntu Server 20.04), but it isn't available outside.

Solution:

1) Check your IPs

External:

curl ifconfig.me

Internal:

ip a

2) Make app's port available

sudo ufw enable
sudo ufw allow 4040/tcp

Where 4040 is your app's port

3) Open router settings in browser

Usually it's 192.167.100.1

4) Find 'Forwarding' option

Its location depends on your router model, usually it's one of 'Advanced' options

5) Set forwarding

Depends on settings supported by the router, set

  • (External, external start, external end) port forwarding to any port you want to access externally (e.g. 5555)
  • (Internal, local start, local end, local) port forwarding to 4040 (the app's port from step 2)
  • Protocol to TCP
  • Local IP to IP of your internal IP from step 1 (e.g. 192.168.100.122)

6) Check that your app is available externally

Open your external IP in browser and add the external port you set in router settings

89.11.2.182:5555

Discussion

pic
Editor guide