Skip to content

Instantly share code, notes, and snippets.

@ellcom
Created September 4, 2026 08:24
Show Gist options
  • Select an option

  • Save ellcom/ea0053be9a872a1dc96754b222ce670b to your computer and use it in GitHub Desktop.

Select an option

Save ellcom/ea0053be9a872a1dc96754b222ce670b to your computer and use it in GitHub Desktop.
Install cloudflared on raspberry pi zero
# done locally for speed, need go installed i.e. brew install go
git clone https://github.com/cloudflare/cloudflared.git
cd cloudflared
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/cloudflaredVERSION=$(git describe --tags --abbrev=0)VERSION=$(git describe --tags --abbrev=0)
# transfer to pi
scp cloudflared elliot@pi-ip-address:.
# ssh into pi
# put the file in /usr/local/bin/ on the pi
mv cloudflared /usr/local/bin/.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment