from Hacker News

Selfhosting on Localhost

by jo-m on 7/5/22, 10:24 AM with 53 comments

  • by superkuh on 7/5/22, 4:42 PM

    Another cargo cult post about self hosting that makes it about 1000 times more complex than it needs to be via containerization. I get that it's what they're used to because of work but this isn't work and has entirely different requirements.

    There are no "production deployments" at home. You just do what you want. If it's down for a day that's fine. Putting something in a transient docker container and then bending over backwards to enable file persistence is just... wrong. And it'll lead to lots of extra work for no reason.

  • by qbasic_forever on 7/5/22, 3:23 PM

    Something nice about selfhosting on localhost with a modern linux machine (using systemd and systemd-resolved for DNS) is that by default *.localhost DNS queries are routed to localhost. So you can setup your local apps to have domain names like "photos.localhost", "code.localhost", etc. and not have to muck with hostname entries and such.

    Setup caddy as a reverse proxy and it will automatically inject a local CA cert into your browsers and auto provision local SSL certs too so you can access local services by names instead of ports, and everything happily works with SSL automagically.

    I really, really wish windows and mac had a similar behavior to just route all *.localhost queries to localhost.

  • by bluehatbrit on 7/5/22, 12:31 PM

    I'm a big fan of this approach and do similar! If it's something I only need when I'm at my computer and where I'm fine if it falls over then I'll host on localhost. I then have a small Lenovo M700 Tiny which I use to run things I may want on multiple devices (use Tailscale so I can access it remotely) but where I don't care too much if it falls over. Anything that I want to be really stable I run on my Hetzner dedicated.

    It's great fun and I enjoy having the control over the few things I run. It's also super conveniant when it's running locally because I don't really have to worry much about securing the service behind reverse proxies and all that. I can just hit it however I like with any ol script.

    It's not for everyone, but it works for me.

  • by 878654Tom on 7/5/22, 12:31 PM

    Additional information if you are interested in self-hosting your personal data, take a look at the awesome-selfhosted (<https://github.com/awesome-selfhosted/awesome-selfhosted>) list. It contains a lot of information and tools.

    [1]

  • by kkfx on 7/5/22, 5:37 PM

    That's allow me to say: sorry guys you still lost the way.

    The fact that modern apps are web-apps is a living proof that the old model of document-based UIs was the right way against the widget/form model however old classic document-UIs was interactive, in the sense that the user can create and modify them inside themselves, web-apps might allow "a bit of customization" but are still FAR from being changeable at runtime by their users.

    Perhaps in another 30+ years will finally rediscover the old model, sold as a very new high-tech thing, since nobody will remember the origin...

    So far Emacs/org-mode/EXWM/org-roam can be used (I use them) as a document-based UI for almost anything, still integrated (thanks to EXWM) with modern/classic/raw-and-archaic GUIs like Firefox or GIMP. They are limited in GUI terms but at least they can have embedded images, live elements (org-mode headings, search&narrow UI to access them, attachments, links to anything that also just run live embedded code etc...

  • by mtbkvc on 7/5/22, 11:27 AM

    This makes perfect sense, especially on some minimal arch install with a tiling window manager. This way you can delegate most of the GUI stuff to the browser and have less stuff installed locally. Nextcloud is also something that can be hosted locally, it can help with calendar, image gallery, contact management, e-mails etc.
  • by jve on 7/5/22, 2:28 PM

    Alright, how great is HN?

    Today, few hours ago, I was thinking: "My nextcloud on SSD@RPI is superslow to render thumbnails for photos. I'v tried once to configure which thumbnails must be prerendered, but I failed and... isn't there a simple web photo album that I can hook my nextloud photos to?"

    Yesterday I was disappointed that is doesn't show ANY thumbnail for my videos taken on Android.

    And this post mentions PhotoPrism [1]! Feature page looks nice - exactly what I need for my mess of unorganized photos.

    Have to try it out. Hope I don't find myself disappointed.

    [1]: https://photoprism.app/

  • by dontchooseanick on 7/5/22, 5:17 PM

    "Not reachable from outside my home.."

    If your apps listen on IPV6, they _are_ reachable from outside your home (provided your mobile ISP does IPV6, but they mostly do AFAIK)

  • by PaulKeeble on 7/5/22, 1:41 PM

    If you don't share services with others and your machine is usually on then its not much of an issue where you run them. But if you share these services then it need not be all that expensive to host it, a raspberry pi can handle quite a lot especially with an add-on drive and you could backup to an online drive service.
  • by derekzhouzhen on 7/5/22, 4:00 PM

    I do this all the time. I have permanent SSH tunnels from my home pc to my VPS and a reverse proxy on my VPS, so I have super fast access to my home apps at home and tolerable access to the same apps when I am outside.

    Of course, you need to secure your apps, period.

  • by softwarebeware on 7/5/22, 9:07 PM

    The limitation mentioned about not being able to access localhost outside of your home wifi is easily solved with a dynamic DNS. I use DuckDns to be able to access "localhost" when I'm away.
  • by butz on 7/5/22, 5:19 PM

    Build static website, run httpd from busybox and call it a day?