Skip to content

Instantly share code, notes, and snippets.

@uplg
Last active April 1, 2026 01:34
Show Gist options
  • Select an option

  • Save uplg/2354ab0b0d32b832fc87ba80e1fefac8 to your computer and use it in GitHub Desktop.

Select an option

Save uplg/2354ab0b0d32b832fc87ba80e1fefac8 to your computer and use it in GitHub Desktop.
Cloudflared compile for ARMv6 (RPi 1, Zero, Zero W)

Cross compile cloudflared for tunnel usage on old ARMv6 RPi.

Checked on RPi 1 Model B

Find on target Pi

which cloudflared
ls -l $(which cloudflared) #(keep result)

Clone official repo

git clone https://github.com/cloudflare/cloudflared.git
cd cloudflared

Cross compile for armv6 (will output a statically linked binary)

COMMIT=$(git rev-parse --short HEAD)
VERSION=$(git describe --tags --abbrev=0)
CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build \
  -ldflags "-X main.Version=$VERSION -X main.BuildTime=$(date -u +%Y-%m-%dT%H:%M:%SZ) -X main.GitCommit=$COMMIT" \
  -o cloudflared ./cmd/cloudflared

Stop all running tunnels

ps aux | grep cloudflared
# Selective kill
kill -9 <PID>
# Nuclear option
killall cloudflared

Save previous (on target)

mv /usr/bin/cloudflared /usr/bin/cloudflared.bak

Transfer to target (from builder)

scp cloudflared user@server=/usr/bin/cloudflared # use result path

Check

maison:/var/log# cloudflared --version
cloudflared version 2026.3.0 (built 2026-04-01T01:21:51Z)

Restart tunnels.

(Cloudflare will notify when you are behind latest in logs.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment