Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Support] ContainerNetwork AutoFix (CNAF) - Auto-fix VPN dependent containers

Featured Replies

ContainerNetwork AutoFix (CNAF)

Automatically recreates Docker containers when their master container restarts.

The Problem

When using Docker's --net=container: networking (common with VPN containers), dependent containers reference the master container by its ID. When the master container restarts or updates, it gets a new container ID, breaking the network connection for all dependent containers.

Example: You have containers routing through GluetunVPN. When GluetunVPN updates and restarts, your dependent containers (qBittorrent, Prowlarr, etc.) lose network connectivity and need to be manually recreated.

The Solution

CNAF monitors your master container (VPN, etc.) and automatically recreates any dependent containers when it restarts, restoring their network connectivity.

Features

 Zero configuration - Automatically detects dependent containers
 State preservation - Maintains running/stopped state of containers
 Smart waiting - Configurable delay for VPN establishment
 Log rotation - Automatic log management
 Standalone - No dependencies on Unraid scripts
 Universal - Works with any master container (GluetunVPN, OpenVPN-Client, WireGuard, etc.)

Installation

From Community Apps (Recommended)

  1. Open Community Apps

  2. Search for "ContainerNetwork AutoFix" or "CNAF"

  3. Click Install

  4. Configure the master container name (default: GluetunVPN)

  5. Apply

Manual Installation

bash

docker run -d \  --name='ContainerNetwork-AutoFix' \  --restart=unless-stopped \  -e MASTER_CONTAINER='GluetunVPN' \  -e RESTART_WAIT_TIME='15' \  -v /var/run/docker.sock:/var/run/docker.sock \  -v /boot/config/plugins/dockerMan/templates-user:/templates:ro \  -v /mnt/user/appdata/containernetwork-autofix:/var/log \  buxxdev/containernetwork-autofix:latest
```## Configuration| Variable | Default | Description ||----------|---------|-------------|| `MASTER_CONTAINER` | `GluetunVPN` | Name of the master container to monitor || `RESTART_WAIT_TIME` | `15` | Seconds to wait after master restarts (allows VPN to establish) || `MAX_LOG_LINES` | `1000` | Maximum log lines (automatic rotation) || `MAX_RETRIES` | `10` | Startup retry attempts for finding master container || `RETRY_DELAY` | `10` | Seconds between retry attempts |## How It Works1. CNAF starts and waits for your master container to be ready
2. Detects all containers using the master container's network
3. Monitors Docker events for master container restarts
4. When the master restarts:
   - Waits for configured time (VPN establishment)
   - Identifies containers using the old master container ID
   - Records each container's state (running/stopped)   - Stops and removes broken containers
   - Recreates from Unraid templates
   - Restores original state
## Common Use Cases### VPN Containers- **GluetunVPN** (most common)- OpenVPN-Client
- WireGuard
- NordVPN
- binhex-delugevpn
- Any VPN container using `--net=container:`### Example Setup```
GluetunVPN (master container)├── qBittorrent (--net=container:GluetunVPN)├── Prowlarr (--net=container:GluetunVPN)└── slskd (--net=container:GluetunVPN)

When GluetunVPN restarts, CNAF automatically recreates qBittorrent, Prowlarr, and slskd.

Troubleshooting

Container not being recreated

Check the logs:

bash

docker logs ContainerNetwork-AutoFix

Verify the container uses container networking:

bash

docker inspect YOUR_CONTAINER | grep NetworkMode

Should show: "NetworkMode": "container:MASTER_CONTAINER_ID"

"Master container not found"

  • Ensure the master container name matches exactly (case-sensitive)

  • Check the master container is running

  • Increase MAX_RETRIES or RETRY_DELAY if the master takes time to start

"Template not found"

  • CNAF requires Unraid container templates to recreate containers

  • Ensure containers were created through Unraid GUI (not manually via docker run)

Links

Support

Post questions or issues in this thread. Include:

  • CNAF logs: docker logs ContainerNetwork-AutoFix

  • Master container name

  • Affected container names

  • Unraid version

Changelog

v1.0.0 (2025-10-17)

  • Initial release

  • Auto-detection of dependent containers

  • State preservation

  • Log rotation

  • Unraid template parsing

I cant see it in the unraid apps yet

  • Author

I’ve submitted it about a week ago. I’ll follow up.

  • Author

I’ve sent a message to @squid to advise is anything is pending for it to be added

  • 2 weeks later...

Works great, exactly what I was looking for. Thank you very much!

Thank you for this! It's been annoying me for a while, great to have a solution for it.


Edit: Would just like to add - It ran today and worked perfectly!

Edited by Stabster

Don't know what i am doing wrong. But can't make it work. Tried to increase the wait time but same result.

root@Tower:~# docker inspect bitmagnet | grep NetworkMode

"NetworkMode": "container:fcb9943f24baebb96e2236fc9c941ce18719cb9e7931c09f3285784aade15d11",

root@Tower:~#

2025-11-05 23:53:52: Parsing template for bitmagnet...

2025-11-05 23:53:52: Repository: binhex/arch-bitmagnet:latest

2025-11-05 23:53:52: Network: none

2025-11-05 23:53:52: Docker command: docker run -d --name='bitmagnet' -l net.unraid.docker.managed=dockerman -l net.unraid.docker.icon='' --net='none' -v '/mnt/cache/appdata/binhex-bitmagnet':'/config':'rw' -e 'TMDB_API_KEY'='xxxxxxxxx' -e 'SHARED_NETWORK'='no' -v 'binhex-shared':'/shared':'rw' -e 'PUID'='99' -e 'PGID'='100' -e 'UMASK'='000' --network=container:GluetunVPN 'binhex/arch-bitmagnet:latest'

2025-11-05 23:53:52: Executing docker run...

f98f438f4d8b7bef20f6f95d3e62ce4752eadb7a4b1190447cd7965dd32f3d3d

docker: Error response from daemon: network container:GluetunVPN not found

Run 'docker run --help' for more information

2025-11-05 23:53:52: ✗ ERROR: Failed to recreate bitmagnet

2025-11-05 23:53:52: All dependent containers processed.

Master container name : GluetunVPN

Affected container names: bitmagnet

Unraid version: 7.2.0

  • 2 weeks later...
On 11/5/2025 at 6:57 PM, sbxx said:

Don't know what i am doing wrong. But can't make it work. Tried to increase the wait time but same result.

I've had the exact same experience as sbxx. My logs look the same too. The only additional thing I tried was to wrap the network value in quotes: --network='container:GluetunVPN'

Edit: I just figured it out. @sbxx - Use the network dropdown and select "Container". You and I are doing it the old way.

image.png

Edited by Tony Tamplin

Hey, thank you for this great App.

Is there any Chance that it will support Containers from the Docker Compose Plugin in a future Update?

  • Author
On 11/15/2025 at 10:37 AM, Tony Tamplin said:

I've had the exact same experience as sbxx. My logs look the same too. The only additional thing I tried was to wrap the network value in quotes: --network='container:GluetunVPN'

Edit: I just figured it out. @sbxx - Use the network dropdown and select "Container". You and I are doing it the old way.

image.png

Hi guys, sorry for the delay coming back @Tony Tamplin is correct, I built it only to work with the dropdown approach for Container Network.
Thanks for working out the issue before I even had chance to look into it!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.