claude-code·9 min read·

Claude Code on a Raspberry Pi at home: the GBP 50 always-on agent (UK indie hacker, 2026)

The Hetzner VPS is GBP 3.30/mo recurring. A Raspberry Pi 5 (8GB) is roughly GBP 80 one-off and zero recurring beyond the electricity. For a UK indie hacker who wants a Claude Code agent at home, the maths is interesting - here is the full setup, the ARM64 OAuth gotcha, and when the Pi beats the cloud box.

Claude Code on a Raspberry Pi at home: the GBP 50 always-on agent (UK indie hacker, 2026)

The Hetzner VPS is GBP 3.30/mo recurring. Predictable, professional, always-on, no home-power risk, public IP, full server-grade kit. That is the right answer for most production workloads.

There is a different answer if you already have a Pi on a shelf or you genuinely like the idea of a small glowing box on your desk doing your morning brief: a Pi 5 8GB, total cost about GBP 80, GBP 110 with an NVMe HAT and a small SSD. Recurring cost is about GBP 1.05/mo of UK electricity at 30p/kWh. Break-even against the Hetzner box at around 30 months. After year three it is materially cheaper. And - the actually interesting part - it sits on your home network, which opens up workflows that an offshore VPS cannot do cleanly.

This post is the full UK pricing breakdown at The Pi Hut, the ARM64 OAuth gotcha and its workaround, the systemd setup that mirrors the Hetzner pattern exactly, and a worked example of a morning-brief Pi at home.

The hardware bill, in GBP

Numbers from The Pi Hut and Pimoroni in May 2026.

ItemPriceNotes
Raspberry Pi 5 8GBGBP 80The Pi Hut; Pimoroni similar
Argon One V3 caseGBP 22Active cooling, NVMe-ready
27W USB-C power supplyGBP 12Official Pi 5 PSU
256GB SanDisk SD cardGBP 18Bootable, A1 rated
NVMe HAT + 256GB SSDGBP 30Optional, but recommended for always-on
Ethernet cableGBP 5Wi-Fi works but wired is more reliable
TotalGBP 110-127depending on SSD upgrade and case choice

Optional but recommended for serious always-on use: the NVMe HAT plus SSD. SD cards under heavy logging fail in 12-18 months. NVMe survives indefinitely. For an evening-tinkerer scope you can skip it and live with the SD card.

Recurring cost. The Pi 5 8GB idles at about 3W, peaks at about 10W under load. Average mixed load across a day is roughly 5W. At the Ofgem April 2026 price cap of about 28-30p/kWh, that is 5W x 24h x 30 days = 3.6 kWh per month = roughly GBP 1.05/mo of electricity. The Hetzner box at GBP 3.30/mo crosses break-even at:

GBP 110 (hardware) / (GBP 3.30 - GBP 1.05) = ~49 months, or about 4 years and 1 month.

With the cheaper SD-card-only setup at GBP 80 hardware, break-even is about 36 months - 3 years.

Honest assessment: the Pi is not actually cheaper in the short run. It is cheaper after year 3-4, and it has different operational properties (home network, local file access, smart-home integration). The reason to buy a Pi is rarely cost - it is access and tinkering.

The ARM64 OAuth gotcha and the workaround

Claude Code's default install flow opens a browser tab for OAuth on the host machine. A headless Pi has no browser. This is the open Anthropic GitHub issue #27405 and currently the single biggest friction point for ARM64 Raspberry Pi setups.

The clean workaround. On your laptop (which has a browser), run:

claude setup-token

This generates a 1-year OAuth token and prints it to stdout. Copy the token, SSH into the Pi, and export it:

ssh tim@raspberrypi.local
echo "ANTHROPIC_API_KEY=sk-ant-oat01-..." | sudo tee -a /etc/claude/morning-brief.env
sudo chmod 600 /etc/claude/morning-brief.env

From now on the systemd service reads the token from the EnvironmentFile and authenticates headlessly. The token survives for 12 months. Renew with the same claude setup-token flow once a year.

Two adjacent fixes you might see in older guides - none of them are needed in 2026 with the token approach:

    • SSH tunneling the OAuth callback back to the laptop. Brittle and unnecessary.
    • Running a headless X server on the Pi just for the browser. Heavy and unnecessary.
    • Using an old version of Claude Code that supported --api-key only. Functional but locks you out of the OAuth-only features.

The claude setup-token approach is the right answer until Anthropic ships the headless-friendly flow.

