Your VPS has a firewall in front of it that you switch on and off on the service page, on the Your own domain tab, in the Firewall card. It filters traffic before it reaches the server, so it also works when the server itself has no firewall, and a mistake in it never locks the system itself.
How it works
- On: only connections that a rule lets in reach the server. Everything else coming in is dropped.
- Off: nothing is filtered.
- Connections your server opens itself (updates, downloads, APIs), and their replies, are never blocked.
A rule has a protocol (TCP, UDP, both, ping or all traffic), ports for TCP and UDP (22, 80,443, or a range such as 8000-8100), who it is for (all IPs, My IP, or the IPv4 and IPv6 addresses or networks you type) and a note. A change takes effect within a few seconds.
The rules you start with
A new server starts with the firewall off and two rules ready: SSH (port 22) from anywhere, or Remote Desktop (port 3389) on Windows, and ping. Add the ports your applications use (for example HTTP and HTTPS for a website), then turn the firewall on.
Keep SSH to yourself
- Remove the SSH rule for all IPs.
- Add SSH with My IP.
- Turn the firewall on.
If your internet provider changes your IP, you will not be able to connect: turn the firewall off on the service page, update the rule and turn it on again.
Good to know
- If no rule lets in SSH (or Remote Desktop on Windows), the card warns you before you turn the firewall on.
- To get back in after a wrong rule, turn the firewall off on the service page; you do not need rescue mode.
- A firewall inside the server (such as
ufw) still works as well; both apply.