Service status

Help centre

Cloud firewalls: the basics

How GOLDNET Cloud firewalls work, which ports to open for SSH and a website, and a safe starting rule set you can attach to several servers at once.

  • The GOLDNET team
  • Last reviewed
  • 3 min read
  • Cloud servers

Note: Cloud firewalls are part of GOLDNET Cloud, available when it opens to the public. Until then, request access and we'll set you up.

What a cloud firewall is

A cloud firewall is a set of rules that decides which traffic may reach your server. It's enforced on our side, before the traffic reaches your server, so it keeps working even if something on the server is misconfigured. You build a rule set once and attach it to as many servers as you like. Change a rule and it's applied to every server that uses that set.

How it behaves

SituationIncoming trafficOutgoing traffic
No cloud firewall attachedEverything is allowed inAllowed (except email on port 25, see below)
A cloud firewall attachedOnly what your rules allow gets in; everything else is droppedAllowed (except email on port 25)

Your rules are "allow" rules. Anything you don't allow is blocked. IPv6 needs a few control messages to work, so those are always let through for you.

Note: Outgoing email on port 25 is closed on new servers to protect our addresses from spam. If you need it, contact support. Most apps should send mail through an authenticated mail service on port 587 anyway.

What a rule contains

  • Direction: in (or out)
  • Protocol: TCP, UDP, ICMP or all
  • Port: a single port such as 22, or a range such as 8000-8100
  • Source: where the traffic may come from: anywhere, one address, or a range in CIDR form (for example your office's address with /32 on the end)
  • Note: a short label so you remember why the rule is there

A safe starting rule set for a web server

AllowProtocolPortFromWhy
SSHTCP22Your office or home address onlySo only you can log in
WebTCP80AnywherePlain web, and Let's Encrypt certificate checks
Secure webTCP443AnywhereYour website over HTTPS
PingICMPAnywhereSo you and your monitoring can ping the server

With a firewall attached, ping only works if you allow ICMP, as in the last row.

Common ports

ServiceProtocol and port
SSHTCP 22
Web (HTTP / HTTPS)TCP 80 / 443
PostgreSQLTCP 5432
MySQL / MariaDBTCP 3306
RedisTCP 6379
WireGuard VPNUDP 51820

Database ports should almost never be open to "anywhere". Allow them only from your app servers, ideally over a private network.

Good habits

  1. Lock SSH to your own address. Bots try to log in to every public server, all day.
  2. Use private networks between servers. They're free, never routed to the internet, and keep database traffic off the public side.
  3. Add a second layer on the server with ufw (Ubuntu and Debian) or firewalld (Rocky and AlmaLinux) if you like. The cloud firewall stops traffic before it arrives; the server's own firewall is a backstop.
  4. Test before you close your session. After a change, open a new SSH connection first. If you lock yourself out, the browser console on the server's page still works, because it doesn't go through the firewall.
  5. Review rules now and then. Remove the "temporary" rule you added for a test last month.

Managed databases and load balancers come with firewalls we manage for you: you choose the trusted sources, and we keep the rules in line.

More on networking features: Cloud networking.

All guides

Talk to a person, not a call centre

Our teams in Gqeberha and Durban answer Monday to Friday, 09:00 to 18:00. Our WhatsApp assistant answers any time, and the network is monitored around the clock.