Skip to content
Pocket Homelab
Install

Cloudflare

Cloudflare Tunnel health, your zones, and DNS records to add, edit and delete, on the Cloudflare screen and the Mac Cloudflare workspace.

iPhoneMac
On this page

Cloudflare runs DNS for many homelab domains, and Cloudflare Tunnel is a popular way to reach a homelab from outside. Unlike the other services here, it is a cloud account, not something you host yourself. Pocket Homelab uses Cloudflare’s API to show whether your tunnels are up, list your zones, and let you add, change and delete DNS records.

What you get

  • A Cloudflare screen with your Tunnels and Zones; a zone opens its DNS records.
  • A Cloudflare tab, off by default: turn it on in Settings → Tabs to pin it to the tab bar.
  • Spotlight entry “Cloudflare” (“Zones, DNS and tunnels”; dns, records, tunnel, cloudflared, domains, proxy).
  • Mac: the Cloudflare workspace in the sidebar’s Infrastructure group (⌥⇧⌘2 by default).

There is no Home card for Cloudflare.

Set up

There is no address to enter: the app always talks to api.cloudflare.com. All it needs is an API token.

  1. Sign in at dash.cloudflare.com and open My Profile → API Tokens. Choose Create Token, then Create Custom Token.

  2. Give it these permissions:

    • Zone → Zone → Read, to list your zones.
    • Zone → DNS → Edit, to add, change and delete records. Pick Read instead if you only want to look.
    • Account → Cloudflare Tunnel → Read, to see your tunnels.

    Under Zone Resources, include all zones or just the ones you want in the app. Under Account Resources, include your account.

  3. Create the token and copy it. Cloudflare shows it only once.

  4. In Pocket Homelab: Settings → Services → Cloudflare, paste the token, and add your account ID if you want (see below). Tap Test connection.

  5. Turn on the Cloudflare tab in Settings → Tabs, or open Cloudflare from Spotlight.

The token alone is enough. Without an account ID, the app shows the tunnels of every account the token can see.
KeyFieldRequiredSecretWhere to get it
CLOUDFLARE_API_TOKENCloudflare API tokenRequiredSecretCloudflare is a cloud account, not self-hosted. An API token from dash.cloudflare.com → My Profile → API Tokens with Zone Read, DNS Edit (or DNS Read to only look) and Cloudflare Tunnel Read. Stored in the Keychain.
CLOUDFLARE_ACCOUNT_IDCloudflare account IDOptional—Optional: the account whose tunnels to show (and the one an account-owned token belongs to). Empty reads every account the token can see.
The token alone is enough. Without an account ID, the app shows the tunnels of every account the token can see.

On iPhone

The Cloudflare screen refreshes every two minutes while it is open, and on pull to refresh or Refresh. Open Cloudflare at the top opens your dashboard. A search field, “Zone or tunnel”, filters both lists.

  • Tunnels: one row per tunnel with its name, the number of connections and the Cloudflare data centres they go to (“2 connections · AMS, FRA”), and a status tag: healthy in green, degraded in orange, down in red, inactive in grey. Tunnels that are down or degraded come first. A tunnel with no connector says “No connections”, or “Never connected” if it never had one.
  • Zones: each domain with its plan and account, and a paused or status tag when it is not simply active. The footer reminds you: “Cloudflare is a cloud account, not something on your homelab. DNS changes take effect for everyone at once.”

Tap a tunnel for its Status, Account, Created date and Tunnel ID, then its Connections: the data centre, the origin address, how long it has been connected and the cloudflared version, with a reconnecting tag when one is about to reconnect.

Tap a zone for its DNS records. Each row has the type, the name (@ for the zone itself, www for www.example.com), the content with the priority in front for MX records, any comment, and the TTL (Auto for automatic). A cloud marks records that can be proxied: orange when proxied, grey when DNS only. Search with “Name, type or content”.

  • Tap a record, or long-press it and choose Edit…, to change it.
  • Long-press for Copy Content and Delete…, or swipe left for Delete.
  • Add Record (the + at the top) starts a new one.

On Mac

The Cloudflare workspace sits under Infrastructure in the sidebar, with the header “Your Cloudflare account (in the cloud, not on the homelab): zones, DNS records to add, edit and delete, and tunnel health.” It holds the same Tunnels and Zones as the iPhone screen, with Open Cloudflare and Refresh in the toolbar. Click a zone for its DNS records; right-click a record for Edit…, Copy Content and Delete….

Actions

DNS records are the one thing this integration changes in your Cloudflare account. Tunnels and zones are read-only.

  • New Record and Edit Record have the same fields: Type (A, AAAA, CNAME, TXT, MX, NS, SRV, CAA or PTR; fixed once a record exists), Name (@ for the zone), the content, Priority for MX and SRV, TTL (Auto, or from 1 min to 1 d), Proxied through Cloudflare and an optional Comment.
  • The editor checks your input before it sends anything, for example “An A record needs an IPv4 address”, “An MX record needs a priority” or “Only A, AAAA and CNAME records can be proxied”. Add or Save stays greyed out until it is right.
  • Turning on Proxied through Cloudflare sets the TTL to Auto, as Cloudflare does.
  • Delete always asks first: “Delete the A record www.example.com?”, with the content and “The record disappears from public DNS within minutes. This cannot be undone.” Tap Delete Record to confirm.
  • If Cloudflare refuses a change, its own error message is shown.

Works with

  • Cloudflare’s tunnels are the outside door to many homelabs, so the Tunnels list is a quick way to see whether that door is open when a service can’t be reached from outside.
  • The free plan counts Cloudflare as one service as soon as the token is set.

Tips & troubleshooting

  • The token is a password to your DNS. It is stored in the Keychain, and a DNS → Read token is enough if you never want to change records from your phone.
  • If the zones load but Tunnels shows an error, the footer says what is missing: “Tunnels need Cloudflare Tunnel Read on the token, and the account (CLOUDFLARE_ACCOUNT_ID or every account the token sees).” Add the permission to the token, or set CLOUDFLARE_ACCOUNT_ID.
  • “The token sees no zones.” means the token’s Zone Resources don’t include any of your domains.
  • A refusal like “the API token was refused or lacks the permission for …” names the part of the API that said no, which tells you the permission to add.