DockFlare (Tunnel management)

Time Required

5 Minutes

Difficulty

Easy

Required Knowledge

Cloudflare DNS, Cloudflare Zero Trust, Docker Compose

circle-exclamation

Please ensure you have followed Set up Wildcard application before following this guide - you may accidentally make your internal resources public.

Generate an API key

You will need an API key with write access to your Cloudflare Zero Trust and DNS zones

  1. At API tokens, click on 'Create Token'

  2. Select the 'Custom Token' and set the below

    1. Give your token a name, eg "Dockflare"

    2. Permissions:

      Account

      Cloudflare Tunnel

      Edit

      Account

      Account Settings

      Read

      Account

      Access: Apps and Policies

      Edit

      Zone

      Zone

      Read

      Zone

      DNS

      Edit

    3. Account Resources"

      Include

      All Accounts

    4. Zone Resources"

      Include

      All Zones (or select specific domains)

  3. Click on 'Continue to Summary'

  4. Click on 'Create token'

  5. Save your API key to your password vault

Get your Account ID

  1. Next to your name / account name, click on the 3 dots menu

  2. Click on Copy Account ID

  3. Save to your Password vault

Create Portainer Stack

circle-info

The below compose file is NOT my live production file - refer to the all docker stack under the 'homelab' section

How to use Dockflare

Add the following labels to any docker compose containers you wish to make accessible via Zero Trust,

and use the following env files

circle-info

It is possible to have multiple Dockflare links to 1 container, eg an internal admin page and a public status page. Use dockflare.1.xxx, dockflare.2.xxx, dockflare.3.xxx etc for this You may need to edit the variables to make this function correctly

Last updated