Live data from Hacker News

Raspberry Pi as a local server for self hosting applications

cri.dev

81–90 of 321 posts

Re: Raspberry Pi as a local server for self hosting applications

#81

I have a RP4 on my desk collecting dust, need to get it up and running for something useful. This post has got me motivated to find a use for it.

My favorite use of a Raspberry Pi has been to run a Jenkins instance. I use it for CI/CD on projects, but also for automating other tasks -- You can use Jenkins to wrap any arbitrary script with more higher-level logic and extensibility than a cron job. For example, I use Jenkins to automate multiplatform builds for some side projects, to periodically ingest data into a database, perform cleanup jobs, etc.

That’s nice! Trying out n8n.io right now and it’s pretty sweet

Re: Raspberry Pi as a local server for self hosting applications

#82
The hardware is there (RPi + USB storage). The server software is there (NextCloud, Plex, n8n, etc). What isn't there is the plumbing. The next logical step after this blog post is making your services accessible to your phone over the public net. You'll immediately find yourself mired in domain name registration, VPS management, TLS cert management, dyndns, port forwarding, hole punching, etc etc.

There are lots of great tools that solve some of these problems. I have yet to find one that solves all of them.

I think we need something like Namecheap + CloudFlare + ngrok, designed and marketed for self-hosters and federators. You simply register a domain and run a client tool on each of your machines that talks to a central server which tunnels HTTPS connections securely to the clients.

Mapping X subdomain to Y port on Z machine should take a couple clicks from a web interface.

Re: Raspberry Pi as a local server for self hosting applications

#83

How do people access these servers off of their home network (or do they not?). That seems like most of the value to me, hosting some service you can access from anywhere without having to use Digital Ocean. It seems like most residential ISPs don't provide a static IP and some block port 80? I think forcing ISPs to allow home users to serve traffic via some standard method would go a long way to enabling a more dece…

I've got a static-ish address, meaning that my ISP hasn't changed my IP in many years, even with modem or router reboots. I've been meaning to get a dynamic DNS provider, but it hasn't been a priority.

In terms of accessing local services, I'm using StrongSwan on a VM with the relevant ports forwarded from my router. Ideally, the router would run StrongSwan, but until I switch to pfSense I'm living with this setup.

iOS and MacOS devices get a .mobileconfig profile which automatically connects when needed and disconnects when the device returns to my home WiFi network. My Linux travel laptop can also connect, but I haven't figured out how to make this happen automatically yet.

Re: Raspberry Pi as a local server for self hosting applications

#84

The hardware is there (RPi + USB storage). The server software is there (NextCloud, Plex, n8n, etc). What isn't there is the plumbing. The next logical step after this blog post is making your services accessible to your phone over the public net. You'll immediately find yourself mired in domain name registration, VPS management, TLS cert management, dyndns, port forwarding, hole punching, etc etc. There are lots of…

I can relate, thought about setting up a Caddy server to route through the different services (also nginx would be fine). Have to try it out and probably make a list of services in a HTML document returned on port 80/443

Re: Raspberry Pi as a local server for self hosting applications

#85

The hardware is there (RPi + USB storage). The server software is there (NextCloud, Plex, n8n, etc). What isn't there is the plumbing. The next logical step after this blog post is making your services accessible to your phone over the public net. You'll immediately find yourself mired in domain name registration, VPS management, TLS cert management, dyndns, port forwarding, hole punching, etc etc. There are lots of…

> Mapping X subdomain to Y port on Z machine should take a couple clicks from a web interface.

route53 can work like that, it also has a cli version. (But you can't get the domain there).

Re: Raspberry Pi as a local server for self hosting applications

#86
post #78
post #71

Earlier quoted context omitted.

> RPi 4 from about a month or so ago onwards will do this out of the box Are you saying you don't need an SD card at all and it will just boot off USB?

Yes, it can do that now.

I buy quite a few of them as a tinkerer and recent (~two months) ones don't need firmware/BIOS fiddling to boot off USB. Make sure you get reasonably recent stock.

Re: Raspberry Pi as a local server for self hosting applications

#87

How do people access these servers off of their home network (or do they not?). That seems like most of the value to me, hosting some service you can access from anywhere without having to use Digital Ocean. It seems like most residential ISPs don't provide a static IP and some block port 80? I think forcing ISPs to allow home users to serve traffic via some standard method would go a long way to enabling a more dece…

I’m using a 3$ VPS (hetzner) as a VPN server and access my local servers that way. You also get a regular VPN for free that way and setup is trivial if you use wireguard.

+1. Allows me to access my Jellyfin and file server from my laptop no matter where I am, all for a few bucks and a good learning experience with Wireguard.

Re: Raspberry Pi as a local server for self hosting applications

#88
post #80

My only gripe about Raspberry Pi, and only thing that prevents me from using it as a home server, is that the USB cannot power an external HD

Not sure, if it would make a difference to your use case, but I’ve had success powering an SSD from a 4GB Pi 4 USB 3 port.

Re: Raspberry Pi as a local server for self hosting applications

#89

The hardware is there (RPi + USB storage). The server software is there (NextCloud, Plex, n8n, etc). What isn't there is the plumbing. The next logical step after this blog post is making your services accessible to your phone over the public net. You'll immediately find yourself mired in domain name registration, VPS management, TLS cert management, dyndns, port forwarding, hole punching, etc etc. There are lots of…

> Mapping X subdomain to Y port on Z machine should take a couple clicks from a web interface. route53 can work like that, it also has a cli version. (But you can't get the domain there).

Can it tunnel to local devices like a RPi or just AWS VMs?

Re: Raspberry Pi as a local server for self hosting applications

#90

One thing to watch out for when doing something like this is that the Raspberry Pi will by default put your file system on the SD card it boots from. SD cards aren't meant to support a lot of write/erase cycles, so it's easy to end up with a corrupt SD card after a few months to a year depending on what you're doing on your Pi. A workaround that can save you some headaches here is to only boot from the SD card (which…

Most writes are the logs, I use log2ram [1], it reduces SD writes substantially. [1] https://github.com/azlux/log2ram

Busybox's syslog logs to RAM by default. And it can be built with runit requiring no systemd if the distribution was built for this. Also Alpine Linux runs out of RAM entirely by default. Too bad RAM is constrained on these devices and I haven't been able to make it load g_serial in Alpine for the USB gadget console on the OTG port. I used a Pi Zero W.
Post reply on HN