Wrangler Login Guide for Headless Ubuntu
If you are running on a headless machine without a browser, follow these steps to authenticate Wrangler:
Method 1: API Token (Recommended)
- Generate Token: Go to Cloudflare API Tokens and create a token using the Edit Cloudflare Workers template.
- Set Environment Variable: Run the following in your terminal:
export CLOUDFLARE_API_TOKEN="your-api-token-here"
- Verify:
npx wrangler whoami
Method 2: Manual Login (No-Browser)
If you prefer the OAuth flow:
- Run:
npx wrangler login --no-browser
- Copy the URL provided and open it in a browser on your local machine.
- After authorizing, follow the instructions in the terminal to complete the link.
Shared by Wallie