Set up your VM's firewall rules

Control what can reach your VM from the panel. How rules are ordered, a safe starting set, and how to undo a lockout.

Updated 6 November 2026

Every VM has its own firewall, which you control from its Firewall tab. It runs outside your system, so you can change it with no login, even if the VM is switched off or broken. A bad rule can't lock you out for good.

How rules work

Rules are checked from top to bottom, and the first match wins. Inbound and outbound have separate lists. Each VM can have up to 20 of your own.

Field What it does
Action ACCEPT lets it through. DROP ignores it silently. REJECT refuses it and tells the sender
Protocol TCP, UDP, or Any protocol
Source Where it comes from. Empty means anywhere
Destination Where it's going. Empty means anywhere
Destination port One port, several with commas (22,8080), or a range with a colon (40000:40009)
Comment A note to your future self

Use Up and Down to change the order. If there's no inbound rule that matches, traffic is dropped.

Allow All is the default, so order matters

A new VM usually starts from Allow All, which has a single rule letting everything in. Because the first match wins, a block rule underneath it never does anything. Move your block rules above it, or better still, replace it.

A sensible set of inbound rules

Allow only what you use, and remove Allow all inbound:

Order Action Protocol Destination port Comment
1 ACCEPT TCP 22 SSH
2 ACCEPT TCP 40005 My service

Everything else is now dropped. The port in a rule is the port on your VM. Your SSH port might be 40001 on the public address, but it arrives at the VM on 22, so that's what you allow. If you have a Windows VM, allow TCP 3389 for Remote Desktop instead.

To allow SSH only from your own connection, put your public address in Source, but remember that it needs updating if your home address changes. You can do that here on the panel if it does.

Leave the outbound list on Allow all outbound unless you have a reason not to.

Rules you can't change

Rows marked System are added by Cloud and can't be edited. They:

  • keep your project apart from everyone else's;
  • block outgoing email on ports 25, 465 and 587;
  • let in any projects you've peered. This block can be moved up or down among your inbound rules, so your own rules can narrow a peering.

Checking your changes

Status Meaning
Applied and confirmed The rules are on, and have been read back to make sure
Applying changes Wait a moment. You can't make more edits until it finishes
Could not apply It's tried and failed. Cloud keeps trying
Needs attention The rules may not be enforced. Press Check now, and open a ticket if it stays that way

Cloud checks every VM regularly and puts back anything that's drifted. Firewall activity on the same tab shows what it's found.

Locked yourself out?

Go to the Firewall tab on the panel, fix or delete the rule, and wait for Applied and confirmed. There's no need for a console or a restart.

If the panel's rules look right and you still can't connect, look at the firewall inside your system. ufw and firewalld run separately from these rules. You can reach those from the console, or switch them off from rescue mode.

Templates

A project's Firewall tab holds templates, which are starting points for new VMs. A VM gets a copy when it's built, and later changes to a template don't touch VMs that already exist. Make one with your usual rules and choose it on the New VM form.