Back
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.

ufwfirewallportsopen portiptablessecurity

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

bash
# 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

bash
# 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

bash
# 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.

Related in VPS

First login over SSH (find your IP + root password)Locate your Victus VPS IP address and root password in the control panel, then connect over SSH from Windows, macOS or Linux for the first time.Reset the root passwordChange your Victus VPS root password from inside the machine, or reset it from the panel or rescue mode if you are locked out.Reinstall / rebuild the OSWipe your Victus VPS and reinstall a fresh Ubuntu template from the control panel, including how to back up first and what survives.Cannot connect / SSH connection refusedDiagnose and fix the common reasons an SSH connection to your Victus VPS is refused, times out, or rejects your password/key.Resize the disk after an upgradeAfter upgrading your Victus VPS plan the virtual disk grows, but Linux needs the partition and filesystem expanded to actually use the new space.Create and restore snapshotsTake point-in-time snapshots of your Victus VPS before risky changes and roll back to them from the panel if something breaks.Boot into rescue modeBoot your Victus VPS into a rescue environment to repair a broken boot, fix fstab, reset the root password, or recover files when the OS will not start.Mount a custom ISOAttach and boot your Victus VPS from a custom ISO to install an operating system that is not offered as a stock template.IPv6 networking basicsUnderstand and configure the IPv6 address on your Victus VPS — find your address, test connectivity, and bind services to IPv6.Install a one-click appDeploy common software on your Victus VPS in minutes using the one-click app installer in the control panel.Check CPU/RAM/disk usageMonitor CPU, memory and disk usage on your Victus VPS from the panel graphs and with standard Linux commands to spot bottlenecks.Add a swap fileAdd a swap file to your Victus VPS to survive memory spikes and avoid the OOM killer when RAM is tight.