[Help] wg-easy in Docker on Raspberry Pi OS (Bookworm) - iptables vs nftables conflict breaking Docker daemon
Hi everyone,
I’m trying to set up `wg-easy` via Docker Compose, but I’m caught in a networking loop between `iptables` and `nftables`.
**My Setup:**
* **Host:** Raspberry Pi running the latest Pi OS (Bookworm)
* **Environment:** Docker / Docker Compose
* **DDNS:** Using a No-IP DDNS address (configured in my router)
**The Problem:** When I start the `wg-easy` container, it fails to bring up the `wg0` interface with the following error in the logs: `modprobe: module ip_tables not found in modules.dep` `iptables v1.8.11 (legacy): can't initialize iptables table 'nat': Table does not exist`
**What I've tried so far:**
1. I added `- /lib/modules:/lib/modules:ro` to my `docker-compose.yml` volumes, but the kernel module still isn't found.
2. I learned that Bookworm uses `nftables` by default. I tried forcing the OS back to legacy iptables using `sudo update-alternatives --set iptables /usr/sbin/iptables-legacy` and rebooted.
3. **The Result:** This completely broke my Docker daemon. `docker.service` failed to start (`code=exited, status=1/FAILURE`). It seems Docker on this specific Pi kernel relies on `iptables-nft`.
4. I reverted the OS back to `iptables-nft`, which fixed Docker, but puts me back at square one with `wg-easy` crashing.
**My Question:** Has anyone successfully deployed `wg-easy` on the new Pi OS (Bookworm) using `nftables`? Is there a way to pass the correct `WG_POST_UP` nftables environment variables to the container, or another workaround that doesn't involve breaking the Docker daemon?
Thanks in advance for any advice!
https://redd.it/1x8ct1h
@r_SelfHosted
Post #54246
28