I have an old Android that barely gets any use. I charge it, it drains on its own, dies, then I charge it again, repeat. So since I had already rooted it before, I figured I’d turn it into a mini homelab. This old phone is from way back, with only 4GB of RAM and 64GB of storage (lol), but interestingly it has an 8-core CPU. So roughly speaking, the software I needed had to meet these criteria:
- Single binary, and the package release supports aarch64/arm64. Why single binary? Obviously to save RAM. On top of that, running containers like Docker or Podman requires compiling your own kernel (way too much hassle). There’s technically a way using QEMU if you want to run Docker, but if there’s an easier path, why not take it?
- If no prebuilt release exists, is it a single binary? If yes, I’d need to test by compiling it myself.
- Golang binary (Rust or C/C++ would work too but those are absolute last resort) when the context is compiling from source. It’s fast, and why bother with the trial and error when I can just find another alternative?
- Since this is a “mini homelab”, I’m avoiding services I use daily, like Git or anything where downtime would actually hurt. Why? Because Android can kill processes or force close apps when things get heavy.
- Nothing that overlaps with what I already have installed on my main server.
With those criteria in mind, there are actually a ton of Go-based software options on awesome-selfhosted, and from those I ended up picking:
- Memos. A Go and React web app that runs as a lightweight single binary, stores notes in Markdown format with SQLite as the database option. This is my favorite one, and I’ve been wanting to self-host it for a while.
- Fusion. An RSS reader built with Go and TypeScript that runs as a single binary, supports RSS/Atom feeds with Fever API compatibility. I’ve also been wanting an RSS reader for a long time since I was only using Glance for that before, so I decided to throw this in too.
- Shiori. A Go-based bookmark manager that runs as a single binary and automatically creates offline archives of saved web pages. I had Linkding installed on my server before but eventually uninstalled it. After thinking it over though, I realized I actually do need a bookmark manager. But Linkding is Python-based, and here I wanted a single binary, so Shiori became my bookmark manager.
- WatchYourLAN. A Go-based network IP scanner that monitors devices on your LAN via ARP scan, complete with notifications. Don’t forget to watch your perimeter. The scariest attacks sometimes come from the inside.
- Wastebin. A self-hosted pastebin built in Rust with SQLite, supports ChaCha20Poly1305 encryption, syntax highlighting for 170+ languages, and options for burn-after-reading or auto-expiring pastes. I often write random snippets I want to share with people, so yeah, I figured I’d probably need this.
Now how do I make all of these publicly accessible? Cloudflared Tunnel is the answer. Sometimes, for whatever reason, my Termux or my phone gets weird DNS errors. So I need termux-chroot and editing /etc/resolv.conf to get around that. Then I set up termux-services so everything runs stably in the background. And of course I wrote a termux-boot script so all the services I need start up automatically on reboot. Throw in termux-wake-lock and sshd as well.
The main concern is probably the battery, but I’ve actually already handled that by installing the AAC module in Magisk. So that’s mostly under control. The second issue is Android’s habit of killing processes. To keep Termux running, I had to do the following:
- Termux wake lock. This is an Android mechanism that prevents the CPU from going to sleep when the screen is off, so processes in Termux keep running in the background without getting interrupted. Enabling this in the boot script is a perfect combo.
- Set Battery Optimization to “Unrestricted”. Android has an aggressive Doze feature that kills background apps that consume battery. We have to exclude Termux from that list.
- Disable the phantom process killer. Since my Termux setup definitely runs a lot of processes, the system would probably kill them frequently. Since I have root, I can just remove that limit with
device_config put activity_manager max_phantom_processes 2147483647andsettings put global settings_enable_monitor_phantom_procs false.
With all that, I can turn my old phone into a mini homelab running 24/7! Does that mean every problem is solved? Nope, I still have another issue which is storage. At first I wanted to mount with rclone, but I ran into the same problem as this thread, where rclone needs FUSE and I kept trying to work around it but kept failing. So I switched to sshfs and it works perfectly! I basically got extra storage from my main server haha. The other issue is that Termux will force close under OOM conditions. Well, that’s understandable. Which is exactly why I need to stick with lightweight services only.
And since lately I’ve also been feeling nostalgic wanting to play the childhood games I used to play back in the day, I decided to build a retro game library as a lightweight binary in Go. Using databases from no-intro, thumbnails from libretro, and the engine from emulatorjs. And they all run perfectly in Termux! Well, minus the storage thing again. Too many ROMs means I need extra storage. Is it open source? Maybe if someone’s interested. It’s like Genofé, a personal app I threw together quickly because I really needed it, didn’t audit the security at all, just needed it to work. I’m afraid there might be bugs everywhere.
Haha, this homelab hobby has once again completely wrecked my ability to manage time between work and personal projects. I still haven’t had a chance to finish studying the Planck equation. I’m worried I’ll have to start all over from the beginning. Oh well, I’ll treat it as a little break since I’m currently trying to finish Castlevania from the very first game in the series :)