> ## Documentation Index
> Fetch the complete documentation index at: https://proxylink.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Docker gateway

> Run the ProxyLink gateway as a container on a NAS, a mini PC or a server that is already in the network. How to add it, give it more networks, update it, move it and remove it.

A Docker gateway is the ProxyLink gateway as one container. You run it on a machine that is already in the network and stays on: a NAS, a mini PC, a server with Docker. Every device on that network then becomes reachable through ProxyLink, with nothing installed on the devices.

This page describes release **v0.2.0** of the container, the one ProxyLink offers since 5 December 2026.

## When to choose it

Choose a Docker gateway when the router at the site cannot be the gateway, or when you do not want to change the router, and there is a machine with Docker on the network.

Choose a [router gateway](https://proxylink.dev/docs/tunnels/router-gateway.md) (a MikroTik, or a small Linux box with the ProxyLink agent) when you need one of the things a container does not do:

* **No Wake-on-LAN**, and nothing else that needs a broadcast. The container sits on its own Docker network, not on your LAN, so it cannot send one.
* **At most eight networks**, each /20 to /30 (at most 4,094 addresses). See [Its networks](#its-networks).
* **No gateway console.** The preset checks that a MikroTik or Linux gateway offers are not offered here.
* **No updates by itself.** You replace one line in the Compose file. See [Updating](#updating-the-image).

It runs on TrueNAS SCALE, or on any machine with Docker and Docker Compose. The host needs a Linux kernel with WireGuard (Linux 5.6 or later). TrueNAS CORE has no Docker: use a router gateway there.

### What the container can and cannot do on the host

The Compose file from ProxyLink is the whole of what the container is given, and you can read it before you start it:

* Every capability is dropped except two, `NET_ADMIN` and `NET_RAW`. It needs them for its WireGuard connection and for its own firewall rules.
* `no-new-privileges` is set, the container's file system is read-only, and IP forwarding is switched on inside the container only.
* It has one volume, for the key it makes for itself. It has no access to the host's disks, no Docker socket, it is not `privileged`, and it does not run in the host's network. Started with `network_mode: host`, it refuses to start and changes nothing on the host.

The container takes no commands. With the agent line in the Compose file, the agent asks ProxyLink which networks it carries, and runs nothing: the answer is a list of private network ranges, never a command, a script or an address to contact. Each network in the answer is checked in the container before a rule is made for it. Without the agent line, the container asks ProxyLink nothing after it has connected the first time, and forwards to the one network in the Compose file only.

> [!WARNING]
>
> Through the gateway, ProxyLink can reach every address of its networks. That includes the Docker host's own address, and so whatever the host serves there: its web interface, file shares, and ports published by other containers. Devices see those connections as coming from the Docker host, so a service that trusts "this host" by address also trusts connections made through ProxyLink. Who may open what is decided in ProxyLink.

An example: the gateway runs on a NAS whose own admin page is on port 5001, beside a container that publishes port 8080. Both are addresses of the network, so a service can be added for either, and a person who may open that service reaches it. Nothing is opened by itself: a device or a port is reachable through ProxyLink's pages only after someone in your team adds a service for it. Engineers on the team's VPN reach the gateway's networks as they do on any gateway.

## Add it

In a team, only the owner or a manager can add a gateway.

**1. Open the form**

Go to **Devices** → **+ Add device**. On a wide screen, choose **Docker (a NAS)** under **A whole network, another way**. On a phone, choose **Docker gateway**. The form **Add Docker gateway** opens.

**2. Fill it in**

* **Gateway label**: a name for the gateway, for example `Office NAS`.
* **Network to reach**: the network the Docker host is on, for example `192.168.1.0/24`. It must be a private network, /20 to /30.
* **Let me add more networks later, from ProxyLink.** Ticked by default. It puts the agent line in the Compose file. Untick it and the container keeps to the one network above.
* **Which client is this for?** (in a team, optional): pick a client, or **+ Create new client**.

Click **Generate Compose file**. Nothing is added to your list yet: the gateway appears when the container has started.

**3. Run it on the Docker host**

The form now shows **Run this on the Docker host** and the Compose file. Click **Copy the Compose file**.

* **TrueNAS SCALE:** Apps, Discover Apps, the menu at the top right, **Install via YAML**. Paste the text.
* **Anywhere else:** save it as `compose.yaml` and run:

```bash theme={null}
docker compose up -d
```

> [!WARNING]
>
> The link inside the file works once, and for 30 minutes after it was created. If it has expired, or the container was started a second time with an empty volume, generate a new file.

**4. Check that it connected**

Read the container's log:

```bash theme={null}
docker logs proxylink-gateway
```

It ends with:

```
ProxyLink: OK. Connected to ProxyLink.
```

Click **Done**. The gateway is now in your list on the **Devices** page. Its own page shows the release it runs ("Installed as v0.2.0."), a section **Address translation**, and **VLAN subnets**, where you add more networks.

**5. Add services**

Add a service for each thing you want to open on the network, as on any other gateway.

### The Compose file

This is the file ProxyLink gives you. Your own file has a real image line, your own link and your own network.

```yaml theme={null}
# ProxyLink gateway. The link below works once, for 30 minutes after it was created.
# Start it with:  docker compose up -d      Remove it with:  docker compose down -v
services:
  proxylink-gateway:
    image: ghcr.io/proxylinkadmin/proxylink-gateway@sha256:<digest>
    container_name: proxylink-gateway
    restart: unless-stopped
    cap_drop:
      - ALL
    cap_add:
      - NET_ADMIN
      - NET_RAW
    security_opt:
      - no-new-privileges:true
    sysctls:
      - net.ipv4.ip_forward=1
    environment:
      PROXYLINK_URL: "https://app.proxylink.dev/deploy-docker/<your one-time link>"
      # The network this gateway forwards to. The container refuses to start if
      # ProxyLink names another one as its first network.
      PROXYLINK_LAN: "192.168.1.0/24"

      # Lets you add more networks later on this gateway's page in ProxyLink. Once a
      # minute the container asks ProxyLink which networks it carries, and gets back a
      # list of private ranges: never a command. Delete this line and the container
      # forwards to the one network above only, whatever ProxyLink answers.
      PROXYLINK_AGENT: "on"
    volumes:
      - proxylink-gateway-data:/data
    networks:
      - proxylink-gateway
    read_only: true
    tmpfs:
      - /run
      - /tmp

volumes:
  proxylink-gateway-data:

networks:
  proxylink-gateway:
```

The image is named by its digest, not by a tag, so the file always starts the same release. Keep the whole file as it is, also after the link has been used: the container reads `PROXYLINK_URL` again at every start to know where to ask for its networks.

## Its networks

**The first network is fixed.** It is the one written as `PROXYLINK_LAN` in the Compose file. The container checks ProxyLink's answer against that line and refuses to start for any other first network. To change it, remove the gateway and add it again.

**More networks are added on the gateway's page.** This needs the agent line in the Compose file.

1. Open the gateway's page.
2. Under **VLAN subnets**, enter the network, for example `192.168.40.0/24`, and click **Add**.
3. The network appears in the list with **Waiting for the gateway, up to a minute**. The page checks again by itself. When the container has made its rules, the line changes to **On the gateway**.

The container picks a new network up within about a minute. There is no restart, and nothing to do on the host. The other networks keep working meanwhile.

The Docker host must be able to reach the new network itself, for example through the site's router. The container forwards; it does not create a route that the host does not have.

### Limits

* A Docker gateway carries **at most eight networks**, the first one included. So you can add seven. Eight is a limit ProxyLink sets for this kind of gateway, not something Docker imposes. A site with more belongs on a router gateway, or on a second Docker gateway.
* Each network is a private range (`10.x`, `172.16` to `172.31.x`, `192.168.x`), **/20 to /30**: at most 4,094 addresses in one network.
* Write the network itself, for example `192.168.40.0/24`, not an address inside it.
* A network may not overlap another network of the same gateway, ProxyLink's own ranges (`10.100.0.0/16` and `10.128.0.0/9`), or the Docker network the container sits on.

### What the page says about each network

| The page says | What it means |
| - | - |
| **On the gateway** | The container has rules for this network. It is reachable. |
| **Waiting for the gateway, up to a minute** | Added in ProxyLink. The container has not confirmed it yet. |
| **Not known: the gateway is not asking ProxyLink right now** | The container has not asked for a few minutes. It may be stopped, offline, or started without the agent line. ProxyLink does not say "no" here, because it does not know. |
| A sentence that begins **The gateway did not take it** | The container checked the network and refused it. See below. |

### When ProxyLink refuses a network

These are shown when you click **Add**. Nothing is changed.

| The page says | What to do |
| - | - |
| "Enter a valid private network, e.g. 192.168.40.0/24. Only private ranges (10.x, 172.16–31.x, 192.168.x) with a /20–/30 prefix are allowed for a Docker gateway." | Use a private range, /20 or smaller. Split a larger network into several, or use a router gateway for it. |
| "Write the network itself, for example 192.168.40.0/24." | You typed an address inside the network. Use the network the sentence names. |
| "A Docker gateway carries at most 8 networks." | Remove a network you no longer need, or use a second gateway. |
| "That network overlaps 192.168.40.0/24, which this gateway already carries." | The new network lies inside one the gateway has, or the other way round. It is already covered, or the range is wrong. |
| "This Docker gateway was started without the agent, so it carries the one network in its Compose file. To add networks from here, put the lines below in the Compose file and run docker compose up -d again. Nothing has to be removed or added again: the volume keeps the key." | The agent line is missing. Put the lines the page shows into the Compose file. See [Coming from v0.1.0](#coming-from-v010). |
| "This Docker gateway has not asked ProxyLink for its networks for a few minutes, so a new network would not reach it. Check that the container is running and that the agent line is still in its Compose file, then try again." | Check `docker ps` and `docker logs proxylink-gateway` on the host. When the container is asking again, add the network. |
| "Could not allocate an isolated range for this VLAN right now. Try again in a moment." | Try again. |

A network that the gateway already has, and a range that is ProxyLink's own or in use by another account, are also refused with a sentence that says so.

### When the container refuses a network

ProxyLink accepted the network, and the container did not. The network stays in the list with one of these sentences. The container's log says the same with a short code (see [the log page](https://proxylink.dev/docs/tunnels/docker-gateway-troubleshooting.md)).

| The page says | Code in the log | What to do |
| - | - | - |
| "The gateway did not take it: it is not a private network." | `not-private` | Remove it and add a private range. |
| "The gateway did not take it: that range is ProxyLink's own." | `reserved` | Remove it. `10.100.0.0/16` and `10.128.0.0/9` cannot be a network of a gateway. |
| "The gateway did not take it: a network there is /20 or smaller." | `size` | Remove it and add smaller networks. |
| "The gateway did not take it: it overlaps the Docker network the container is on. Give the container another range in the Compose file." | `overlap-docker` | Give the container's Docker network another range in the Compose file (`networks:`, `ipam`), then start it again. |
| "The gateway did not take it: it overlaps another network of this gateway." | `overlap-own` | Remove one of the two. |
| "The gateway did not take it: it already carries its eight networks." | `too-many` | Remove a network you no longer need. |
| "The gateway could not set its rules for it. Its log (docker logs proxylink-gateway) says why." | `rules` | Read the log on the host. The host's kernel refused the rule. |
| "The gateway did not take it." | `shape`, `mapped` | The answer was not in the form the container accepts. Remove the network and add it again. If it repeats, contact us. |

A refused network does not affect the others: the container keeps every network it already carries.

### Giving the container's Docker network another range

Docker picks a range for the container's own network. If that range overlaps one of your networks, the container says so (`overlap-docker`) and does not take the network. Tell Docker which range to use, one that is nowhere on the site. At the end of the Compose file, replace

```yaml theme={null}
networks:
  proxylink-gateway:
```

with

```yaml theme={null}
networks:
  proxylink-gateway:
    ipam:
      config:
        - subnet: 10.250.250.0/24
```

Then run `docker compose down` (without `-v`, so the volume stays) and `docker compose up -d`. It is the same gateway, on another Docker range.

### Removing a network

Under **VLAN subnets**, click **Remove** beside the network. ProxyLink stops sending to it, and the container removes its rules the next time it asks. There is no restart.

Removing is refused while a service points into the network. The page says, for example: "2 services on this gateway point into 192.168.40.0/24 ("NVR", "PBX"). Delete them first, then remove the network." Delete those services, then remove the network.

If you add the same network again later, it gets a new range inside ProxyLink, so its devices get new VPN addresses.

## Address translation

ProxyLink reaches every network of a gateway through a range of its own, so two sites that use the same network never meet. On a Docker gateway the container makes this rule itself when it starts, so there is nothing to set up: the section **Address translation** on the gateway's page shows **Your network** and **Inside ProxyLink**. More about it in [Overlapping subnets](https://proxylink.dev/docs/tunnels/router-gateway.md#overlapping-subnets).

## Updating, restarting, moving, removing

Everything that makes the container *this* gateway is in its volume: the key it made, and the list of its networks. Keep the volume and it stays the same gateway. Remove the volume and it is a new machine that ProxyLink does not know.

### Updating the image

The container does not update itself. When a newer release exists, the gateway's page says so and shows the new image line.

1. Replace the `image:` line in your Compose file with the one shown on the gateway's page.
2. Run `docker compose up -d` again.

Do not use `down -v`. The volume keeps the key, so it stays this gateway, with its services. The log starts with the release that runs:

```
ProxyLink: gateway v0.2.0 starting
```

**Going back.** If the new release does not start, or you want the previous one, put the old `image:` line back and run `docker compose up -d` again. The volume is the same for both releases, so it stays the same gateway. Its log says why a start failed. Going back to v0.1.0 means one network again: that release has no agent and ignores the saved list.

### Restarting and rebooting

Nothing to do. After `docker restart proxylink-gateway`, and after a reboot of the host, the container starts by itself and brings every network back from its volume. If ProxyLink cannot be reached at that moment, it starts with the networks it carried last time.

### Moving to another machine

The new machine must be on the same first network. Stop the container on the old machine, bring the contents of the volume `proxylink-gateway-data` to the new machine, and start it there with the same Compose file. The old and the new container must never run at the same time.

Without the volume it cannot be moved: the link in the Compose file was used once. Then remove the gateway in ProxyLink and add it again, as a new one. Its services are removed with it and have to be added again.

### Switching the agent off

Delete the line `PROXYLINK_AGENT: "on"` from the Compose file and run `docker compose up -d` again. The gateway goes back to its first network only; the saved list is ignored. Networks you added stay listed on the gateway's page as **Not known: the gateway is not asking ProxyLink right now**, and are not reachable. Remove them there if you no longer want them.

### Removing it

1. On the gateway's page, under **Remove this device**, click **Remove device**. It is disconnected at once. Its services are removed with it, and any share link to them stops working.
2. On the host:

```bash theme={null}
docker compose down -v
```

`-v` removes the volume with the key. To set the same machine up again later, add a new Docker gateway and use the new Compose file.

## Coming from v0.1.0

Release v0.1.0 carried one network and had no agent. A gateway installed with it keeps working as it is. To add more networks, change two lines of its Compose file. The gateway's page shows both under **VLAN subnets**.

1. **The image line.** Replace your `image:` line with the image line shown on the gateway's page.
2. **The agent line.** Add this line under `environment:`, at the same depth as `PROXYLINK_LAN`:

```yaml theme={null}
      PROXYLINK_AGENT: "on"
```

Leave `PROXYLINK_URL` and `PROXYLINK_LAN` as they are. Then run:

```bash theme={null}
docker compose up -d
```

Nothing has to be removed or added again. The volume keeps the key, so it is the same gateway with the same services. Once the container has started and asked ProxyLink for the first time, the page offers the field to add a network.

## When something is wrong

The container says what it is doing, and what stopped it, in its own log: `docker logs proxylink-gateway`. Every sentence it can print, with what it means and what to do, is on its own page: [Docker gateway: the log and what to do](https://proxylink.dev/docs/tunnels/docker-gateway-troubleshooting.md).

## Limits, in one place

* Networks: at most eight per gateway, the first included. Each a private range, /20 to /30.
* One network only without the agent line.
* The first network cannot be changed. Remove the gateway and add it again.
* No Wake-on-LAN, and nothing else that needs a broadcast.
* No gateway console.
* No automatic updates. One line in the Compose file, by you.
* The link in the Compose file works once, for 30 minutes.
* The container must run in its own Docker network, never in the host's.
* Over the VPN, engineers reach the gateway's networks. Other devices of the same client do not.
* TrueNAS CORE is not supported: it has no Docker.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.