11 ms·
Setting up a Raspberry Pi 4 home server
- punk-coder 7y agoNice article. I had big plans for using a Raspberry Pi as a Plex Media Server once. The set up was easy, I attached my external HDD and let it scan the libraries. My wife and I watched a few movies, it worked perfectly. The next evening when we sat down to watch a movie I saw that Plex couldn't connect to the media server. I went upstairs and attached a monitor to my Raspberry Pi and I saw that Wireless Internet was not working on it. I tried everything and eventually rebooted it and everything worked again. This turned into a daily thing. I followed all sorts of instructions I found on the internet to try and fix the issue, but to no avail. Every day there would come a certain time where the Raspberry Pi would just lose it's Wifi capabilities and a reboot was needed. Sad, because I liked the idea of this small box sitting on the corner of my desk running a media server. This was an older Raspberry Pi, maybe things have improved.
- blowski 7y agoI had a similar problem with an early model of Raspberry Pi, but no problems with the newer one. Definitely worth giving it another go.
- jumbopapa 7y agoWhy not just setup a cron job to run a reboot command daily?
- xenorplxx 7y agoRunning any server on wifi, even home plex instance, is not a great idea. It's a shame that rPi doesn't support PoE out of the box, that'd mean you could've only 1 cable connected, but it'd manage both network and power.
- Jonnax 7y agoReally? It's not 2005. Sure something system critical use ethernet. But the idea that it's WiFi that's unreliable is clearly not the case. Something is wrong with the RPI WiFi chip, driver or OS configuration.
- sliken 7y agoNormal homes these days have quite a bit of competition for wifi. Hell even today's watches these days have wifi. Add a kindle, a few security cameras, a few laptops/tablets, a few phones, etc. Then add some crappy/noisy LED bulbs, a cheap microwave, and various consumer electronics and wifi is far from a sure thing for streaming 4k video over... especially for hours at a time. I had some network lag/dropped frames, turns out my stereo receiver was downloading a quite large firmware update. Had me freaked out a bit, I hadn't recorded the mac address. Didn't figure it out till I turned the TV on and saw a dialog asking if it should upgrade. So, yes, generally I'd recommend that anything that's going to consume hours of 4k video be put on ethernet if at all possible.
- throwaway8941 7y agoIf you're living in an apartment (like a sizeable chunk of the world's population does), WiFi is absolutely not an option for anything even remotely traffic heavy.
- pnutjam 7y ago2.4 is unusable in my house. I can only reliably use 5.0 ghz
- newqer 7y agoI always try to connect devices that don't move to Ethernet. It saves WiFi bandwidth for "mobile"devices and is extremely stable and the full bandwidth is always available. Things like SmartTV, RPi, Solar Panels, Amplifier, etc. I hate it that Chromecast only has a wireless option. But more on-topic, it shouldn't drop off WiFi just like that.
- karatestomp 7y agoYeah, you’re gonna want Ethernet for a server. Both ends of a connection being on wifi is asking for flakiness even if there aren’t any problems with the server’s hardware or software.
- darkteflon 7y agoFwiw, I run an rpi4 4gb as a plex home server over ethernet and it’s been flawless for the two months I’ve had it. I set it up on a lark expecting it to be basically rubbish but turns out that, at least with my media and an LG TV Plex client, it’s never had to transcode a thing. It’s now my only media server. It just sits there in the corner, costs about $5 / month in electricity, faithfully serving up anything I throw at it. On top of that, it also runs my Pihole and a bunch of other services through Docker. Bit of a revelation, really.
- Legogris 7y agoAs a free software alternative to Plex, Jellyfin is definitely worth considering. FSF fork of Emby, integrates well with other software like Radarr, Sonarr, Jackett etc. https://jellyfin.org/ https://jellyfin.org/
- mattl 7y agoFSF forked Emby?
- skocznymroczny 7y agoIt might not be as exciting, but I run https://dietpi.com/ https://dietpi.com/ on my RPi. It's basically a Debian distro with an easy to use installer for common things. To install Apache, Nextcloud or anything else you just select it from a long list of installers in a console user interface.
- nihonium 7y agoI use my Raspberry pi to proxy any cloud video to my LG Smart TV, at native resolution, using rclone mount and Emby Media server. It's great. I can play 4K 100mbit videos from my cloud drives directly on the TV. Side note, you can also use cloudflare free for dns, it's easy to setup.
- alexfromapex 7y agoAnd cloud flare can block some of the mischievous web traffic too
- nihonium 7y agoYes, exactly. Despite the fact that my domain is not listed anyone online, cloudflare dashboard says they blocked 1000s of attempts last month.
- whatsmyusername 7y agoEh, doubt. My guess is they're bumping those numbers based on people hitting the cloudflare edge IP not your particular DNS name. Do you have your origin whitelisted to cloudflares edge ranges? If not it can be hilariously easy to get around cloudflare (ex: Hamas.ps is behind cloudflare but runs on Hetzner https://censys.io/ipv4?q=hamas.ps https://censys.io/ipv4?q=hamas.ps)
- brnt 7y agoExcuses me for being ignorant but why would you need a DNS to stream from a cloud drive?
- nihonium 7y agoSorry for misunderstanding, you don't need to. My comment about the DNS was about OP's use of no-ip.
- tyingq 7y agoOnce you jump up into the 4GB model and are looking at "home server" or "media server" type functionality, other solutions might be more attractive. For example, used ASUS Chromeboxes are all over eBay from $50-$120 or so with a real SSD, x86-64, nice enclosure, etc. And they are easy enough to use a SeaBios ROM with for regular Linux instead of ChromeOS. Edit: not disputing the Pi is king at lower memory / lower storage / lower cost points.
- hanklazard 7y agoThis was my conclusion too. Ended up getting a certified refurb i5 Lenovo with SSD and 16 GB of ram from Micro Center for $350. Yes, more expensive than the pi+ hard drive solution but still pretty cheap overall.
- Avamander 7y ago+1 an used laptop might use a bit more power but it has an enclosure, built-in UPS, cooling and SSD, has an x86_64 CPU and probably better specs. An all-around better choice for many many purposes.
- bluedino 7y agoHard to add additional NIC (or two) to a laptop.
- oarsinsync 7y agoSimilar options on a laptop as on an RPi, at least (so, USB?)
- mceachen 7y agoI'm using a USB Ethernet dongle in my laptop. They're cheap and Linux seems to support all of them these days.
- johnpowell 7y agoI got a HP Compaq Elite 8200 with a i5 and 8GB of RAM for 50 bucks on Newegg about a month ago. And shipping was free too. I stuck in a spare ssd and 8TB drive. It is running Ubuntu. Right now it acts as a pi hole, nextcloud server, Channels DVR server, Plex Media Server, and runs Transmission. It barely breaks a sweat. I used to just have a Pi 3B+ doing duty as a pihole and nextcloud box. This works better and overall cost less than the pi once I added in the sd card, case, fan, power supply.
- freedombox 7y agoPlease consider https://freedombox.org/ https://freedombox.org/ - it is part of Debian.
- diffeomorphism 7y agoIt seems to only have images up to Raspberry 3B+, but not 4? https://freedombox.org/download/ https://freedombox.org/download/
- heyflyguy 7y agoIf you're into this sort of thing, I have really enjoyed tinkering with Odroid products. Also the homelab subreddit is pretty good. https://www.hardkernel.com/shop/odroid-hc2-home-cloud-two/ https://www.hardkernel.com/shop/odroid-hc2-home-cloud-two/
- Havoc 7y ago> homelab subreddit check out homeserver too...more towards the low end of scale rather than "I've got a xeon beast in my basement" homelab
- Legogris 7y agoI'm currently in the process of setting up a HA Hashicorp stack (Vault/Consul/Nomad) + GlusterFS cluster in my free time at home with Raspberrys and some other small-board computers. Completely overkill but it's great fun. My goal is to see just how self-reliant I can be in terms of digital services. Right now it feels completely reasonable to get to a point where the only external services I really rely on is a CA and domain registrar. Possibly DNS, and external endpoints to front traffic. If the HA part works well and I can make a failover region somewhere, self-hosted e-mail doesn't seem that unreasonable anymore. There are several attractive alternatives to RasPi (Odroid already mentioned, beware though as most of the small boards are 32bit only. Also Khadas VIM3, FriendlyELEC NanoPi, Rock Pi. Many people also seem to like Orange Pi). The earlier generation Raspis are honestly quite disappointing from a performance perspective, mostly because of the shared bus between Ethernet/Wifi/USB/storage. The 4B is actually the first to hold its ground, and still does price/performance-wise compared to the above. Honestly it feels like the market's stagnated a bit around the RK3399 and Allwinner H5/H6, hoping there's going to be a new wave of interesting stuff during 2020. A really nice feature of some of these ARM boards is that you can go so much more free (as in libre) than with x86 chips. Raspberry Pi excluded, unfortunately. If you're open to x86 and want a bit more power, Intel NUCs have been around for a good time and AMD is pushing out Ryzen NUCs now. First out is ASROCK. I've also been very happy with the PC Engines APU2 router boards - they are great as small-form-factor servers or NAS builds as well. Note that even if Raspbian is 32-bit only, you can totally run 64-bit OS's on the 3B+ and 4 series. For 3B+ there's even a pretty stable UEFI bootloader: https://www.raspberrypi.org/forums/viewtopic.php?f=50&t=249449 https://www.raspberrypi.org/forums/viewtopic.php?f=50&t=2494... For Raspi 4 you can just rebuild the kernel for aarch64 and change the config a bit. Or if you're lazy, sakaki- is providing weekly builds here: https://github.com/sakaki-/bcm2711-kernel https://github.com/sakaki-/bcm2711-kernel I have both 3B+ and 4B running vanilla 64-bit Debian Buster.
- ajphdiv 7y agoA big performance increase by putting the OS on a SSD. The read/write speed is much better than using the SD card. It takes a little tweaking to get the SSD to boot on the rpi 4, but can be done. Basically the SD card gets used a bootloader. howto: https://jamesachambers.com/raspberry-pi-4-usb-boot-config-guide-for-ssd-flash-drives/ https://jamesachambers.com/raspberry-pi-4-usb-boot-config-gu...
- rantwasp 7y agohas the disadvantage of needing the SSD (which is probably more expensive than the pi?). here is something I ran across a while back, that if I understand correctly, uses a ramdisk + overlayfs to make the whole thing faster: https://github.com/cattlepi/cattlepi https://github.com/cattlepi/cattlepi
- hajile 7y agoHere's my build $55 Pi 4 (4gb) $8 Official USB charger $25 Argon One case (could also get acrylic + ICE tower) $10 microSD card $12 Sata to usb adapter $40 Kingston 240gb SSD (we can't do over 500mb/s anyway) $120 Total You get a significant performance boost switching to a 64-bit OS. aarch64 has better SIMD guarantees, hardware AES (over 10x faster), double the registers, and generally more optimizable due to the more streamlined ISA. I haven't tested it yet, but in-memory compression could potentially help with the 4gb RAM limit.
- AnonC 7y agoPardon my ignorance. Does your bare SSD sit outside without any case (connected to the Pi via the SATA to USB cable)? Does it need any kind of heat dissipation mechanism (or cooling) at all?
- hajile 7y agoThat's up to you. You can find USB3 SATA enclosures on Amazon for around the $12 mark. There's not a big heat dissipation issue in my experience and a Pi probably isn't exactly going to be taxing the drive very much. If you don't mind the terrible $/gb ratio, you can even get USB3 thumbdrives that use an SSD.
- atum47 7y agoNow I just need to translate it to Portuguese and share it with my Dad. Thanks a lot. =)
- wheresvic3 7y agoNice! If you publish it, do send it across and I can link it :)
- bergoid 7y agoIs there a Raspberry Pi 4 case somewhere for sale that can hold a 2.5 inch HDD?
- jsight 7y agoI've often looked for this, and there are surprisingly few options. Maybe something like this would work? https://www.amazon.com/Geekworm-Raspberry-Storage-Matching-Enclosure/dp/B07GRZRW7J/ref=sr_1_3?keywords=raspberry+pi+case+hard+drive&qid=1582215950&sr=8-3 https://www.amazon.com/Geekworm-Raspberry-Storage-Matching-E...
- deleted 7y ago[deleted]
- threatofrain 7y agoWhat might people recommend for a NAS?
- theshrike79 7y agoSynology A Raspi-NAS is nice for the learning experience, but if you want a real NAS, just get one. Or build it with proper hardware and FreeNAS or a similar solution.
- wil421 7y agoFreeNAS, a supermicro motherboard, ECC memory, an i3 if it’s just a pure NAS or a Xeon if you need more power. I have the above setup with 6 WD Red drives in a NFS pool. It’s hard to justify using a Pi for a NAS unless you don’t mind your SD becoming corrupted. Are you looking to build a real NAS or a Pi NAS? You could by off the shelf but it’s not as much fun.
- threatofrain 7y agoA real NAS but I see the Pi isn’t up to it yet; too bad.
- wil421 7y agoI’ve been using FreeNAS for about a year. The community has the angry sysadmin mentality and they favor retired sever hardware but it’s not hostile or anything. The docs are decent and setup isn’t too hard. Make sure your rig can boot FreeBSD. OpenMediaVault is another Debian based distro I might check out in the future. Hardware wise I’d go with something that supports ECC and a sever grade mobo, likely intel based. Supermicro has some cool IPMI features I used to setup over LAN, no monitor or keyboard. Just a reminder to not open up your NAS to the public. I VPN to my home network if I need remote access.
- nicolaslem 7y ago+1 for FreeNAS. I recently converted my Mac mini 2012 into a FreeNAS box, I just replaced the SSD with two 2.5" HDD. No ECC but also way cheaper than the alternative I had in mind.
- ch33zer 7y agoA few insecure choices here: * fail2ban installed but no mention of actually setting up the rules. Additionally out of the box fail2ban won't work with docker containers * Wide open ports. Only open what you need * In the DNS script you are putting the username and password in the URL. This means even though you are using https anyone can see the username and password you're sending. Pass these options some other way.
- rovr138 7y agofail2ban has some defaults. Definitely not for all those ports though. But 80, 443, 22 have them Regarding DNS, the query string is encrypted on HTTPS. It can still be cached on logs on their side for example. It can be seen on the script, but the credentials would still have to be there somewhere.
- wheresvic3 7y agoYou're right in that it is better to only open ports that you require - will update :) I'm not quite sure what you mean by "Additionally out of the box fail2ban won't work with docker containers". fail2ban is installed locally on the pi.
- rovr138 7y agofail2ban works by monitoring logs. If you had installed for example your web server on a container, the logs will be on the container. Fail2ban on the host won’t be able to parse the ones inside the container (by default, needs more work).
- tyingq 7y agoI like pam_shield better than fail2ban. It's directly inline with auth, versus parsing logs, and is easier to customize for any oddball setup you might want. There's also a similar pam module called pam_tally2, which I haven't used.
- jlgaddis 7y agoI'm not familiar with pam_shield but I've used the pam_faillock module (which is similar to pam_tally2) for years and it just works(TM) [0]. In fact, here, it's automatically configured on each and every host at install-time (via the post-installation scripts in my kickstart files). I can't remember a time when I ever needed to "touch" it afterwards. (A few years ago, I evaluated pam_tally2 vs. pam_faillock and settled on pam_faillock but, unfortunately, I can't recall what led me to that choice.) --- [0]: In reality, though, it doesn't really do much. There's only two Internet-facing servers with 22/TCP open to the world -- the bastion hosts -- and only public-key authentication is permitted on those.
- wheresvic3 7y agoOne small point not mentioned in the article is that the is hooked on to a wall behind the tv so it is nicely hidden. A cheaper option would probably have been to get a proper computer (likely secondhand), which would have been more cost effective but probably take up more space :)
- kristianp 7y agoI'm using a pi 4 with ubuntu server and plex. The Android tv Plex app works really well with it. It's connected to my wifi router via an ethernet cable. I used 32 bit ubuntu as it's only a 1GB pi and 32 bit saves some ram. I had some voltage warnings when booting up, I should probably get a better power supply for it. The Usb drive is non-ssd.
- jlgaddis 7y agoI only skimmed this article but I didn't see any step where the default credentials ("pi"/"raspberry", IIRC) are changed so if you follow this guide you should expect your "home server" to be hacked and become part of a botnet shortly after you > head to your router settings and port forward 80, 443, 22 and any other ports that you might want.
- schwartzworld 7y agoin fairness, changing the password is step one on any internet connected raspberry pi.
- exclusiv 7y agoI recently setup my Pi 4 with Pi-Hole and Wireguard for VPN. My first install and config resulted in super high load. So I redid it all on a fresh card (same brand) and it was snappy. No idea what the culprit was but I'm running Raspbian, installed with a NOOBS formatted SD card I disabled swap memory and overclocked it to 2ghz which was super easy. Switched to a Flirc case because my prio case with a fan was really loud. For Wireguard I followed this guide: https://www.reddit.com/r/pihole/comments/bnihyz/guide_how_to_install_wireguard_on_a_raspberry_pi/ https://www.reddit.com/r/pihole/comments/bnihyz/guide_how_to...
- wyclif 7y agoI enjoy this blog, but I wish it had an RSS feed.
- deleted 7y ago[deleted]