Install Docker natively on Android Phone and use it as a Home Server (crackoverflow.com)
from yogthos@lemmy.ml to technology@lemmy.ml on 06 Dec 2024 16:25
https://lemmy.ml/post/23287425

#technology

threaded - newest

yogthos@lemmy.ml on 06 Dec 2024 16:35 next collapse

The guide mentions that the phone doesn’t have a wired connection, but couldn’t you just plug in an external USB ethernet adapter. Would be curious if anybody has tried this.

In general, I really find that this is an underappreciated use for old phones. There’s an advantage over using something like RPI since you have a touchscreen built in, making it much easier to troubleshoot without having to plug in a monitor and a keyboard. Meanwhile, the battery can act as a built in UPS. Given how abundant old phones are, seems like it would be cool to make an Android distro specifically designed for this use case. Especially if you could plug in a USB hub for stuff like external storage. This could be a home server, music player, etc.

SnotFlickerman@lemmy.blahaj.zone on 06 Dec 2024 16:56 next collapse

The main suggestion I would have in regards to using the battery as a UPS:

If you want the battery to last a long time, you need to figure out how long it takes for it to charge and discharge, and set up an outlet timer (either a manual one or a zigbee operated one) so that the outlet the phone is plugged into turns on just long enough for the battery to charge, and then turns off just long enough for it to discharge, with the aim to keep it in the 30% to 80% charged range.

Otherwise you’re just always charging the battery and significantly reducing it’s life and ability to be a UPS.

www.amazon.com/…/B01LPSGBZS

I just use these, I have a few old phones set up as a surveillance system. I’ve never tried an external ethernet dongle because unless you search for a special connector cable, you can’t charge the phone and have it plugged into ethernet at the same time.

yogthos@lemmy.ml on 06 Dec 2024 17:08 next collapse

Oh yeah good point with the battery cycling.

Damage@feddit.it on 06 Dec 2024 21:40 collapse

If you’re selfhosting stuff, you easily host Home Assistant, install the app on the phone, and use the battery sensor from the app to turn on and off a smart plug.

egonallanon@lemm.ee on 06 Dec 2024 18:55 next collapse

Generally speaking I find USB hubs with ports on them work pretty well with android as they’re just relying on the Linux kernel drivers for the USB support.

yogthos@lemmy.ml on 06 Dec 2024 19:19 collapse

That’s what I expected, gonna have to play around with an old phone I’ve got lying around.

egonallanon@lemm.ee on 06 Dec 2024 20:25 next collapse

At a functional level I can’t see any reason why it wouldn’t work. Though my preffered method for that has always been old desktops over phones as it gives a lot more flexibility overall.

yogthos@lemmy.ml on 06 Dec 2024 20:29 next collapse

I just tried and my hub allows powering the phone while plugging a drive in. I haven’t tried a USB network card though. I agree old desktops or laptops work also work pretty well. It just bothers me how. old phones are fully fledged computers in a really nice small package, and there’s no easy way to make them useful.

hitmyspot@aussie.zone on 07 Dec 2024 01:18 collapse

Power wise, and backup battery, wouldn’t a phone be better?

egonallanon@lemm.ee on 09 Dec 2024 13:54 collapse

If those are important to you yes but the old desktop route generally means you’ll get access to more powerful chips plus the ability to add more storage and memory.

SnotFlickerman@lemmy.blahaj.zone on 06 Dec 2024 21:08 collapse

If that’s the case then I bet this would work with older phones using microusb

www.amazon.com/…/B01JL837X8

Since it claims to be built for a Raspberry Pi. All my older devices are still microusb.

yogthos@lemmy.ml on 06 Dec 2024 21:23 collapse

yeah that should work

flambonkscious@sh.itjust.works on 07 Dec 2024 19:08 next collapse

At first I thought you were insane but I’m slowly coming around to the idea.

Too bad the screen breaking is usually why mine get replaced

yogthos@lemmy.ml on 07 Dec 2024 21:08 collapse

There are just so many of them floating around now, and it feels like such a waste not to use them for anything.

flambonkscious@sh.itjust.works on 07 Dec 2024 21:12 collapse

I take it you had to flash the particular rom to install docker (it would work natively on android?)

yogthos@lemmy.ml on 07 Dec 2024 22:21 collapse