Installing Claude Code on the Pi

Standard Linux install, same on ARM64 as x86_64. From the Pi shell:

# Install Node.js 20 (required minimum)
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo bash -
sudo apt-get install -y nodejs

# Install Claude Code via npm
sudo npm install -g @anthropic-ai/claude-code

# Verify
claude --version

The npm install pulls the ARM64 build automatically. If you see "platform not supported" errors, you are on an older Node version - the 20.x install fixes it.

Set the token via EnvironmentFile (covered above). Verify with a quick claude -p "hello" test from the shell as the user that will run the agent.

The systemd timer pattern, same as Hetzner

The setup from the Linux scheduler post ports directly. Two files per scheduled job - a .service and a .timer.

# /etc/systemd/system/morning-brief.service
[Unit]
Description=Pi morning brief
After=network-online.target

[Service]
Type=oneshot
User=tim
EnvironmentFile=/etc/claude/morning-brief.env
WorkingDirectory=/home/tim/prompts
ExecStart=/usr/local/bin/claude -p --input-file brief.md
StandardOutput=journal
StandardError=journal
OnFailure=notify-failure@%n.service
# /etc/systemd/system/morning-brief.timer
[Unit]
Description=Trigger morning brief at 06:55 weekdays

[Timer]
OnCalendar=Mon-Fri 06:55
Persistent=true
RandomizedDelaySec=30

[Install]
WantedBy=timers.target

Enable: sudo systemctl enable --now morning-brief.timer. Logs flow into journalctl -u morning-brief. Failures fire the OnFailure handler from the alerting post and post to Slack.

The wider point: a Pi running Claude Code is just another Linux box. The systemd patterns are identical. The observability stack ports. The alerts port. The only ARM64-specific bit is the OAuth token flow.

When the Pi wins

Three cases where the Pi is materially better than the Hetzner VPS.

Home-network access. The Pi sits on your home LAN. It can talk to your local NAS, your smart-home hubs, your home printer, your local Plex server. The Hetzner box can't reach any of that without VPN gymnastics. A "summarise my email and dump it to the home NAS folder" agent is a Pi job, not a cloud job.

Local file access. The Pi can read and write files on a USB drive plugged into it, write to a Samba share you already have set up, or stream to a local TV. Cloud workflows that involve large files (research dumps, video clips, model checkpoints) get awkward over a cloud box's 20GB included storage.

Tinkering-friendly. It is on a shelf within arm's reach. Power-cycle it, swap the SD card, plug a screen in, attach a sensor over GPIO. The cloud box is a single SSH terminal away from you forever.

Long-term cost. After year 3-4 the Pi wins on pure GBP. For a hobby project running for the long haul, that compounds.

When the Hetzner box wins

Three cases where the Pi is the wrong call.

Public webhooks. A Pi at home behind a NAT-ed router needs Cloudflare Tunnel or Tailscale Funnel or port forwarding. All work, all add complexity. The Hetzner box has a public IP out of the box, the webhook just works.

Home-power risk. Your house has power cuts. Your router gets bumped. The Pi's SD card corrupts. Whatever it is, your home network is less reliable than a data centre. For a production agent that customers rely on, the Hetzner box wins on principle.

Symmetric upload. UK home broadband typically has 20-100 Mbps down and 5-20 Mbps up. Cloud uploads (large file outputs, log shipping) saturate that link. A data centre VPS uploads at gigabit speeds.

Shared-team access. Five teammates SSH-ing into your home Pi sounds wrong because it is wrong. The Hetzner box has clean per-user accounts, no home-network exposure.

Worked example: morning-brief Pi at home

The full end-to-end. A Pi 5 in the living room, plugged into Ethernet, runs morning-brief.timer at 06:55 every weekday. The brief reads overnight Gmail (via the Google API service account), pulls today's calendar, asks Claude to summarise into a short tldr, posts the tldr to a #morning Slack channel.

The cost line:

  • One-off: GBP 110 (Pi 5 8GB + Argon One V3 + 27W PSU + NVMe HAT + 256GB SSD)
  • Recurring electricity: GBP 1.05/mo
  • Recurring Claude (Pool B from 15 June): about GBP 0.90/mo (one Sonnet call/weekday at ~5k tokens)
  • Recurring infra: GBP 0 (no VPS, no cloud storage, no managed scheduler)

Total monthly recurring: GBP 1.95.

