I've recently had to switch my phone because the battery died, and I'm curious about using it as a small server, similar to how one might use a Raspberry Pi. I'm not planning on running anything major; it's more for personal learning as a homelab. I came across various articles and videos discussing the use of Termux, but I'm interested in doing something a bit more genuine. I see my phone as essentially an ARM computer, and I'm wondering if that thought process makes sense?
7 Answers
I can vouch for Termux! It's a great way to have a Linux-like environment on your phone, and you can even install various other distros from it. Check out the proot distro list for options!
For a lot of smartphones, using Termux might be your best bet for running Linux-like commands and apps. If you want a more complete Linux experience, though, some phones support Ubuntu Touch—what model do you have?
There’s a ton of resources out there to help with this. I found a good resource page that I suggest checking out. And remember—always back up your data, play around in a virtual machine first, and make sure you understand commands before hitting enter!
I know a guy who got a PinePhone and ended up leaving it because of usability issues. He’s a hardcore Linux fan, so if it didn't work out for him, I can see it being tough for average users.
Interestingly, someone managed to get Docker running on Android, albeit unofficially. This could be a cool avenue to explore if you're tinkering with a home server!
You definitely can, but it depends on your willingness to deal with potential issues. I've used third-party OS on a couple of devices, and while it was fun to clean out unwanted apps, it took a lot of troubleshooting and effort.
In theory, yes, you can install Linux on a smartphone using alternatives like postmarketOS. However, actually doing it on your specific device might not be feasible. The chance of making it work isn't very high, and even if you did manage it, it might not be the best experience.
True, Android is based on a modified Linux kernel with a lot of customization. If only there were more straightforward ways to install AOSP on various devices, we could see some interesting developments.

You won't get a better guy than this, seriously.