Labelgate

About Labelgate

Manage Cloudflare DNS, Tunnels and Access from Docker container labels.

Labelgate watches your Docker containers and sets up Cloudflare for them. You add labels to a container, and Labelgate creates the DNS record, the tunnel route or the Access rule. When the container goes away, Labelgate cleans up.

services:
  webapp:
    image: nginx
    labels:
      labelgate.tunnel.web.hostname: "app.example.com"
      labelgate.tunnel.web.service: "http://webapp:80"

Start with Getting Started.

What it manages

Label typeWhat you getExample
dnsDNS records (A, AAAA, CNAME, TXT, MX, SRV, CAA)Point api.example.com at your server
tunnelCloudflare Tunnel routesPublish app.example.com without opening ports
accessZero Trust Access applications and policiesAllow only alice@example.com into admin.example.com

Every label has the same shape:

labelgate.<type>.<name>.<property>=<value>

<name> is any short name you choose, such as web or api. It groups the labels of one service. See the Label Reference.

How it works

  • Labelgate reads labels from the local Docker socket. Other Docker hosts can run a small agent that sends their labels to the main instance.
  • It applies changes as soon as a container starts or stops, and checks everything again every 5 minutes.
  • It only changes or deletes Cloudflare resources it created. Your hand-made records are never touched. See Ownership & Conflicts.
  • A built-in dashboard shows what it manages and any errors.

Next steps

On this page