Four web apps, their database, the AI service they share and the tunnel that carries their traffic all run on one old Android phone in my house. A comparable 4 GB cloud server would cost about ₹2,000 a month; the phone costs roughly ₹10 in electricity. The server section of this site shows it live. This post is about the software that makes it manageable: Backseat.
the pieces
phone · termux ├─ backseat agent supervises everything below │ ├─ 4 web apps three next.js, one static site │ ├─ assistant shared AI service │ ├─ pocketbase one database for all apps │ └─ cloudflared ──tunnel──▶ cloudflare ◀── you └─ termux:boot brings it all back after a reboot
Termux gives the phone a real Linux userland without rooting it. Termux:Boot starts the agent when the phone boots and takes a wake lock so Android doesn't put the CPU to sleep. Cloudflare's tunnel dials out from the phone, so there are no open ports, no port forwarding and no home IP in DNS.
the agent on the phone
backseat-agent is a small Flask service. Its main job is keeping apps alive:
- Supervision. Each app is a command and a folder, saved to disk. If a process dies, it's restarted with exponential backoff (2, 4, 8… up to 60 seconds), so a crash loop can't pin the CPU. Once an app has stayed up, its restart counter resets.
- Logs. Every app's output is captured and readable from the laptop.
- Tunnel awareness. It finds the running named tunnel and knows which hostnames it serves.
- Pairing. On first start it prints a QR code and an 8-character code. The laptop trades that for a session token, which both sides keep, so a restart doesn't need re-pairing. Anything that changes state needs that token.
- A public, read-only view. /public/status shows load, battery and each app's state, and nothing else: no commands, paths, ports, process IDs or logs. That's what the live dashboard ↗ and this site read.
the laptop side
The backseat CLI talks to the agent over the local network: pair, list apps, start, stop, restart, tail logs, manage the tunnel, and reach the phone when I'm not home. The phone never builds anything. It only runs what the laptop sends it.
deploys that check themselves
On top of Backseat sits a deploy script with guardrails. It only ships code that's merged and tagged with CI green, builds it from a clean checkout, and checks the phone's battery, disk and dependencies first. It swaps the new build in beside the old one, then has to prove itself: a fresh process, every key page on the phone and through Cloudflare, a real demo sandbox with sign-in, and 20 seconds without a restart. If anything fails, the previous build goes back automatically and is tested again.
what android makes you learn
- It wants to sleep. A wake lock and unrestricted battery settings fixed background apps being paused.
- Symlinks. Node on Termux couldn't follow absolute links under /data/data, so every page that touched storage failed. Relative links fixed it, and the deploy now recreates them itself.
- Native modules. Image processing uses sharp's WebAssembly build, because its native one doesn't build on Android.
- Memory. Builds happen on the laptop; the phone only runs things.
- It's one device. Wi-Fi drops fall back to mobile data and the tunnel reconnects, and the battery covers a few hours of power cut. But if the phone itself dies, everything goes with it.
should you?
For side projects, demos and learning how servers actually behave, yes. It's cheap, and it teaches you process supervision, networking and deploy safety in a way a managed platform hides. For anything with an SLA, no.
Backseat is open source on github ↗.