Updated: 28 September 2026 · Applies to: Ubuntu 24.04, Debian 12, AlmaLinux 9 and Rocky Linux 9

CentOS 6 and 7 are end of life. These are the current ways to open and close a port (5555/tcp in the examples).

AlmaLinux / Rocky Linux (firewalld)

firewall-cmd --permanent --add-port=5555/tcp       # open
firewall-cmd --permanent --remove-port=5555/tcp    # close
firewall-cmd --reload
firewall-cmd --list-ports

Ubuntu / Debian (UFW)

ufw allow 5555/tcp            # open
ufw delete allow 5555/tcp     # close
ufw status

Check that the port is open

  1. On the server, check that a program listens on the port: ss -tlnp | grep 5555. If nothing listens, the port looks closed even with the firewall open.
  2. From another computer, test it: nc -zv SERVER-IP 5555.

Note: On cPanel servers the firewall is usually managed with the firewall tool installed in WHM; open ports there instead of with firewall-cmd.

Tip: On a Ucartz VPS, keep the VNC console open (client area › your VPS service › VPS dashboard) while you change firewall or network settings. If you lock yourself out of SSH, you can still fix it from the console.

Ucartz services for this topic

Was this answer helpful? 0 Users Found This Useful (0 Votes)