Updated: 22 October 2026 · Applies to: AlmaLinux 9 / Rocky Linux 9 (and Ubuntu 24.04 / Debian 12 with UFW)

CentOS 8 is end of life; the same commands work on AlmaLinux 9 / Rocky Linux 9.

  1. Open the port (use /udp for UDP): firewall-cmd --permanent --add-port=8080/tcp
  2. Or a range: firewall-cmd --permanent --add-port=10000-10100/udp
  3. Or a known service: firewall-cmd --permanent --add-service=http
  4. Apply it: firewall-cmd --reload
  5. Check it: firewall-cmd --list-ports and firewall-cmd --list-services.

To close the port again, use --remove-port or --remove-service and reload.

Ubuntu and Debian: UFW

apt install ufw
ufw allow OpenSSH          # always allow SSH before enabling
ufw allow 80,443/tcp
ufw enable
ufw status numbered
ufw delete 3               # remove rule number 3

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.

Check that it works

  1. The service must listen on the port: ss -tlnp | grep 8080.
  2. The rule must be in the active zone: firewall-cmd --get-active-zones shows which zone your interface uses; add --zone=<name> to the commands if it is not the default zone.
  3. Test from another computer: nc -zv SERVER-IP 8080.

Related services

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Unmanaged dedicated servers

full root access and free IPMI KVM, with Free Basic Managed Support.

Managed dedicated servers

our engineers look after the server for you, from $135 a month.

Was this answer helpful?

Still stuck? Open a ticket