Smartphone Runs Home Server

It’s one of the great tragedies of our technological era. Smartphones that feature an incredible amount of computational power compared to computers the past, are largely locked down by carriers or manufacturers, dooming them to performing trivial tasks far below their true capabilities.

But there is hope. In part one of this build, a OnePlus 6T is stripped of its Android operating system in favor of postmarketOS, a Linux distribution based on Alpine designed for a number of Android phones and tablets as well as some Linux-only handhelds. The guide also demonstrates how to remove the battery and use a modified USB-C cable to essentially trick the battery management system into powering up the phone anyway. The second part of the project dives into the software side, getting the Linux system up and running before installing Docker and whichever Docker containers the user needs.

There are a few downsides to running a server from a smartphone. Although there’s plenty of processing power available for a wide range of applications, most phones won’t have Ethernet support out-of-the-box which forces the use of WiFi. There’s also limited storage options available, so a large NAS system may be out of reach. But for something like a home automation system or a music streaming server this could put plenty of older devices to work again. And if you don’t want to hunt for an Android phone that isn’t completely hobbled out-of-the box you might want to try a phone that’s Linux-based from the get-go instead.

Thanks to [JohnU] for the tip!

21 thoughts on “Smartphone Runs Home Server

  1. Back in the early 2010s, I used to root every new smartphone I bought, put a debian image in a file (on my desktop using debootstrap), put it and mounted it on my smartphone and chroot into it

    I had a debian installation that was shockingly good. I could even use an OTG cable to connect an usbasp and program AVRs from my smartphone

    1. But even in 2010s, the vast majority of Android hardware was unfree, undocumented and lacked the love of its vendors once it was thrown on the market.
      The situation hasn’t changed much. There is slightly better Linux mainline support, but without open drivers or at least openly accessible documentation, the hardware becomes garbage when either the manufacturer or Google decides.

  2. Sounds like people on here might be interested in the Furilabs FLX1. Its a halium/hybris phone, so essentially it runs linux with a translation layer to android system calls.

    This allows you to have and fully use modern well designed chipsets with all hardware working (lets be honest pine stuff is fine for tinkering but not as a phone due to countless issues), while still having full linux.

    SailfishOS is probably the better known halium/hybris phone linux, and I used a community version for years. With current VoLTE requirements you would need a supported SFOS EU phone which can be hard to find.

    The FLX1 also supports VoLTE (and 5G) and can be easily purchased. I ended up grabbing one in September before US VoLTE bands were supported. US bands dropped Oct.

    Overall I am incredibly happy with it. There is integrated Android app support, but since it is using basically droidian there are a huge amount of native linux programs (something SFOS struggled with).

    Took a bit of patching due to an Osmocom rtl-sdr package bug and kernel issue, but I even got native rtlsdr support, with gqrx, rtl_433, dump1090 and other programs completely working and functional.

    Thats not to say there aren’t still things to be ironed out, but I am very excited about this phone.

      1. The purists won’t like the halium/hybris aspect but yes imo it is the best middle ground for a functional and usable Linux with decent hardware. I’m not at all a hardware snob either.

        Gotta say SailfishOS has by far the best gesture navigation, I wish Furi would implement it. But that is a quibble (trace typing with squeekboard would be more important)

    1. This still has many of the same issue mentioned in the article. It’s running a downstream kernel with millions of additional lines of Mediatek BSP code, proprietary userspace drivers in the form of Android HALs, and doesn’t support standard Linux interfaces like DRM.

  3. Cool project, but I’m not convinced about going batteryless. Seems like an unnecessarily risky procedure to me, better to limit the charging to somewhere about 60% max and have the advantage of a free UPS built in.

    I don’t know how easy that would be with PostmarketOS, but I did run Home Assistant in Termux on an old android phone for a while (I wouldn’t reccommend it). I too didn’t like the idea of just leaving it on charge under it’s normal regime, so I rooted the phone and installed something (can’t remember exactly what) to solve this. It stayed plugged in, keeping the battery between 50-60% over a few hour cycle, never got hot (measured and graphed, not anecdotally) and when I gave up after a year or more and migrated Home Assistant to a Pi the battery life didn’t appear to have degraded in any significant way.

    P.S. the reason I wouldn’t reccommend running a Home Assistant server this way is it was a PITA. Installation was a nightmare, I had to schedule a reboot every night as memory usage would eventually crash Termux, updating was frought with danger frequently requiring low level manual intervention and it couldn’t use addons. On the other hand the price was right (free!), I didn’t have a spare Pi and initally I enjoyed the challenge.

  4. Using PostmarketOs on Redmi Note 4, and working as expected. Using docker for deploying applications.

    But home assistant not working, getting some error. If anyone using HA on PostmarketOs, please reply

  5. Seems like an awful lot of steps when one can simply install Termux and type “pkg install docker”. That’s how I ran stuff like WordPress (lamp) on an S6. For ethernet; most docks have a connection.

    Same results, no destruction/modifications, probably cheaper.

    I guess I’m missing the point of the article….

  6. Seems to me like there’s a surprising amount of Missing the Point here.

    The phone isn’t a great Linux server, a Pi or a refurbed ThinkCentre would do just fine for that at minimal cost.

    The phone isn’t cheap if you buy it for that purpose.

    But I and everyone I know has a drawer with a small stack of phones that for one reason or another were no longer suitable to be our daily driver, either due to age, minor malfunction or simply not being up-to-date/supported anymore. Pulling one of those out of the drawer and pressing it into service as a server is a great option for a teenager looking to futz with Docker and not bad if you wanted to run home-assistant but can’t justify buying anything for it yet.

    I’ve had many times in my life where spending even $1 on an idea was out of the question for various reason, but if I had a way to make something I already had do the work then I could proceed. This is that, and it’s very in line with Hackaday for tha reason.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.