Compare with the same workflow on the Hetzner box:

  • One-off: GBP 0
  • Recurring Hetzner: GBP 3.30/mo
  • Recurring Claude: GBP 0.90/mo
  • Total monthly recurring: GBP 4.20

After 49 months the Pi is cheaper. Before then the Hetzner is. The pure-cost argument is finely balanced; the real argument is "do I want this thing to be on my home network or in a data centre".

The home-network angle nobody talks about

The interesting part of a home Pi is not the cost. It is that the Pi can do things a cloud box cannot.

A few examples from UK indie hackers running Pi-based Claude agents:

  • Local-NAS research agent. Reads PDFs from the home NAS, summarises into a single document, writes it back to the NAS. No cloud round trip, no privacy concerns, no upload bottleneck.
  • Smart-home glue. Listens for "Hey Siri, ask Claude..." routines via HomeKit shortcuts, runs the agent on the Pi, posts the answer back via push notification. The Pi is the bridge between the home-automation surface and the Claude API.
  • Family-photo organiser. Scans a Synology photo folder, asks Claude to caption and tag, writes EXIF metadata. Heavy file work, all on the same LAN.
  • Local-LLM fallback prototype. Runs Ollama plus a small local model alongside Claude Code. The Claude agent can fall back to the local model for cheap classification calls, keeping Pool B spend down.

None of these work cleanly on Hetzner. All work natively on a Pi.

The UK indie hacker default - Pi vs Hetzner

The honest recommendation after running both in production this year.

  • Hetzner ARM box at GBP 3.30/mo as the default for any production agent serving public traffic or anything you cannot afford to have go down because of a home power cut. Predictable, professional, near-zero maintenance.
  • Raspberry Pi 5 at home for any agent that benefits from being on the home LAN, for tinkering projects, for cases where the home-network angle is the actual point, or for the long-haul economics if you genuinely will run it for years.
  • Run both if you have a few different agents. The Pi handles the home-shaped jobs, the Hetzner handles the public-shaped jobs, same systemd patterns on each, observability ships to one Slack channel.

The wider point. A Pi 5 at home is not just a cheap server - it is a different operational shape from a cloud box. The cost story is a wash in the medium term. The compelling story is that the home-network agent class is mostly unbuilt. Cloud boxes can't reach the NAS, can't talk to the smart home, can't see the family photos. A small glowing box on a shelf can. For a UK indie hacker willing to spend an afternoon on the OAuth-token workaround and the systemd setup, the home Pi is the platform for the next wave of personal automation agents - not cheaper than the cloud box, but capable of jobs the cloud box cannot do.

The "Claude Code in production" arc is now eight days deep - single-shot scheduling, headless VPS, observability collect, observability alert, durable workflows, and home Pi. Six different infrastructure shapes, one mental model, GBP under five a month at the bottom end. The agents are the easy part. The platform under them is what makes the difference between "the agent works most of the time" and "the agent works".


New here? IdeaStack publishes one deeply researched UK business opportunity every Thursday - real keyword data, competitor analysis, builder prompts. See the latest free report.

Frequently asked

Should I buy a Pi 5 8GB or a Pi 4 8GB for Claude Code?

Pi 5. The Pi 5 is about 2-3x faster in real-world workloads, has PCIe 2.0 for NVMe storage which removes the SD-card-reliability problem, and is the active Raspberry Pi Foundation line. The Pi 4 8GB still works fine for a single Claude Code worker but the price gap is tiny in 2026 (Pi 5 8GB at The Pi Hut is around GBP 80, Pi 4 8GB around GBP 70). For an indie hacker the Pi 5 is the right answer 90% of the time. The only reason to buy a Pi 4 is if you found one second-hand cheap and you do not care about NVMe.

What is the ARM64 OAuth gotcha?

Claude Code uses an OAuth flow that defaults to opening a browser tab on the host machine. On a headless ARM64 Raspberry Pi with no display server, that flow fails - the GitHub issue is anthropics/claude-code #27405. The workaround is to run `claude setup-token` which generates a 1-year OAuth token on a machine with a browser (your laptop), then export that token to the Pi via SSH. The token survives 12 months and the agent runs headless. The flow takes about 5 minutes once you know it exists. Anthropic has acknowledged the issue and the fix is on the roadmap but the workaround is solid.

What does the electricity actually cost?

