20 ms·
Raspberry Pi as a local server for self hosting applications
- rcarmo 6y agoFriendly reminder that you can use Piku (https://github.com/piku https://github.com/piku) for Heroku-like deployments.
- christian_fei 6y agoawwwww yeaaah! ty
- benbristow 6y agoI see it's inspired by Dokku (because Dokku doesn't support ARM). I use that for a few of my apps on a VPS, nice tool. http://dokku.viewdocs.io/dokku/ http://dokku.viewdocs.io/dokku/
- sneak 6y agoI prefer CapRover; it supports inbound webhooks so you can hook it up to Gitea/GitLab/GitHub with its own ssh deploy key and it will autodeploy from a specific branch, so you don’t need to push to it.
- KingFelix 6y agoI 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.
- christian_fei 6y agoGlad to hear, enjoy! Just set up a Tor proxy that I can connect to with one command from my PC, by connecting to the PI via SOCKs proxy, good times
- Waterfall 6y agoThey're great as dust collectors but not as good as arduinos. You can always use it to run nextcloud if you want your own services.
- chrisdalke 6y agoMy 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.
- christian_fei 6y agoThat’s nice! Trying out n8n.io right now and it’s pretty sweet
- cstuder 6y agoOn my Raspberry Pi 3 I'm running Hypriot OS which installs a minimal host OS and then just runs Docker. Thanks to cloud-init (Old version though) you can even pre-configure the boot image with your SSH key etc. which allows you to automate your initial install. https://blog.hypriot.com/downloads/ https://blog.hypriot.com/downloads/ https://cloudinit.readthedocs.io/en/0.7.9/topics/capabilities.html https://cloudinit.readthedocs.io/en/0.7.9/topics/capabilitie...
- christian_fei 6y agothat is interesting, thanks! sounds like a super smooth dev and deploy experience
- Polylactic_acid 6y agoDocker on ARM is not a smooth experience. Hardly anyone builds containers for ARM so you end up either building everything yourself or finding weird -arm versions of popular containers.
- christian_fei 6y agohave you seen this? https://hub.docker.com/u/arm32v7 https://hub.docker.com/u/arm32v7
- tssva 6y agoUbuntu for the RPi also uses cloud-init. I use it create a default user with my username instead of the ubuntu user, deploy ssh keys, install packages and configure the network on newly deployed Pi's.
- incanus77 6y agoBalenaOS is also really good for this: https://www.balena.io/os/ https://www.balena.io/os/
- liability 6y agoI recently thought about getting an RPi4 but ultimately spent about a hundred dollars more to get a cheap NUC. It was a bit more expensive but it seems like a more robust platform. A real AC adapter instead of USB (apparently the RPi4 kind of botched it in some revisions? What I read wasn't confidence inspiring), takes normal SO-DIMM ram and a typical SSD, doesn't have a reputation for overheating.. it seems generally more straight forward with fewer 'gotchas.'
- tyingq 6y agoIf you have an i5 or i7, you may also have the advantage of remote KVM (via Intel's vPro) so that you can revive it remotely if needed.
- entropicdrifter 6y agoNot to mention the built-in advantage of Intel's much better supported QuickSync video encode/decode if you're doing any sort of media streaming.
- Waterfall 6y agoWon't matter if your main computer does the decoding, and for the price of one good computer that can stream to all devices including crappy ones versus all good ones and a cheap NAS to host, which would you choose?
- colordrops 6y ago
- erulabs 6y agoNice! I recently wrote a blog article about home-hosting on a RPI4 using kubernetes (https://kubesail.com/blog/k3s-raspberry-pi https://kubesail.com/blog/k3s-raspberry-pi). Such a bright future in home-hosting - really looking forward to seeing the movement grow! The https://www.linuxserver.io/ https://www.linuxserver.io/ community is pretty great re: home-hosting apps as well.
- oarsinsync 6y agoHow do I home host KubeSail?
- christian_fei 6y agoThat's awesome! didn't know about https://fleet.linuxserver.io/ https://fleet.linuxserver.io/ ! Gotta definitely try this, thanks
- erulabs 6y agoYeah! They have a really great community in their chatroom as well - A lot of our Kubernetes templates are based on their excellent Docker images :)
- j1elo 6y agoWow linuxserver.io looks amazing! But the sheer number of images available make me wish the table had a column with short descriptions to know at a glance what is each thing. Most of the items (at least those I clicked) don't even have a description or link to home page, so it's difficult to have a quick overview.
- snapetom 6y agoI've set up a small cluster at home via Docker Swarm. I use it to not only an environment to prototype more complex apps, but also keep my devops knowledge up, too. I originally had a Cluster Hat (https://clusterhat.com/ https://clusterhat.com/) which piggybacked four Pi-0's on a Pi 3. Even cut out a nice acrylic case, too (https://climbers.net/sbc/clusterhat-review-raspberry-pi-zero/ https://climbers.net/sbc/clusterhat-review-raspberry-pi-zero...). It worked fine, and I even had Hadoop running on it for a while. The biggest issue was the ARM7 of the host (pi3) vs the ARM6 of the Zero's. This caused a lot of problems with deployments, essentially eliminating the redundancy you get from orchestration systems.
- antognini 6y agoOne 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 means you're effectively only ever reading from the card), and then mount a filesystem on an external SSD drive. There are a couple of good guides here [1] [2]. [1]: https://www.stewright.me/2019/10/run-raspbian-from-a-usb-or-ssd-on-a-raspberry-pi-4/ https://www.stewright.me/2019/10/run-raspbian-from-a-usb-or-... [2]: https://www.pragmaticlinux.com/2020/08/move-the-raspberry-pi-root-file-system-to-a-usb-drive/ https://www.pragmaticlinux.com/2020/08/move-the-raspberry-pi...
- christian_fei 6y agoGood points, thanks! Just stumbled upon this today by coincidence, will definitely follow the suggestion, cheers
- rovr138 6y agoLatest Pi’s can boot from external media. It’s possible to boot from an SSD
- codetrotter 6y agoYou can't just say that without including a link :P Anyways, I assume that the following is what you are referring to: https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/msd.md https://www.raspberrypi.org/documentation/hardware/raspberry... In that case, the following from the linked page might be worth making note of: > To enable USB host boot mode, the Raspberry Pi needs to be booted from an SD card with a special option to set the USB host boot mode bit in the one-time programmable (OTP) memory. Once this bit has been set, the SD card is no longer required. Note that any change you make to the OTP is permanent and cannot be undone. Not that it matters much to me but still something worth being aware of if you later try to repurpose your RPi for something else I think.
- _lacroix 6y agoSetting up a pi-hole DNS server for my wifi network was one of the best decisions I've ever made. Horrifying to see what percentage of traffic is on the ad server blacklist though...
- christian_fei 6y agoDefinitely!
- h4l0 6y agoI wasn't aware that my Samsung Smart TV had been logging almost my every action on the TV until I set up a PiHole server. Also, my respect for Apple grew by the fact that only device that wasn't doing loads of telemetry turned out to be my Macbook in the whole household.
- _lacroix 6y agoYes!! I was so grossed out by all the logs from my Smart TV. I'm embarrassed to say that I worked in ad tech (as an engineer) for years but I still didn't fully comprehend how pervasive that kind of tracking is in literally every environment.
- outworlder 6y ago> Also, my respect for Apple grew by the fact that only device that wasn't doing loads of telemetry turned out to be my Macbook in the whole household Turns out that modern electronic devices are expensive. If you are not charged up-front, there's a good chance that you are being charged in some other way.
- t-writescode 6y agoLet’s be fair, even if you did pay more up front, they’d still get ads from you. The whole thing is pervasive and we need legislation for it.
- Symbiote 6y agoWe need legislation against this as the "discount" isn't at all obvious.
- fossuser 6y agoHow 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 decentralized web. I know Zero Tier, and Tailscale exist - but I don't really understand how they work (and I think they require intermediate server access anyway so might as well use Digital Ocean?). I'd like a future where you could sell users a raspberry pi running a service they can just plug into their home switch and access it securely from anywhere.
- beervirus 6y agoDyndns or similar.
- ericd 6y agoIf you have a linux box that's always on on your network, you can throw in a simple cron entry to curl a dynamic dns provider (entrydns.org works pretty well in my experience), which updates their dns entry for a url you set. Set up OpenVPN on your router, VPN to the URL, voila, access to your self-hosted services. You definitely shouldn't expose most of these things directly to the net, they're not always bulletproofed as much as one would like.
- maxmunzel 6y agoI’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.
- x87678r 6y agoI like my rpi but my life got better when I bought a mini pc instead. Its pretty common to get a 16GB mem micro for not much more than an rpi with power supply, sd card, case. https://computers.woot.com/offers/lenovo-thinkcentre-m73-240g-tiny-pc-10?ref=w_cnt_lnd_cat_pc_2_24 https://computers.woot.com/offers/lenovo-thinkcentre-m73-240...
- gramakri 6y agoYup, similar. I have a thinkcenter m600 series. Quite old but works really well.
- flipbrad 6y agoI looked at these but got an old ThinkPad laptop instead. Integrated UPS, keyboard and mouse...
- christian_fei 6y agogood point..
- nicbou 6y agoI'm using my old Thinkpad T510 as a home server. It's been running for 7+ years already. I only need to dust the vents once in a while. It has PiHole, Nextcloud, my humble little Netflix clone, and a few other things. If you use ffmpeg a lot, you ought to have more power than the RPi offers. I often SSH into it to use it as a SOCKS proxy in other countries.
- christian_fei 6y agoVery cool 7 years is a damn loong time. Interesting seeing how the experiment with the RPi will go
- phil21 6y agoYep, older laptops make perfect home servers/routers. Built in "KVM switch", built-in UPS, low power/noise, etc. Before I switched to Ubiquiti I ran pfsense on a VM on my old 410s for many years, among other virtual machines for home lab use.
- IanSanders 6y ago>low power/noise how does that compare to RPI?
- nicbou 6y agoIt's a regular laptop fan, so it's inaudible unless ffmpeg is converting a movie. Then there's an audible hum, but it's no louder than the fridge's compressor.
- tonitosou 6y agoi use a pi as webserver. works like a charm
- christian_fei 6y agoNice!
- gramakri 6y agoI have tinkered with RPI a lot in my previous life, I used to maintain the Qt eglfs QPA plugin. Back then, they were quite under powered CPU wise. Are the recent versions powerful enough to host websites and data for every day use? Like say, is it powerful to host a website, couple of blogs, a nextcloud/syncthing instance and say Emby/Jellyfin/Plex? Most importantly, I want to hear about setups that people are using for every day use and not just learning. (For context, we get a lot of requests to port Cloudron to ARM/RPI but I am still not sure if these are just hobbyists/tinkerers or something people use everyday.)
- christian_fei 6y agoUsing Emby actively right now and it’s working like a charm! Nextcloud will probably be my next experiment
- gramakri 6y agoDoes hardware transcoding work?
- christian_fei 6y agowouldn't know. installed it through a .deb file, so it's certainly better suited to use the hardware than through docker probably
- StillBored 6y agoThe pi4 even overclocked isn't a great number cruncher, and I don't think the gpu acceleration has landed yet.. So I might expect it to be on par with that old of a macbook but not beat it by nearly 2x, particularly if the macbook is being accelerated. (despite having 2x the core count) Which makes me think the MBP may be suffering from some serious thermal throttling, which wouldn't be uncommon on machines of that vintage. I also assume the call line is: https://github.com/christian-fei/raspberry-pi-time-lapse/blob/master/create-time-lapse#L17 https://github.com/christian-fei/raspberry-pi-time-lapse/blo... which is noticeably missing the -hwaccel switch, which means its probably not using the GPU on the mac..
- christian_fei 6y agoDefinitely, good points. Gotta try your suggestion regarding the missing flag on the ffmpeg side and report back, out of interest. I’m on service battery since a long time in fact I consider this setup only temporary, and will soon upgrade to a modern machine
- ed25519FUUU 6y agoSet the encoder to omx on the pi as well to take advantage of accelerated h264 encoding.
- christian_fei 6y agowill try!
- vardump 6y ago> The pi4 even overclocked isn't a great number cruncher, and I don't think the gpu acceleration has landed yet.. Well, you do get about 96 Gflops. That was pretty respectable hmm... 12+ years ago.
- dboreham 6y agoIme devices with a proper CPU and SSD such as Intel NUC and Beelink are the MV solution to run server software without constant headaches due to slowness, limited memory and flash wearout. Ymmv of course. The Pi4 with 8G is getting close.
- codezero 6y agoI haven't been into computer hardware lately, but I decided to pick up a NAS, and was pleased to learn that they're now just a complete computer - I've started using VMs living on my NAS to do this kind of thing, which is quite nice. Synology's interface is not bad either, but I imagine others have come up with even better ways to use these systems. Obviously a RPi is a way cheaper way to get a lot of the same work done though :)
- yegle 6y agoFor anyone with a home server and has the need to remotely access your self-hosted websites, https://pomerium.io https://pomerium.io has been a wonderful piece of software in my stack. You can safely expose your self-hosted websites to the internet and without the hassle of needing to have a VPN connection first.
- christian_fei 6y agothat's cool!
- noncoml 6y agoMy 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
- noizejoy 6y agoNot 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.
- kingosticks 6y agoI power a laptop drive with mine. One of those WD passport type things. Works fine for video playback.
- flyingcircus3 6y agoI've wanted to make a headless audio player for my car, and this power issue has been the bottleneck for me. Additionally, spinning disks and moving cars are a bad combination. Just last week I bought a 500gb SSD and usb adapter for about $75. My Pi 2 powers it without issue. The only problem I see is that the SSD can get fairly warm, so keeping it in my closed center console probably isn't a good idea.
- anderspitman 6y agoThe 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.
- christian_fei 6y agoI 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
- anderspitman 6y agoThis is a good option if your ISP doesn't block ports 80/443 and you don't mind setting up port forwarding. EDIT: Oh and if you don't mind managing your DNS records manually, including dynamic DNS.
- Aperocky 6y ago> 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).
- anderspitman 6y agoCan it tunnel to local devices like a RPi or just AWS VMs?
- louwrentius 6y agoIf you run anything semi-serious please consult this blog post by Jeff Geerling about SD card performance (buy A1 ones). https://www.jeffgeerling.com/blog/2019/raspberry-pi-microsd-card-performance-comparison-2019 https://www.jeffgeerling.com/blog/2019/raspberry-pi-microsd-...
- sneak 6y agoIt’s an rpi connected to a dual core laptop on a home connection, presumably without a battery backup. Nothing about this is remotely semi-serious.
- pettycashstash2 6y agoi use the rasp pi 3+B 1 GB model to sense oil level in my oil tank. i now know oil tank level anywhere any time. Take a look at http://myoilguage.com/ http://myoilguage.com/
- christian_fei 6y agothat's interesting!
- gcctrp 6y agoThere are FreedomBox versions for Raspberry Pi 2, 3B, 3B+, and 4B. https://wiki.debian.org/FreedomBox/Hardware#Also_Working_Hardware https://wiki.debian.org/FreedomBox/Hardware#Also_Working_Har...
- gurjeet 6y agoDoes anyone have any experience with running and upgrading FreedomBox for self-hosting.
- oblib 6y agoA DigitalOcean vps can be a pretty inexpensive and easy option. I've done this with a Pi and Dyndns. It's pretty easy to setup but not as good (for me) as a DO vps because my home ISP limits data heading out. I would have to purchase a business plan to fix that and it still wouldn't be better or cheaper than what DO and others can provide. A Pi can be used for development on your home network and it excels at that. And the older RPis can run [1]CouchDB and be configured to "Live Sync" with a CouchDB running on a commercial VPS. That too is a pretty easy to setup and it provides some pretty nice options. For example, you can make your app use the Cloud based CouchDB while you're out and about and it will sync your data with your local CouchDB. Then when you get home you can turn off the cloud access and even delete your data on the cloud DB. 1. The latest version of CoudhDB (v3.0+) doesn't run on the new ARM based Pi 4.
- christian_fei 6y agoyep, noticed the same. a lot of containers are not available for arm, and thus you'll need to build them yourself..
- 2Gkashmiri 6y agoHow does Cgnat fit into this? Or do we have to forego any hopes of it as long as cgnat exists?
- sneak 6y agoThis is probably way better achieved by a $5/mo VPS. Benefits: - way faster - always on (presumably battery backed) - you're not responsible for disk or hw failures - better internet (faster, redundant connections) - cheaper ($60/year vs $100 upfront) - not fighting architecture differences - comes with a public v4 address - usually comes with a v6 address too Downsides: - data isn't under your control and is subject to military espionage - your internet connection to move larger files to/from the remote device may not be great
- christian_fei 6y agotrue, although this is an experiment and wanted to see the compatibility and benefits of having self-hosted software running in my home without exposure on the internet
- tga 6y ago$60/year is not cheaper than $100 one time, unless you plan to run the RPi for one year and then throw it away.
- novok 6y agoYou do pay for the electricity cost. Assuming the Rpi consumes 10W and is on 24/7 and your electricity cost is $0.15/kwhr : 365d * 24h * 0.01kW * $0.15 = $13.14/yr in electric costs.
- sneak 6y agoNote that if you got all excited about n8n when learning about it from this webpage, as a potential open source Zapier: n8n is not open source, despite being source available. The author goes to pretty great lengths to avoid confronting this fact. https://github.com/n8n-io/n8n/issues/40 https://github.com/n8n-io/n8n/issues/40
- christian_fei 6y agoThanks for the heads up! Need to read about this in depth
- justin66 6y agoWow. I'm instantly sympathetic with the author given the level of vicious fanaticism he was confronting there.
- sneak 6y agoDrew being mean doesn’t change the fact that the author was (and to some extent still is) being shady.
- sebastianvdn 6y agofd
- sebastianvdn 6y agovcx
- valiant-comma 6y agoFor simple, web-based speedtests on a local LAN/WLAN, I like librespeed[1]. Really helps identify subpar WiFi coverage (for example), better than just signal strength. Runs nicely on a Pi, up to line rate (1 Gbps) on a Pi 4. [1] https://github.com/librespeed/speedtest https://github.com/librespeed/speedtest
- christian_fei 6y agoawesome! thank you!
- newbie789 6y agoThis is related because I'm exclusively interested in building a local-network-only media server to serve my firestick and a laptop, but are plex (nice interface, for some reason requires a sign-in to their service, some sort of paid features) or emby (similar) the only options? If I for example wanted to just access my media library through firestick and windows with a kinda neat interface without paying anybody or making an account on a third party website, is there a solution? I suppose I could just use VLC, which is fantastic software that isn't particularly beautiful and get used to it, but I'd like a somewhat more "netflix-style" interface for navigating my content within a single rpi server on my network.
- voltaireodactyl 6y agoFrom the sound of it, making a pure FTP file server and then using Kodi client software on windows and firetv (or the firetv specific versions) is exactly what you’re after.
- nonninz 6y agoIt seems that Kodi[1] would be your perfect choice, and that is indeed what I'm using in a very similar setup. Setup your media (local or remote) library, and the scraper will enrich it with posters, synopsis, actors, etc. [1] https://kodi.tv/ https://kodi.tv/
- christian_fei 6y ago+1 to this
- deleted 6y ago[deleted]
- newbie789 6y agoThanks for the suggestion, I'll have to give that another try! I've had success with Kodi in the past with my laptop but I've also had big performance issues on the firestick. To be fair, it's been a couple years since I tried that so I'll see if the newer versions perform better.
- flyinghamster 6y agoIt really wasn't until I got myself a Pi 4 that I really appreciated what an improvement it was over the earlier generations. I have the Pi 4 and a 3B+ running BOINC, crunching away on World Community Grid[1], and the 4 is at least twice as fast at completing work units (it's too early for RAC numbers to settle down, yet). The Cortex-A72 is a huge step up from the A53. [ETA: both are actively cooled.] Also, the Pi 4 eliminates the USB2 bottleneck the old Pis have, and has a couple of USB3 ports. [1] Be sure to boot with arm_64bit=1 in config.txt or you will get no work units.
- christian_fei 6y agoThanks for the hint! Will include this in my config.txt
- ttflee 6y agoFor ffmpeg h.264 encoding on macOS it is not very wise to use x264 instead of h264_videotoolbox.