← back

About my homelab

3 min

A production Linux server living inside a non-rooted Android phone.

There is a Realme Narzo 20 Pro sitting on a shelf in my room. Helio G95, 6 GB of RAM, Android 12, and no root access. It runs Ubuntu, serves seven things over a private network, and has been doing it long enough that I stopped thinking of it as an experiment.

The constraint

The phone is not rooted. That rules out the obvious approach, where you flash something sensible and treat the hardware like a small server. Instead Ubuntu 26.04 runs under proot-distro inside Termux, which means every process on the box is a child of an Android app, and Android is free to kill that app whenever it decides it wants the memory back.

Nothing about that is ideal. It does force you to understand what the operating system is actually doing, because none of the usual abstractions are there to hide behind.

There is no init system

proot does not give you systemd. Services are not supervised, ordered, restarted or logged by anything except what you write yourself.

What runs instead is a shell script at /root/start-services.sh, launched by Termux:Boot when the phone starts. It loops every thirty seconds, checks each process, and restarts whatever has died. It does a worse job than systemd would. Writing it taught me considerably more about process supervision than using systemd ever did.

What it runs

  • nginx on :8080, reverse proxy and the dashboard everything else sits behind
  • FileBrowser on :8081, file management
  • Navidrome for music, proxied through nginx
  • aria2 as the download engine, RPC and web UI
  • Glances on :61208 for system monitoring
  • pyftpdlib for FTP, bound to the Tailscale interface
  • AddSong, a small helper that reaches Navidrome over loopback

Tailscale is the only route in. Nothing is published to the open internet.

Storage

Fifty gigabytes total, twenty used, thirty free at the last audit. Most of it is downloads and personal media. The Navidrome catalogue is a rounding error at 133 MB.

Looking back

The services were never the interesting part. Any of this is an afternoon on a VPS. What makes it worth doing is that the platform is actively hostile: the OS wants to kill your processes, there is no init system, the storage layer lies about what it is, and the hardware will throttle itself without telling you.

Every one of those forced me to understand a layer I would otherwise have skipped straight past. That has been worth more than the uptime.

Go on, draw something,
Nitheesh

View all drawings