How to open a port on a Linux server
Updated 26 October 2026
A port is a numbered door on your server. Software listens on a port, and the firewall decides who may knock. If your app is running but nobody can reach it, a closed port is the most common reason.
Ports you will see often
- 22: SSH, for signing in
- 80: HTTP, for websites
- 443: HTTPS, for secure websites
- 3306: MySQL and MariaDB databases
- 5432: PostgreSQL databases
- 8080: a common choice for apps and test sites
Open a port on ZaRHost
A new server starts with ports 22, 80 and 443 open. To open another, go to the server's Networking tab, find Open a port, choose what it is for and who can connect, then press Open port.
It takes effect straight away. To close it, press Close next to it in the list.
Limit a port to your own address
Databases and admin panels should not be open to the whole internet. Choose a single address or range instead of anyone, such as the address of the server that needs to reach it.
Check that something is listening
An open port does nothing if no program is using it. On the server, this command lists what is listening:
sudo ss -tlnpQuestions
Do I also need to use ufw or iptables?
The firewall in the panel is enough to control who reaches the server. You can add your own rules on the server as well if you like.
Why can I not reach my app after opening the port?
Check that the app is running and listening on that port, and on 0.0.0.0 rather than only on localhost.
Keep reading
- How to connect to a Linux server over SSHConnect to your Linux server with SSH in three steps: get the key, set its permissions and run one command. Includes fixes for common errors.
- How to install Docker on UbuntuInstall Docker and Compose on an Ubuntu server in one click from the ZaRHost panel, or by hand with the official script. Includes a quick test.
- Linux VPS hosting in the UK