yeah you need a custom rom to run Docker

Dragon@lemmy.ml on 07 Dec 2024 23:31 collapse

I have successfully plugged my android into an Ethernet-usbc adapter, yes. A special Ethernet icon actually pops up in my icon bar when it’s using that connection.

yogthos@lemmy.ml on 07 Dec 2024 23:35 collapse

oh nice!

Kekzkrieger@feddit.org on 06 Dec 2024 16:41 next collapse

Shit side with half the article used by ads no thank you.

yogthos@lemmy.ml on 06 Dec 2024 16:54 next collapse

It’s amazing to see that there are still people lacking basic technical knowledge to use ad blockers, even in the year 2024.

infeeeee@lemm.ee on 06 Dec 2024 17:12 collapse

And you generate traffic for them, thanks. You could just directly link to the install docs on PostmarketOS, not for a shitty third party site: postmarketos.org/install/

yogthos@lemmy.ml on 06 Dec 2024 17:41 collapse

The article talks the idea of recycling a phone to use as a home server, which is what I found interesting. Also, if you spend your time worrying what sites you generate traffic for maybe rethink your life.

davel@lemmy.ml on 06 Dec 2024 21:31 collapse

A lot of liberals are big believers in the power of consumers voting with their dollar/attention.

Ben Burgis: “Voting With Your Dollars” Is an Antidemocratic Illusion

yogthos@lemmy.ml on 06 Dec 2024 22:03 collapse

Indeed, libs always think they can vote their way out of systemic problems.

jagermo@feddit.org on 06 Dec 2024 18:03 collapse

Get a pi hole. I see no ads.

hitmyspot@aussie.zone on 07 Dec 2024 01:15 collapse

Use this article to set up an old phone as a pihoke, so you can then see this article with no ads.

SnotFlickerman@lemmy.blahaj.zone on 06 Dec 2024 16:52 next collapse

Requires PostmarketOS which only has less than 30 phones it’s available for, many of which are very old (Samsung Galaxy S III??? Where would you even find one of these anymore?) and out of the list of less-than-thirty at least five of them don’t offer full support, only partial.

The newest Pixel phone you can use is a Pixel 3a.

Yeah I think I’ll pass on something that requires PostmarketOS.

infeeeee@lemm.ee on 06 Dec 2024 17:10 next collapse

Yes, title is very misleading. For the curious here is the list of currently supported phones: wiki.postmarketos.org/wiki/Devices#Phones

You could write a similar article: How to install docker on your microwave oven: Step one, install a linux distro on your microwave…

Nonetheless PMOS is genial, I installed it on my Kobo ebook reader.

SnotFlickerman@lemmy.blahaj.zone on 06 Dec 2024 17:12 collapse

For sure, this isn’t against PostmarketOS. PMOS is fine. It’s rather if I’m trying to set up Docker on a phone, I’d rather find a way that’s… less limiting on what hardware can be used.

yogthos@lemmy.ml on 06 Dec 2024 17:39 collapse

I mean it’s pretty easy to extrapolate from the article how to do it with any OS that can run Docker. It’s the idea of recycling the phone as a server that’s useful not the specific OS they used in the tutorial.

uninvitedguest@lemmy.ca on 06 Dec 2024 17:48 next collapse

Goodness I actually have a pixel 3a kicking around.

Now if only I could find a use for my galaxy s8 besides glorified webcam.

catloaf@lemm.ee on 06 Dec 2024 17:49 collapse

I think they are intentionally targeting old devices so that they remain useful.

Luffy879@lemmy.ml on 07 Dec 2024 21:35 collapse

I think commenter is not mad at postmarketOS itself, but the article making it look like you can 1) use docker on Android (at least thats what Android Smartphone infers) and 2) that you can use it with devices such as the pretty new oneplus 6t

PanArab@lemmy.ml on 06 Dec 2024 17:15 collapse

Why?

testman@lemmy.ml on 06 Dec 2024 17:23 next collapse

prevent e-waste
or maybe as a first step into self-hosting for someone who has no access to more suitable hardware

pupbiru@aussie.zone on 08 Dec 2024 14:03 collapse

at the very least it’s probably about as good as a pi, but for free… and has a built-in UPS and backup internet connection… could be actually very helpful for reporting system status through power outages etc - perhaps even use the camera as a remote view of the systems