guide

Deploy Your Vibe-Coded App on a Raspberry Pi

How to deploy a vibe-coded app on a Raspberry Pi 5 — a ~$200 always-on home server with a public URL, no port-forwarding, no monthly cloud bill.

Caleb NorthBy Caleb North · The ship-it engineerJune 7, 2026
Verified June 2026
Drafted by Opus 4.8

Caleb North is a fictional AI persona, not a real person. This article was written by AI and reviewed by a human editor before publishing. How we work →

Deploy Your Vibe-Coded App on a Raspberry Pi

As an Amazon Associate, StackBrief earns from qualifying purchases.

You pointed an AI coding tool at an idea and it built you a working Node or Next.js app. Now it lives on your laptop, dies when you close the lid, and nobody else can see it. The usual next step is Vercel — and that's genuinely the easiest path; we wrote it up in Deploy Your First App with Vercel and Claude Code. But if you'd rather own the box, learn a little infrastructure, and never see a hosting bill, a Raspberry Pi 5 turns into a tidy always-on home server for around $200.

This is a deploy guide, not a "run AI on a Pi" guide. The Pi hosts the app your AI tool wrote — it does not run the model that wrote it (more on that below). With that straight, here's exactly what to buy and how to get a public URL.

A quick reality check on Pi prices in 2026

Buy with eyes open: Pi 5 prices are unusually high right now. A DRAM shortage pushed LPDDR4 costs up roughly 7x year-over-year, so the 8GB sits around $175 (it launched at $80) and the 16GB is up near $305. That matters for one decision: don't buy the 16GB to deploy an app. The extra RAM only pays off for running a model, which the Pi can't do well anyway. For hosting, 4GB or 8GB is the right call, and the premium tier is just wasted money.

Which Pi: 4GB or 8GB?

This is the only real choice, and it comes down to what you're hosting.

| | Pi 5 4GB | Pi 5 8GB | |---|---|---| | Price (2026) | ~$80 | ~$140–175 | | Best for | One small low-traffic app | App + Docker + a database | | Headroom | One Node/Next.js process | Multiple containers, heavier DB | | Verdict | Budget hobby pick | Safer 24/7 server pick |

The Raspberry Pi 5 (8GB) is the sweet spot for an always-on server. 8GB comfortably runs the Node runtime plus a small SQLite or Postgres database and Docker with headroom — that's the configuration most vibe-coded apps end up in. Same quad-core Cortex-A76 at 2.4GHz, PCIe for NVMe, Gigabit Ethernet and dual-band Wi-Fi.

If you're only hosting one small app and watching every dollar, the Raspberry Pi 5 (4GB) handles a single Node/Next.js process behind a tunnel just fine. It's the same board with the same I/O — only step up to 8GB when you know you'll run multiple containers or a heavier database alongside the app.

The two accessories you can't skip

A 24/7 server isn't a desk gadget — it needs stable power and cooling, or it'll quietly throttle and brown out on you.

Get the Official Raspberry Pi 27W USB-C Power Supply. The Pi 5 specifically wants this 5.1V/5A PD supply to deliver full current to the USB ports and an attached SSD without under-voltage throttling. A random phone charger will cause exactly the kind of intermittent gremlins you don't want on a box you're not watching.

Then add the Official Raspberry Pi 5 Active Cooler. The Pi 5 throttles under sustained load without active cooling, and a server runs hot around the clock. The official cooler is a heatsink plus a temperature-controlled fan that clips to the board and plugs into the 4-pin header — about $5–10 of cheap insurance that keeps your app responsive overnight instead of crawling at half clocks.

Storage: skip the flaky SD card

This is the upgrade that makes a Pi feel like a real server. microSD cards wear out fast under the constant database and log writes a 24/7 app generates, and their random I/O is slow — exactly the workload a server stresses.

The fix is NVMe. The Raspberry Pi M.2 HAT+ connects to the Pi 5's PCIe connector and takes an M-key NVMe drive in the 2230 or 2242 form factor. Pair it with a small NVMe SSD (2230/2242) — 256GB is plenty for the app, its database, and Docker images. On the Pi 5's PCIe 2.0 you'll see roughly 400–900 MB/s versus 20–90 MB/s on microSD, up to ~10x faster and far better at the random I/O an app actually leans on. One counterintuitive tip: a budget DRAM-less drive (WD Green or Kingston NV2 class) is often more reliable on the Pi than some premium SSDs, so you don't need to overspend here.

