---
title: How do I connect Cloudflare to codus?
question: connect cloudflare
area: integrations
order: 4
surface: desktop
audience: beginner
keywords: [cloudflare, connect cloudflare, dns, email routing, workers, register domains, registrar, api token, custom token, permissions, scopes, zone, hosting, cloudfare, cloud flare]
related: [integrations-overview, connect-godaddy, connect-vercel]
updated: 2026-07-21
---

# How do I connect Cloudflare to codus?

Open **Integrations** in settings, find the **Cloudflare** card under **Hosting + deployment**, and click **Connect**. The card walks you through creating a scoped **API token** on the Cloudflare dashboard, then you paste it in and click **Connect**. Once connected, codus has full API access to register domains, manage DNS, set up Email Routing, and deploy Workers. The card asks for a custom token with a short list of permissions so it can only touch what codus needs.

## Before you start

- You need a Cloudflare account.
- codus asks for a **Custom Token**, not the all-powerful Global API Key. This keeps the token limited to the things codus does.
- Cloudflare shows the token once, so keep codus open to paste it straight back. This one takes about two minutes.

## Steps

1. Open the gear (**⚙**), click **See all settings →**, then click **Integrations**.
2. Find the **Cloudflare** card and click **Open Cloudflare API tokens page**. Your browser opens dash.cloudflare.com/profile/api-tokens.
3. Click **Create Token**. Sign in first if Cloudflare asks.
4. Scroll to **Create Custom Token** and click **Get started**.
5. For the token name, type **codus**.
6. Under **Permissions**, add these rows (the exact names matter):
   - Zone · DNS · Edit
   - Zone · Email Routing Rules · Edit
   - Zone · Workers Routes · Edit
   - Zone · Zone · Read
   - Account · Email Routing Addresses · Edit
   - Account · Workers Scripts · Edit
   - Account · Domain (Registrar) · Edit, to let codus buy domains
   Pick **DNS**, not **DNS Settings**. They are different permissions and codus needs DNS.
7. Under **Account Resources** choose your account, and under **Zone Resources** choose **All zones**.
8. Click **Continue to summary**, then **Create Token**, then copy it. Copy it now, because Cloudflare only shows it once.
9. Come back to codus, paste the token into the box on the card, and click **Connect**.

## How do I know it worked?

The card shows a green **Connected** label, followed by your account name once codus reads it back. The card notes: "Your token is stored encrypted on this Mac and is only ever sent to Cloudflare."

## Common problems

- **A DNS change failed with a permissions error.** You may have picked **DNS Settings** instead of **DNS**, or missed a row. The card puts it plainly: "If a permission is missing, codus will tell you when it tries to use it, and you can add it on the same page." Edit the token on Cloudflare, add the missing permission, and try again. You do not need a new token to add a permission.
- **codus cannot buy a domain.** Buying domains needs the **Account · Domain (Registrar) · Edit** row. Add it to the token if you left it out.
- **My token was rejected at connect.** codus verifies the token with Cloudflare when you connect. Re-check the permissions and zone resources, then paste a fresh token.
- **I want to disconnect.** Click **Disconnect** and confirm. codus forgets the token; reconnect any time with a new one.