A Pi 5 8GB idles at about 3W and peaks at 10W under load. Average across a day of mixed agent work is roughly 5W. At the UK 2026 average electricity price of about 28-30p/kWh (Ofgem cap), that is 24 hours * 5W = 120 Wh per day = 0.12 kWh per day = about 3.5p per day of electricity. Roughly GBP 1.05 per month, GBP 13 per year. Compared to the GBP 3.30/mo Hetzner box at GBP 40 per year, the Pi pays back its hardware cost in about 3 years on electricity savings alone.

Can I run a public webhook on the Pi from behind my home router?

Yes, but it adds complexity. The two clean options are Cloudflare Tunnel (free tier, no router config, gives you a public hostname for free) or Tailscale Funnel (free for personal use, similar pattern). Both run a small daemon on the Pi that establishes an outbound connection to the provider, then routes inbound public traffic back through it. No port forwarding, no dynamic DNS, no static IP needed from your ISP. For a UK indie hacker on a typical home broadband connection, Cloudflare Tunnel is the path of least resistance. The Hetzner box wins for production-grade webhook reliability because you skip the home-network variable entirely.

Will an SD card kill the Pi long-term?

Yes, if you write a lot of logs. A consumer SD card lasts roughly 12-18 months under heavy logging before write errors start. The fix is an NVMe HAT and a small SSD - the Pi 5 has PCIe support and an NVMe HAT plus a 256GB SSD costs around GBP 30 at The Pi Hut. This buys you the same effective lifespan as a normal server SSD. Or, log to journalctl with aggressive rotation (the default `Storage=persistent` mode plus `SystemMaxUse=200M`) so the SD card sees very little write traffic. Either approach works. The plain SD card setup is fine for a year of evening tinkering; serious always-on use justifies the GBP 30 NVMe upgrade.

Related reading

More UK-focused guides from the IdeaStack blog.

Error tracking for your live v1 (UK SaaS, Claude Code 2026)

Error tracking for your live v1 (UK SaaS, Claude Code 2026)

Your v1 is live, three founding members are using it, and the next outage is a question of when, not if. This is the right-sized observability layer for a brand-new UK SaaS: the three things actually worth watching, how to wire error tracking and a money-path alarm into a Next.js app with Claude Code in one session, source maps so a stack trace points at real code, a simple uptime ping, and the discipline to stop there instead of building enterprise monitoring for three customers.

Read more →

Your first feature build session after launch (UK SaaS, Claude Code 2026)

Your first feature build session after launch (UK SaaS, Claude Code 2026)

Your v1 is live and three founding members are using it. The feedback is rolling in faster than you can build. This is the UK indie hacker guide to your first feature build session after launch: how to read founding feedback for the one signal that matters, pick the single feature that removes the most friction, scope it to one Claude Code session, build and test it against the money path, and ship it the same day with a 'you asked for this' note that turns a paying founder into an evangelist.

Read more →

Ship your v1 to founding members (UK SaaS, Claude Code 2026)

Ship your v1 to founding members (UK SaaS, Claude Code 2026)

Scaffold done, auth and billing wired. Now you ship the v1 to the founding members who already paid. This is the UK indie hacker go-live checklist: the pre-launch checks that stop launch day going sideways, how to onboard three pre-paid founders by hand, the feedback loop that tells you what to build next, and the first iteration cadence that turns a founding cohort into retained, paying customers instead of three refunds.

Read more →

Supabase auth + Stripe billing for a UK SaaS (Claude Code, 2026)

Supabase auth + Stripe billing for a UK SaaS (Claude Code, 2026)

Your skeleton is live. Now your founding members need two things: a way to log in and a way to keep paying you. This is the UK indie hacker walkthrough for wiring Supabase auth and Stripe subscriptions with Claude Code - the auth flow, the subscription model, the one webhook that actually matters, and the UK-specific decision every US tutorial skips: do you take payments through Stripe directly and own your VAT, or go through a Merchant of Record like Paddle and hand the VAT headache away?

Read more →

Scaffold your validated v1 with Claude Code (UK, 2026)

Scaffold your validated v1 with Claude Code (UK, 2026)

You did the hard part. You ran the smoke test, made the Mom Test calls, and three founding members have already paid. Now you have to build the thing. This is the UK indie hacker walkthrough for turning a validated idea into a working app skeleton in a single Claude Code session: the PRD that anchors every decision, the CLAUDE.md that keeps the agent honest, plan mode before any code, the first five files, and why you deploy to Vercel on day one before you have a single feature.

Read more →

The newsletter

One UK business idea, every Thursday

By Tim Bland. Free.