How to Convert Ubuntu 20.04 into a Zentyal Firewall Server
If you’ve got an Ubuntu 20.04 box that’s been running Windows‑style services and you’re ready to strap on a firewall that actually does something useful, this is the guide for you. We’ll walk through turning that vanilla server into a Zentyal‑powered firewall without having to reinstall from scratch.
Converting Ubuntu 20.04 to Zentyal Firewall
1. Back up everything first
Before we start pulling in new packages, make sure your data’s safe. I’ve seen people lose half their configuration when they skip this step and end up with a broken system after an upgrade spree.
2. Update the base system
sudo apt update && sudo apt full-upgrade -y
Keeping the kernel and libraries current prevents odd dependency clashes later on. Zentyal pulls in a lot of packages that expect the latest security patches, so this step is non‑optional.
3. Add the Zentyal repository
wget https://download.zentyal.org/zentyal-repo.key -O- | sudo apt-key add - echo "deb http://download.zentyal.org/ubuntu focal main" | sudo tee /etc/apt/sources.list.d/zentyal.list
The key makes apt trust Zentyal’s packages; the repo line tells apt where to fetch them. If you miss this, install will complain about “Package not found” and you’ll end up with a broken firewall.
4. Install the core Zentyal packages
sudo apt update sudo apt install zentyal-core zentyal-firewall -y
zentyal-core brings the web UI, while zentyal-firewall pulls in iptables rules and the UFW front‑end. The installer will ask you to configure basic network settings; this is where you decide which interfaces become WAN or LAN.
5. Resolve any dependency conflicts
During installation you’ll often hit “Depends on X but Y is installed.” A quick fix is:
sudo apt --fix-broken install
Or, if a specific package is causing trouble, remove it and reinstall:
sudo apt remove problematic-package sudo apt install zentyal-firewall
I’ve run into this when an older ufw version sticks around after the upgrade; removing it lets Zentyal take over cleanly.
6. Set up networking
Open the web UI by pointing a browser at https://your-server-ip. The wizard will walk you through configuring network interfaces, NAT rules, and DHCP if needed. If you’re using static IPs, make sure your firewall’s WAN interface matches that IP; otherwise Zentyal will refuse to start.
7. Check the firewall status
sudo systemctl status zentyal-firewall.service
It should be active (running). You can also run:
sudo iptables -L -n
to see the rules Zentyal has applied. If you spot missing chains, go back into the UI and enable the “Firewall” module again.
8. Secure SSH
Since this is a firewall, it’s a prime target for brute‑force attacks. Disable password logins in /etc/ssh/sshd_config:
PasswordAuthentication no
Then reload SSH with sudo systemctl reload sshd. I’ve seen users forget this step and get locked out after a firewall reboot—good thing to catch early.
9. Apply updates through Zentyal
Keep the server fresh by using Zentyal’s Update Manager rather than apt update && apt upgrade alone. It ensures that Zentyal’s own components stay in sync with its core and firewall modules.
10. Test the rules
From a client machine on your LAN, try pinging an external IP (like 8.8.8.8) and then visit a blocked site. The UI will show you whether packets are accepted or dropped. Adjust as needed in the “Firewall > Rules” section.
Common Pitfalls to Avoid
- Mixed firewall tools – Having both UFW and Zentyal’s firewall enabled can lead to duplicate rules that confuse the kernel. Stick with one.
- Over‑restrictive defaults – By default, Zentyal blocks all inbound traffic except what you allow. If you’re expecting remote desktop or VPN, add those services before testing connectivity.
- Ignoring SELinux/AppArmor – Ubuntu 20.04 ships AppArmor by default; make sure the zentyal-firewall package is allowed to modify iptables rules. Use aa-status to verify.
That’s it—your old Ubuntu 20.04 machine now runs a Zentyal firewall that can juggle DHCP, VPN, and even LDAP if you decide to add those later. If you hit a snag, the community forums are surprisingly helpful; just remember to include your exact error messages when asking for help.