A Gamers Grind / XFGN / LM
Status
  • 🖥️www.agamersgrind.com
  • 🏙️--- Public Files ---
    • 👋Welcome, friends
    • ⛑️I need help!
    • ☕Buy me a Coffee
  • 📚Guides
    • Mini Guides
      • Valheim FPS Boost
      • Redirect domain to Google Site
      • Docker Compose
        • 'All' Compose File
        • Add Health Check to Container
        • Mount NFS Share to Container
        • Map hostname to container
    • Portainer and GitOps
      • Set up GitHub
      • Install Portainer
      • Create your first GipOps Compose file
      • Deploy your first GitOps stack
      • Managing your production compose files
    • Cloudflare
      • Domains
      • Generate an API Key
      • Tunnel
        • Create a Tunnel
        • Create a Proxy (Public Hostname)
        • Access Groups & Authentication
      • Dynamic DNS
    • Pterodactyl
      • Creating a new Panel
      • Creating a new Wings node
      • Join servers via domain
      • Configuring your Node Database
      • Server Best Practices & Suggestions
      • Troubleshooting
  • 🎮Game Servers
    • Valheim Public
    • Valheim Private
    • MultiMC (Minecraft)
    • CreateCraft (Minecraft)
    • Insurgency Sandstorm
  • ⚔️AGG Moderation
    • ❔Creating a new Server
    • Approving Valheim Application
  • 🗄️Internal Documentation
Powered by GitBook
On this page
  • Create your Tunnel
  • Deploy the Tunnel Container
  • Test the Tunnel

Was this helpful?

  1. Guides
  2. Cloudflare
  3. Tunnel

Create a Tunnel

PreviousTunnelNextCreate a Proxy (Public Hostname)

Last updated 1 year ago

Was this helpful?

Create your Tunnel

  1. Log into Cloudflare

  2. On the left, click on 'Zero Trust'

  3. On the left, click on Access > Tunnels

  4. Click on 'Create a tunnel'

  5. Name the tunnel (eg "Home Network") and click on 'save tunnel'

  6. Scroll down on the next page and locate the connector command, cloudflared.exe service install`` R4nd0mStr1ng0fCh4ract3rs

  7. Take note of the unique key after 'install' (bolded above); save this in your password vault

  8. Click on Next

  9. We're now forced to create a public hostname (reverse proxy). Per the scenario we will create a tunnel for Overseer;

    Field
    Data

    subdomain

    overseerr

    domain

    yourdomain.com

    path

    type

    HTTP

    url

    ServerHostame:Port

  10. click on 'Additional application settings'

  11. Click on 'Save tunnel'

  12. You will be brought back to the Tunnels homepage, your tunnel will show as 'inactive'

Deploy the Tunnel Container

  1. Create a new compose file in your GitHub repo using the below compose template

  1. Create a new GitOps stack using the tunnel compose file

  2. Under Environmental variables

    1. add a variable "CLOUDFLARE_UUID", using the key noted in step 6 above

  3. Deploy your stack

  4. Refresh the Cloudflare tunnel page, it will now state 'active'

Repeat steps 2-4 for each additional tunnel you wish to create (for load balancing and redundancy)

Test the Tunnel

Browse to the public hostname we created earlier (step 9; subdomain + domain) and confirm that the Overseerr screen loads

📚

Time Required

15 Minutes

Difficulty

Low

https://github.com/trentnbauer/agg/blob/main/docker-compose/cloudflared.yml
version: '3'

services:

  app:

    image: cloudflare/cloudflared:2025.5.0@sha256:f9d5c5b94cd7337c0c939a6dbf5537db34030828c243fca6b589fd85ab25d43b

    restart: unless-stopped

    network_mode: host

    environment:

      - TUNNEL_TOKEN=$CLOUDFLARE_UUID

      - TUNNEL_METRICS=0.0.0.0:5566

    command: tunnel run

    logging:

      driver: "json-file"

      options:

        max-size: "10m"

        max-file: "3"

    healthcheck:

      test: ["CMD", "cloudflared", "--version"]       # Check if cloudflared version command works

      interval: 60s                                   # Time between health check attempts

      timeout: 55s                                    # Time to wait for a response

      retries: 3                                      # Number of retries before marking as unhealthy

      start_period: 30s                               # Delay before health checks begin

    labels:

      - "autoheal=true"