Open firewall ports (ufw)
Use ufw on your Victus Ubuntu VPS to open the ports your apps need — web, game and custom services — without locking yourself out of SSH.
On a Victus KVM VPS you get a full public IP with no upstream port blocking, so opening a port is done inside the machine with a firewall. Ubuntu ships ufw (Uncomplicated Firewall), a friendly front-end to iptables. This article shows the safe order of operations so you never lock yourself out.
If you enable ufw with a default-deny policy and have NOT allowed port 22, your current SSH session survives but new connections are blocked — and you are locked out on the next disconnect. Always run "ufw allow OpenSSH" first.
Set up ufw safely
# Install if missing
apt update && apt install -y ufw
# 1. ALWAYS allow SSH first
ufw allow OpenSSH # or: ufw allow 22/tcp
# 2. Sensible defaults
ufw default deny incoming
ufw default allow outgoing
# 3. Turn it on
ufw enableOpen the ports your service needs
# Web server
ufw allow 80/tcp
ufw allow 443/tcp
# A Minecraft-style TCP service
ufw allow 25565/tcp
# A UDP game/voice port
ufw allow 27015/udp
# A single IP only (e.g. your home connection)
ufw allow from 203.0.113.10 to any port 5432 proto tcpCheck and remove rules
# List active rules with numbers
ufw status numbered
# Delete a rule by its number
ufw delete 3
# Delete by matching the original rule
ufw delete allow 80/tcp| Port | Protocol | Typical use |
|---|---|---|
| 22 | TCP | SSH (keep open!) |
| 80 / 443 | TCP | HTTP / HTTPS websites |
| 25565 | TCP | Minecraft server |
| 3306 / 5432 | TCP | MySQL / PostgreSQL (restrict by IP!) |
Never run a bare "ufw allow 3306/tcp". Restrict database and admin ports to specific source IPs, or keep them bound to localhost and reach them over an SSH tunnel.