Get the top HN stories in your inbox every day.
anderspitman
renonce
How can a mobile phone's network be as stable as that of a datacenter? Without that stability it's not going to be practically useful.
NoGravitas
Personal sites don't really need the kind of network stability we've come to expect. It would also be nice to see a move to more offline-tolerant networks for a lot of things.
hoosieree
This is the kind of answer our industry needs more of. Chuck Moore would approve.
Q: "How will it handle scaling to millions of users?"
A: "By crashing. But it will handle 100s or maybe even 1000s, and you currently have 3, so chill."
guessbest
You know what is offline-tolerant? NNTP and email.
lloydatkinson
Right, and now the site doesn't even load from the minor traffic from HN.
sk0g
I guess a caching layer could help, like CloudFlare's DDoS protection that still tries to serve a page if a cached version exists.
At that point I'm not sure if it's functionally different to syncing markdown files to something like S3 or GitHub pages.
rollcat
> I guess a caching layer could help
In practice this works only for trivial apps, that have no dynamic content, don't serve large files, don't see a lot of traffic, doesn't come from all over the world (each PoP has a separate cache), etc. CDN caching is opportunistic, most services assume server-grade hardware at the origin that can take some "warmup" load on its own.
Also if you're introducing a third-party CDN/cache, you're already throwing away a whole bunch of reasons for self-hosting in the first place.
cryptonym
Only works if the content is popular in your region and you are only half-self-hosting.
opan
Please (everyone), stop pushing cloudflare on to everyone.
Ajedi32
I would envision something like this being used with an older phone permanently connected to a charger and Wi-Fi or possibly a USB docking station with Ethernet, not running on your personal phone over mobile data. The latter would be terrible for battery life.
undefined
chrnola
I was kicking around a similar idea a few months ago but for a single-user Mastodon instance. Obviously a phone is a huge single point of failure, but there are likely dozens of hobbyist use-cases like this that don’t need strong reliability guarantees.
Volundr
You know, I read this and got exciting thinking "I could build that!". Then I got to thinking about the security implications of running a webserver on a personal phone exposed to the internet.
I think I'll pass.
kibwen
It doesn't need to be a personal phone. If you get a new phone, you could do a factory reset on your old phone and use it as a webserver in this way. And since you aren't taking it with you anywhere, you can leave it at home plugged in and on wifi, for better uptime than your regular phone.
__MatrixMan__
What would be really cool is if we could easily share hosting burden of m sites on n devices.
As an alternative to paying a subscription fee for some service, you could instead just have your hardware do enough compute/storage to offset your usage.
Volundr
You could, but if it's in the app store for the masses to do, most of them won't be, and that's sort of the point of the suggestion here in my mind. Easy self-hosting for the masses with the device they already have.
ilyt
being accessible 24/7 would burn battery like mofo tho.
pier25
> This is essentially my vision of the future of selfhosting
What if you lose connectivity? What if you run out of battery? What if your phone breaks for some reason?
For a blog I really don't see the advantage compared to a free static host.
onion2k
99% of the challenge in running a blog is authoring posts. Serving the content is trivial. If using an app improves writing stuff it's a win.
nologic01
With android termux you can install e.g. django/wagtail and take it from there.
In a sense these projects prove the obvious yet hidden-in-plain-sight: the vast numbers of mobile computing devices that have circulated since the "iPhone moment" could be reconfigured in all sort of ways to be more than a dumb touch screen client for scrolling down social media pages.
If we ever get to see a true open mobile OS there might be a Cambrian explosion of new applications and use cases. Not holding my breath though. The failure of open source mobile to reach a workable stage is now pretty clear. It seems this domain is TITO (too important to open).
chillaranand
I ran small POC as you mentioned earlier and it worked well.
https://avilpage.com/2018/02/deploy-django-web-app-android.h...
fsflover
> If we ever get to see a true open mobile OS
PinePhone and Librem 5 are already here, both running various GNU/Linux flavors.
nologic01
fingers crossed that they get traction but lets face it somehow the economics is stacked against these projects (there was also firefox OS which I once owned and ubuntu touch etc.)
after all the effort of the communities and companies involved, 0.1% adoption of something so differentating as an open source phone is "not normal"
even if you consider this delusional idealism we are not that few :-)
opan
It doesn't need to be popular for you to use it.
Arnt
TITO? Blah.
Lots of phones are open enough to install lots of things on. My daily phone has lineageos (I'm using it), which is an existence proof that you can run a kernel of your choice and userland of your choice, and my previous one had something called treble, which I didn't look into but also involved supplying your own kernel and userland.
If you have the ability to run a kernel and userland of your choice, what can't you do? I know something you can't do: applications that require much electric power. And something else: applications that require many people (or even everyone) to run the same software. But really, if there were to be some sort of cambrian explosion it ought to show up on my daily phone or one of the many similar ones.
Shared404
> which is an existence proof that you can run a kernel of your choice and userland of your choice
Isn't LineageOS dependent on the original kernel of the phone for blobs? My understanding is that the device specific downloadable versions have just already had that RE work done for you instead of requiring you to do it.
nologic01
you need critical mass for things to happen. for critical mass you need a reasonably open migration channel. for that you need a combination of device manufacturers and open source communities to make it easy to drift in and out from this space (the dual-boot equivalent)
Arnt
So... we need critical mass without early adopters, because the things to invent will be created only after critical mass is reached? I think you're just inventing excuses: "There would be a Cambrian explosion of new uses cases, were it not for (excuse goes here)".
invig
<3
So many possibilities have been crushed.
k_bx
It's actually a great idea in some ways to use a phone instead of a Raspberry Pi, since it has a battery in case your electricity goes unstable, you can add LTE as a backup internet, and it has a screen to bootstrap it without an external monitor which not all of us have. I only wish Android phones would be more open to put a full Linux distro on them.
unstuck3958
> I only wish Android phones would be more open to put a full Linux distro on them.
You can: https://userland.tech/
circuit10
You can also use Termux, which by default isn’t quite a full Linux distro but it’s close and you can use proot to have a full one
pluijzer
If Termux is enough for you the benefit is that it is quite a bit faster than userland.tech. There is also Nix for Termux which provides a lot more packages.
karussell
Wow. This is amazing. Just got a server-side Java application running in the Alpine Linux and was able to access it with the normal browser via localhost. Impressive stuff :D
Are you one of the developers? As I'm really curious how this works.
kwonkicker
The processing power modern phones poses is insane.
VanTodi
Ubuntu touch supports some old phones you can buy used. It's technically not a android phone anymore, but it's possible. I tried it on my oneplus 6 and I worked, I'm just not ready for the ecosystem yet
pmlnr
You can do the same with an laptop and LTE card in them, which is much more stable.
msk-lywenn
But draws a lot more energy than a phone or an rpi
pmlnr
Debatable. I knew someone who's X200 was eating 6W.
undefined
spidersouris
Would be interesting to know how much battery is used by running the website.
yreg
Obviously depends, but solar powered website currently uses 2.8W. [0]
Louwrentius uses 29W? Do I read it correctly? [1]
charcircuit
>Android phones would be more open to put a full Linux distro on them
Honest question. Why? How is Android not fulfilling your needs as a full Linux distro? Are there any features that you would like to see added, or do you feel that apps for what you want are not currently available?
DCKing
> How is Android not fulfilling your needs as a full Linux distro?
I mean there's a lot of things that make life difficult with Android.
* If you want most hardware to keep on working, no kernel updates are possible after the manufacturer ends support.
* Root support and service managers need to be installed aftermarket using the unofficial solution Magisk.
* No vendor kernel out of the box supports kernel compile time flags to enable the infrastructure to run Linux containers using Docker, Podman or LXC.
* Self-invented file hierarchy with a lot of restrictions that make sense from an Android UI perspective but are prohibitive when used as a regular distro.
* Since Android and drivers use bionic libc, it's not possible to run regular Linux binaries that tap into certain hardware features like Vulkan without reworking and recompiling them.
Just from the top of my head, there's a bunch of other things people could name I'm sure. Android misses a lot of the expectations people have for regular GNU/Linux distributions have - expectations that non GNU/Linux distros like Alpine do meet for the most part.
charcircuit
>If you want most hardware to keep on working, no kernel updates are possible after the manufacturer ends support.
Yes, this is a problem and it is trying to be addressed by generic kernel images which should make it so that you no longer need to build a device specific kernel as all of the device specific stuff has been modularized.
https://source.android.com/docs/core/architecture/kernel/gen...
>Root support and service managers need to be installed aftermarket using the unofficial solution Magisk.
Root should not be necessary and these break Android's security model. Perhaps there is an operating system API that could be added that could provide the features you are looking for while keeping the system secure.
>No vendor kernel out of the box supports kernel compile time flags to enable the infrastructure to run Linux containers using Docker, Podman or LXC.
Android apps already have their own sandbox. It would be better to develop apps than docker images as darker images don't really follow the Android security model as well. What you want should be possible with Android 13 allowing for kvm.
>Self-invented file hierarchy with a lot of restrictions that make sense from an Android UI perspective but are prohibitive when used as a regular distro.
Why care about a file hierarchy? NixOS does away with it and seems to get along fine. Apps shouldn't rely on it.
>Since Android and drivers use bionic libc, it's not possible to run regular Linux binaries that tap into certain hardware features like Vulkan without reworking and recompiling them.
Most people run apps and not binaries. It is going to need to be reworked anyways.
TheDong
Android provides you with a heavily locked down linux kernel and network setup, which is great for app sandboxing, but not great for certain tasks you might want on a server.
For example, android makes it difficult to run userspace containers, like lxc or docker, which also limits what orchestration and deployment systems you can use (since some make very strong assumptions about being able to use containers).
Similarly, various different pieces of server software just won't work because they make use of some linux feature android intentionally builds its kernels without for security reasons.
k_bx
I didn't try it out, maybe you're right. I know how to deploy my stuff via systemd, install Rust/cargo/Elm/Python/Node/GHC/libopencv/Nix/whatever, link static libs and so on. And when I'm using Raspberry Pi I need near-zero new knowledge to do all that.
I suspect that trying something like that on Android will be a long road with lots of caveats, even if possible, learning to do all the things the new "Android" way. Am I wrong?
charcircuit
For building native code it will mostly be the same, but you will need to learn some Android stuff for making the nonnative part of your app so you can learn how to create a background service and how to tell Android to restart your service if it gets killed due to low memory.
gbraad
Termux and proot
xg15
I think the idea of using cheap/old Android phones as home servers is exciting, actually. If you compare the hardware with a raspberry pi, the results turn out pretty good:
- like a raspi, phones are optimized for "always-on" operation, which means they are energy efficient and completely quiet.
- compute power is probably larger than a raspi, or at least comparable, depending how old the phone is.
- unlike a raspi, phones come with lots of additional hardware, such as a battery, touchscreen, microphones, camera, wifi, bluetooth, a cellular modem and various sensors. More modern phones might even come with TPUs or other accelerators.
- there are also a few GB of flash storage.
I think hardware-wise, that's already more than enough for some basic "tinker" usecases, where you mostly need an always-on device with basic LAN and internet connectivity: i.e. IRC bots or servers, webhook targets, pihole, (small) media or Owncloud servers, etc.
Projects which require a camera, microphone, display or bluetooth connectivity might even be a lot cheaper because you don't need any additional hardware.
Things are getting less advantageous when you need additional ports or peripherals, i.e. Ethernet, HDMI/DisplayPort or GPIO pins. You can sort of solve this by using an USB-OTG cable and then connecting various USB peripherals to provide the missing ports. (You could even connect an Arduino to get GPIO pins).
It'll probably not work well with high-bandwidth use cases if everything has to be relayed through a single USB2 port though. That makes it hard for usecases such as router, NAS or media player. Maybe newer phones with USBC would work here though.
The other drawback is that you'll invariably end up with all kinds of proprietary and opaque firmware blobs. I think the best option here would be Fairphone, but even there I'm not sure if they are entirely blob-free.
Nevertheless, I think it's an interesting avenue. Termux seems like a good start, but it's still just a VM in an app. Does anyone know if there are actual AOSP or Lineage distributions for something like this?
ElectricalUnion
> Termux seems like a good start, but it's still just a VM in an app.
Termux is surprisingly native. The thing holding your back is mostly SELinux sandboxing. Termux compiles most of the normal Linux userland, but adapted to use bionic libc and with /data/data/com.termux/files/ as $PREFIX.
If you really want you can run "normal applications/normal distros" that depend on a "normal libc" by using proot, but even thought the performance is bad, it's still not a VM.
You are only stuck with VMs if you want to run, say, x86_64 with qemu or JVM bytecode.
edude03
There is PostMarketOS which is archlinux, and nixos on mobile.
opan
pmOS is Alpine, not Arch. For Arch on ARM, there's ALARM.
xg15
Ah, thanks for the info!
xg15
Note: For USB-C, there already are a number of cheap docks which provide HDMI and Ethernet and can also power the host. The keyword seems to be "USB-C PD hub".
Not sure though if those actually let you route the phone's GPU to a second screen or if they just have a cheap additional GPU built-in.
jmkni
Aaaaand it's gone
mfeldheim
If this is a phone he’s actually using he just might be in a subway xD
stareatgoats
It's doubtful that a phone can withstand the tidal wave of requests that follows from being on the front page of HN.
Kuinox
I'm not. Today smartphone CPUs are very powerful.
The CPU in the Pixel 6 for exemple, is equal to a 2012 intel cpu server: https://www.cpubenchmark.net/compare/5349vs1193/Google-Tenso...
tyingq
Well, the phones that could handle it are locked down too hard to run your own web server.
ghoshbishakh
Here is a hosted post by https://pinggy.io
bostonsre
Maybe he hit his data usage cap.
axelthegerman
Definitely neat for a small personal or community site where you don't expect any kind of public traffic.
Not so useful for something that might end up on HN and go down.
Could also put a CDN infront to lighten the load on the upstream but guess what, now you're not just hosting on your phone anymore and might as well use other cloud services where often you can host more for free than a phone can handle
k_bx
For those who need this I'd recommend Tailscale and their MagicDNS. You'll get access to this device for free from anywhere, with a working DNS generated for you, and only from devices that were allowed to.
SeriousM
Here is a blog from tailscale about it: https://tailscale.com/blog/2021-09-private-dns-with-magicdns...
miyuru
> Could also put a CDN infront
androidblog.a.pinggy.io is pointing to a AWS IPv4 address, I don't know why the creator did not do this.
I have also tried out direct access to my phone via public IPv6 and it works really well, although the prefix is not static.
spzb
Looks like the images are being served by Netlify (according to the HTTP headers).
roessland
Some telecom providers actually provide a public IP address that maps directly to your phone. You might have to change your APN settings to get one, and it might be dynamic.
It's a spectacularly bad idea that lets you serve HTTP (and any other port) directly from your phone without a SSH tunnel. You can also debug your Android with ADB... over the internet.
smorrebrod
That last part scared me! I tend to have ADB debug over USB always enabled on my phone but I'm not in any way enabling debug over wifi now I know this.
pimterry
Whilst publicly exposing ports from a phone is still certainly scary, for ADB specifically it's actually not as bad as it sounds - wifi debugging requires an explicit & bi-directionally initiated pairing process beforehand (sharing a 6 digit code or scanning a QR code to do so) and then also separately trusting the public key of the connecting computer at the moment when it connects.
To allow untrusted access, you'd have to have the ADB port accessible to the attacker, and then intentionally open developer options and tap "pair for wifi debugging", and then enter/scan a malicious pairing code, and then accept the unrecognized public key when the device connected. And if that does happen, there's a persistent notification that a debugger is connected.
KomoD
I wish my provider gave me that, would be so cool
lanewinfield
Honestly maybe the most I've laughed at anything I've seen on HN.
darkstar_16
A small VPS will cost $180 over 3-4 years and will likely have better performance under load. It's a neat idea, but not practical, imho.
mnkmnk
It is not really a fair comparison. I would expect that an old android phone that is just sitting in the cupboard to be used for hosting. I think the goal should not be “hosting website” but to be able to repurpose an old compute device for something useful. Phones these days are really good computing devices. 8GB or 16GB RAM, fast and efficient ARM processors, flash storage, inbuilt ups, Wi-Fi and 4G/5g connectivity, gpu and hardware accelerated encode and decode for video codecs etc. An equivalent VPS (hardware wise) would be more costly imo.
Hamuko
Especially when the article suggests to "subscribe to Pinggy Pro", which is $5/month (currently $2.50/month on sale). Pretty sure that's more than the cheapest VPS on Hetzner.
This seems like paying more upfront and paying more per month for less.
roqi
> Pretty sure that's more than the cheapest VPS on Hetzner.
I'm rocking a two node cluster in Hetzner. One is an old 1vCPU small that costs over $3/month, and the other is a new 2vCPU addition that is a dash over $4.
I pay for two ipv4 external IPs which costs more.
Also, Hetzner started to offer ARM64 nodes that are even cheaper.
Yes, Pinggy Pro is more expensive than operating your own nodes in Hetzner.
mnky9800n
maybe this is all just an advertisement for Pinggy Pro and it really has nothing to do with hosting a website on an android phone.
rerdavies
Cloudflare still provides free hosting for one website. Setting it up not exactly straightforward. But they're currently hosting my website, my domain, and giving me free CDN, without my having ever provided a credit card.
Hamuko
Don't they actually provide free hosting for unlimited number of websites? https://pages.cloudflare.com/
And yeah, I'm hosting my blog on Cloudflare. Very nice for a free service. Just hoping that the economic downturn isn't gonna turn off the tap on services like Cloudflare Pages.
rerdavies
Oops. Quite right. They allow unlimited websites. I should know that, because they're currently hosting two websites for me. :-P
ghoshbishakh
And what about GitHub Pages? Those are free too right?
ThatPlayer
You probably don't even need a VPS. Shared hosting still exists and will be even cheaper and still be good enough.
quaintdev
Use Hugo with GitHub pages.
janandonly
I've never understood why Github would allow anyone to (mis)use it as a dumb hosting pipe?
qwertox
A VPS has the benefit of also giving you a static IPv4 which will then allow you to build your own tunnels and Wireguard stuff.
But considering the amount of RAM current phones have, compared to what you get with a cheap VPS, there might be a benefit of running it on the phone.
someotherperson
I've had a VPS since about 2013 or so and I think I haven't passed $180 yet. Of course it really depends on your usage loads, RAM usage, etc. But for small websites/apps there are cheaper alternatives.
circuit10
You can get a free ARM VPS with Oracle Cloud at the moment
themodelplumber
This got me wondering.
> You are a web DevOps expert. Provide a list of ten concise combinations of software stack and hardware, starting from "budget hosted VPS website, heavy caching, and dynamic DNS with outside cache" and ending with "Android phone at home on standard connection using third party dynamic DNS and basic web server". Each combination should get more homebrew until that final Android one.
There's some room for prompt improvement but the ideas in the result were an interesting read (In place of the linked website which I couldn't read of course).
For one, the list seemed way more fun, or the projects easier to maintain for a single person, when I specified "web hobbyist" as compared to DevOps expert... though I know there really are people out there who are _definitely_ looking forward to maintaining enterprise software on the weekends...
leblancfg
FWIW here's what I got (GPT4):
1. *Budget hosted VPS website, heavy caching, and dynamic DNS with outside cache* - Software: Nginx, Varnish, PHP-FPM, MySQL - Hardware: Entry-level VPS, 1 vCPU, 1 GB RAM
2. *Shared hosting with CDN and dynamic DNS* - Software: Apache, PHP, MySQL, Cloudflare CDN - Hardware: Shared hosting plan, 1 GB RAM
3. *Raspberry Pi with LAMP stack and dynamic DNS* - Software: Apache, PHP, MySQL, ddclient (for dynamic DNS) - Hardware: Raspberry Pi 4, 2 GB RAM
4. *Self-hosted containerized web stack with dynamic DNS* - Software: Docker, Nginx, PHP-FPM, MySQL, Traefik (for dynamic DNS) - Hardware: Home server, 2 cores, 4 GB RAM
5. *Home server with reverse proxy, caching, and dynamic DNS* - Software: Nginx, PHP-FPM, MySQL, Varnish, ddclient (for dynamic DNS) - Hardware: Home server, 4 cores, 8 GB RAM
6. *Self-hosted web stack on a NAS with dynamic DNS* - Software: Apache, PHP, MySQL, Synology DDNS (for dynamic DNS) - Hardware: Synology NAS, 2 GB RAM
7. *Old laptop as a web server with dynamic DNS* - Software: Apache, PHP, MySQL, No-IP (for dynamic DNS) - Hardware: Old laptop, 2 cores, 4 GB RAM
8. *Self-hosted web stack on a mini PC with dynamic DNS* - Software: Nginx, PHP-FPM, MySQL, DuckDNS (for dynamic DNS) - Hardware: Intel NUC, 2 cores, 4 GB RAM
9. *Web server on a single-board computer with dynamic DNS* - Software: Lighttpd, PHP, SQLite, Afraid.org (for dynamic DNS) - Hardware: BeagleBone Black, 512 MB RAM
10. *Android phone at home on standard connection using third party dynamic DNS and basic web server* - Software: KSWEB (web server), No-IP (for dynamic DNS) - Hardware: Android phone, 2 GB RAM
themodelplumber
Right on, yeah similar here. I like the direction it takes the prompt. In the future I guess I'd ask it to sort / graduate them better. Also, it's really PHP heavy and I think it'd be fun to tell it it has to use a different, obscure stack for each item. And maybe even give each project a clever nickname based on how sketchy the stack is and the type of coder who would enjoy it. ;-)
Get the top HN stories in your inbox every day.
Imagine this but instead of needing any CLI skills, you just install a "blog" app on the phone, do a quick OAuth2 flow with your domain provider[0] to connect a domain through a tunnel, and you're ready to start posting. This is essentially my vision of the future of selfhosting. We have a lot of work to do, but the technology is all there.
Also, if you're looking for similar tools to pinggy, I maintain a list here[1].
[0]: https://takingnames.io/blog/introducing-takingnames-io
[1]: https://github.com/anderspitman/awesome-tunneling/