What’s the best way to run Linux on an old Android phone?
Asked by
MellowCedar42
I have an older Android phone that I'd like to repurpose for a small homelab project. Ideally, I want to control it over SSH, run a simple shell script, and display data pulled from an API. I've seen people install Debian or Arch on phones, but it looks like they often run inside Android through a container or dedicated app. Would something like that be suitable for this use case, or is it practical to completely replace Android and use the phone like a small Linux computer?
Answers
Termux is probably the easiest option for this project. It runs on Android and gives you a useful Linux-style terminal environment where you can install packages, run shell scripts, use SSH, and fetch API data. For a lightweight homelab task, you likely don’t need to replace Android at all.
Reply to this answer
A full Linux installation is possible on some phones, but replacing Android usually requires unlocking the bootloader, finding compatible device support, and possibly dealing with hardware drivers. It’s much more involved than installing a normal desktop distribution on a PC. Rooting or otherwise modifying the Android system may be necessary, depending on what you want to run.
Reply to this answer
You could investigate mobile Linux distributions such as Droidian, Ubuntu Touch, Mobian, or postmarketOS. Their practicality depends heavily on the exact phone model. Droidian and Ubuntu Touch commonly rely on the Android hardware layer, while Mobian and postmarketOS aim for more mainline Linux support. Check each project’s supported-device list before attempting anything.
Reply to this answer
Add your answer
Answers are reviewed before publication.
AmberKite56: LineageOS is another possibility if the phone is supported. It would still be Android-based, but it can provide a newer or cleaner base for running tools such as Termux.