type
status
date
slug
summary
tags
category
icon
password
When using Cloudflare Wrangler on a remote SSH server,
wrangler login
attempts to open a browser for authentication, which can fail in headless or remote environments. Here’s how to log in without requiring a browser.You will get something like this.
Solve it Using API Token Authentication
Instead of
wrangler login
, authenticate using an API token.Step 1: Generate an API Token
- Go to Cloudflare API Tokens.
- Click Create Token.
- Use the Edit Cloudflare Workers template or create a custom token with:
- Account Settings: Read
- Workers Scripts: Edit
- Click Create Token and copy it.
Step 2: Configure Wrangler with API Token
On your remote SSH server, run:
Now, verify authentication: