Firewall
Podmaker can manage each server’s firewall. You write the rules in the panel, the desktop app or the CLI. The server’s agent applies them within a minute, and again after every reboot.
How rules work
- Rules run top to bottom; the first rule that matches decides.
- Traffic no rule matches is allowed. Without rules nothing changes.
- A rule is: incoming or outgoing, allow or deny, a protocol (TCP, UDP, ICMP or
any), ports (
22,80,443,8000-8100, or all), and who it is about:- anywhere;
- IP addresses or ranges (
198.51.100.7,203.0.113.0/24, IPv6 too); - one of your servers;
- your private network.
- A rule can be for one server or for every server. Every-server rules run first.
- Incoming rules also cover the ports your apps publish through Docker. Outgoing rules also cover the server’s containers.
Podmaker always keeps two paths open, whatever the rules say:
- the agent’s connection to the panel, so you can always fix a rule;
- the private network (WireGuard) between your servers.
A rule that would block SSH (22) or web traffic (80/443) from everywhere is only added after you confirm it.
Typical rules
SSH only from your office:
- Allow incoming TCP port
22from198.51.100.7(your address). - Deny incoming TCP port
22from anywhere.
A database port only for one server:
- Allow incoming TCP
5432from serverapp-01. - Deny incoming TCP
5432from anywhere.
No outgoing mail from any server (stops spam from a hacked app):
- Deny outgoing TCP
25to anywhere, for every server.
Where
-
Panel: Servers → a server → Firewall. Add a rule, move it up or down, remove it. You also see when the agent last applied the rules, or why it could not.
-
Desktop app: Servers → Firewall on a server.
-
CLI:
podmaker firewall list app-01 podmaker firewall add app-01 --in --allow --port 22 --from 198.51.100.7 --note "office ssh" podmaker firewall add app-01 --in --deny --port 22 # asks first podmaker firewall add data-01 --in --allow --port 5432 --from server:app-01 podmaker firewall add any --all-servers --out --deny --port 25 --note "no mail" podmaker firewall move RULE_ID 1 podmaker firewall delete RULE_ID
Shared services on the private network
When an app on another server uses a shared service (see Private network), the service gets a port on its server’s private address. Only these servers can reach that port:
- the servers running apps connected to the service (added and removed automatically);
- servers you allow explicitly. Use this for a server without a connected app, for example one running a service of its own.
Every other server, even one in your private network, is refused.
To allow a server: Services → Other servers → allow a server, or
podmaker service allow pg-main worker-02
podmaker service disallow pg-main worker-02
Requirements
The agent applies the rules with nftables (nft). It is installed on
Ubuntu 22.04+, Debian 11+ and Rocky 9. It needs the same updated systemd unit
as the private network (see Private network → Requirements).
Podmaker keeps its rules in its own table (inet podmaker) and never touches
Docker’s tables or your other firewall rules. Your provider’s firewall (Hetzner,
AWS …) still applies in front of the server.