Not ready to commit? A high-endurance high-endurance microSD card (A2-rated, built for continuous writes) boots the Pi and runs a light app for $10–15. Expect slower I/O and a shorter lifespan under constant server writes — fine to start, plan to migrate to NVMe if the app earns it.

The deploy path, start to finish

Once the hardware's together, going live is four steps:

  1. Flash the OS. Use Raspberry Pi Imager to write Raspberry Pi OS (64-bit) to your NVMe (or SD), enable SSH in the imager settings, and if you went NVMe, set the boot order so the Pi boots from the drive.
  2. Run the app under a process manager. SSH in, install Node, and start your app with PM2 so it restarts automatically on a crash or reboot. Prefer containers? Use Docker / Docker Compose instead — either way, the goal is "comes back up on its own after a power blip."
  3. Expose it with a Cloudflare Tunnel. Install cloudflared, connect it to your Cloudflare account, and point the tunnel at your app's local port. You get an HTTPS public URL with no port-forwarding and no exposed home IP — the safest way to put a home-hosted app on the internet.
  4. Want private-only access? Use Tailscale instead of a tunnel and the app stays reachable only on your own devices — perfect for an internal tool.

That's the whole pipeline. No DNS wrangling at your router, no firewall holes.

Why not just run the AI model on it too?

Because it's slow enough to be useless for real work. A Pi 5 manages roughly 2–8 tokens/second — a 3B model around 5 tok/s, 7B models near 2 tok/s, a small 1B model maybe 18–22 tok/s — which means 5–15 seconds per reply. Fine for poking at Ollama as a curiosity, not for a coding assistant. If running models locally is your actual goal, that's a desktop-GPU job — see Best Hardware to Run Local AI Coding Models and our LM Studio vs Ollama comparison. The Pi's job here is to host the app, not think.

Who this is (and isn't) for

This setup shines for a hobby app, a portfolio piece, an internal tool, or a low-traffic side project on a free domain. Power draw is tiny — a few watts at idle — so 24/7 home hosting costs pennies versus a recurring cloud bill, and you own every part of the stack.

It is not a Vercel replacement at scale: no autoscaling, no global edge, and your uptime is your home internet's uptime. And it's not a box for running AI coding models. Match the tool to the job and it's a great little server.

Bottom line

For about $200 — Pi 5 8GB, official 27W supply, active cooler, M.2 HAT+, and a small NVMe SSD — you get an always-on server that hosts the app your AI tool built, hands you a clean HTTPS URL through a Cloudflare Tunnel, and never sends you an invoice. Drop to a 4GB Pi on a high-endurance card if you want to start cheaper. Skip the 16GB; it's overpriced this year and does nothing for deploying an app. Flash it, run the app under PM2 or Docker, open a tunnel, and you're live.

Frequently asked questions

How much does it cost to deploy an app on a Raspberry Pi?

Budget around $200 for a solid always-on setup in 2026: a Pi 5 8GB (~$140–175), the official 27W power supply (~$12–14), the active cooler (~$5–10), an M.2 HAT+ (~$12–20), and a small NVMe SSD (~$25–45). You can start cheaper — a 4GB Pi (~$80) on a high-endurance microSD (~$10–15) gets a single small app running. Note Pi prices are unusually high in 2026 due to a DRAM shortage.

Can a Raspberry Pi 5 host a Next.js app?

Yes. A Pi 5 comfortably runs a Node or Next.js process 24/7. The 4GB model handles one low-traffic app fine; the 8GB is the safer pick if you also run Docker plus a database. It's great for a hobby, portfolio, or internal tool — just not a replacement for Vercel at real scale.

How do I give my Pi-hosted app a public URL without port-forwarding?

Use a Cloudflare Tunnel. Install cloudflared on the Pi, connect it to your Cloudflare account, and point it at your app's local port. You get an HTTPS public URL with no port-forwarding and no exposed home IP. Tailscale is a good alternative if you only need private access for yourself.

Should I use an SD card or an SSD on a Raspberry Pi server?

For a 24/7 server, prefer NVMe via the M.2 HAT+. NVMe hits ~400–900 MB/s versus 20–90 MB/s for microSD, and it survives constant database and log writes that wear SD cards out. A high-endurance microSD is a fine cheap start, but plan to migrate to NVMe if the app sticks around.

The StackBrief weekly

New reviews and the AI-coding-tool news worth knowing — with our take. One email a week, unsubscribe anytime.

Keep reading