A practical, step-by-step guide to deploying Sophos Firewall on Hetzner Cloud, focusing on routing, interface persistence, and reliable Admin Web GUI access.
Hetzner Cloud doesn't officially support Sophos Firewall. You can still run it there reliably, and the installation itself is the easy part. The hard part is that Sophos expects a classic network with a gateway on the same subnet, while Hetzner Cloud routes every server through a fixed gateway outside it.
After several failed attempts, I ended up with a setup that:
This guide walks through that exact setup, including why each step is needed.
Who this is for: system and network administrators who are comfortable with basic routing and a Linux shell.
A default install on Hetzner Cloud runs into three problems:
A working setup has to solve all three together: routing, interface activation and persistence after reboot.
All IP addresses below are examples, except the Hetzner gateway
172.31.1.1, which is the same on every Hetzner Cloud server.
172.31.1.1. You can't change it.10.20.20.0/24.| Sophos interface | Role | Network |
|---|---|---|
| Port1 | WAN | Hetzner public network |
| Port2 | LAN | Hetzner private network |
10.20.20.0/24).The installation succeeds, but networking doesn't work yet. That's expected.
On first boot, from the Sophos console:
/24.Don't try to open the GUI yet.
Open Advanced Shell from the Sophos console and run:
ip route add 172.31.1.1 dev Port1
ip route add default via 172.31.1.1 dev Port1
ifconfig Port2 upThis restores outbound connectivity and access to the Admin Web GUI at:
https://your-public-ip:4444Heads-up: these routes are not persistent. Any reboot breaks connectivity again until you finish Step 5.
Applying these changes reinitialises the interfaces, so routing breaks again. Run the three commands from Step 3 once more to get back in.
To keep routing after a reboot, add these static routes in Sophos:
| Destination | Gateway | Interface |
|---|---|---|
172.31.1.1/32 | — | Port1 |
0.0.0.0/0 | 172.31.1.1 | Port1 |
The first route makes the Hetzner gateway reachable on Port1. The second sends all other traffic through it. Together they keep the default route in place after every reboot.
Set up Port2 as LAN:
10.20.20.2/30Routing is now persistent and the WAN is stable.
On some installs, Port2 still doesn't come up by itself after a reboot. A small startup script fixes that. Run the following from Advanced Shell.
mount -no remount,rw /vi /scripts/system/clientpref/customization_application_startup.shAdd these lines:
#!/bin/sh
sleep 15
ifconfig Port2 up
exit 0chmod +x /scripts/system/clientpref/customization_application_startup.sh
mount -no remount,ro /Port2 now comes up on every boot without manual work.
I've tested this setup across multiple reboots, and it stays stable.

Abdallah Hussein
IT infrastructure, automation and SaaS development. I write about systems I build and run in production.