Victus Cloud / Support
VPS

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.

Allow SSH before you enable ufw

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 enable

Open 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 tcp

Check 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
PortProtocolTypical use
22TCPSSH (keep open!)
80 / 443TCPHTTP / HTTPS websites
25565TCPMinecraft server
3306 / 5432TCPMySQL / PostgreSQL (restrict by IP!)
Do not expose databases to the world

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.

Was this article helpful?

Still stuck?

Our team can help with your account or service.

Open a ticket →