Raspberry Pi Self-Hosting Server
Background & Capabilities
Long history: Somewhat of a consolidation project. We have had a number of network services running on various RPI's over the years - Ad blocking, IoT Bridge services, network monitors, media servers, etc. Somewhat of a rats-nest as playthings come and go.
ServerPi is an attempt to organize this mess by creating a home server environment that can be used to host long-standing network services and as a foundation for future self-hosted apps. Including a friendly web-interface for family/nontechie access.
Initially replaced/documented our NetAidPi, which was a very old RPI (Model B!) that had been running on the network for quite a long time (Pi-hole, Murmer and some other services that I didn't even remember!). It has now become THE home for our network services and also provides Apple Homekit services replacing our long-standing HomePi.
... will likely continue to evolve ...
Level of Difficulty & Prep Time
Some networking knowledge is required (e.g. Static vs dynamic addressing, TCP ports, etc). Basic Linux administration skills will also come in handy (navigating the filesystem, editing config files, etc).
Simple setup via Dietpi. Probably <1 hour to get foundational ServerPi up and running.
Additional time will vary depending on complexity of software installed on top of DietPi.
ServerPi was built using spare parts (as usual).
Current hardware looks a little like this:
*Note: Affiliate Links, I may get kickback from Amazon if you click/buy!
Here's the what/why of our ServerPi:
Step By Step
Foundational OS Prep (DietPi IS RaspOS) with some handy optimized packages ...
After boot, run through dietpi-software to setup ServerPi packages ... this was done in stages because major packages had a quite a few dependencies & choices. Simply an attempt to find sequence that worked best ...
Stage 1 -Some Foundational software. Dietpi would install many of these but I like to know/control some of this stuff This also installs web & DB servers and PHP
Stage 3 - add Pi-Hole by itself, DietPi will walk thru setup
... Notes (so I don't forget). Our Pi-Hole setup is on phys eth0, not docker. Static IP required
Unbound = Yes (Tiny DNS server, locally hosted)
DNS Provider - Quad9 unfiltered no DNSSEC = 220.127.116.11 (I think)
Include 3rd Party lists
Privacy = Show Everything
Installation Summary: Check it and make note of initial admin PW - it's easy to miss !
Block Public access to admin console
Finally ... a few non-dietpi add-ons
apt-get install joe (my fav editor)
<something else ... I'll remember>
Pull it all Together
Here's whats/where at this point (ports):
ProFTPD, on port 21
DietPi-Dashboard @ http://<ServerPi-IP>:5252
grafana @ http://<ServerPi-IP>:3001
Pi-Hole @ http://<ServerPi-IP>/admin
Homer @ http://<ServerPi-IP>homer
Lighttpd (Web Server) on Port 80. Placeholder Page @ http://<ServerPi-IP>/
Homebridge (Apple Homekit). Web interface @ http://<ServerPi-IP:8581
A few app touchups:
ProFTPD: Config @ /etc/proftpd/proftpd.conf.
DietPi-Dashboard: Config @ /opt/dietpi-dashboard/config.toml
Set security (password protection)
Additional nodes as needed to watch over other Pi's (HomePi, SentinelPi ...)
Grafana: Connect via http://<ServerPi-IP>:3001
Add data sources and import dashboard(s) as needed. (e.g. access SentinelPi in our world)
Set Default Dashboard via Administration -> Default Preferences
PI-Hole: Connect via http://<ServerPi-IP>/admin
Login with password you remembered to record during install!
Homer to tie it all together: Config @ /var/www/homer/assets/config.yml
Worth the read: https://github.com/bastienwirtz/homer/blob/main/README.md
Migration Notes: Stuff to remember when moving after a rebuild. Don't forget /var/www!
/var/www/admin - is pi-hole admin, move at your own risk. May be best to install fresh
First run "Getting Started" to set up Admin user
Homebridge UI Backup/Restore worked like a charm for the move from HomePi
Lighttpd: Config @ /etc/lighttpd/lighttpd.conf
Redirect default (/) homepage to homer (inserted right after server.document-root stuff)
# TPed was here - attempt to make homer startpage
# Redirect directive for default homepage
url.redirect = ("^/$" => "/homer/index.html")
Also enabled directory listings so it displays files/directories stored under /var/www/html
# TPed was here again - enable directory listing
server.dir-listing = "enable"
Notes & Log
Later in October .... Have to be careful to watch requirements of Homebridge plug-in's. Dietpi can't watch over these
Added ffmpeg via dietpi-software because I noticed Homekit cameras were not responding.
October 2023 - Rebuild with fresh Dietpi (Bookworm) and Homebridge in Dietpi list of optimized software!
Added Apple HomeKit Services to ServerPi's list of duties. HomePi has served it's time and ServerPi seemed to have plenty of horsepower
Eliminated Play-Stuff ... no docker/portainer (until needed), OwnCloud wasn't really needed since ServerPi will now remain relatively static, no grampsweb, etc
Migration to new ServerPi to ... pretty easy
Homebridge via UI: Download Backup on old, Restore backup on new!
Homer: FTP Drag 'n Drop
Sept 2023 - Figuring out Portainer ... using grampsweb (geneology). Deployed OK (watch for duplicate ports) but ate the PI alive!
Looked like memory usage and swapping/thrashing ... stopped/removed stacks, containers and frinds .... Will regroup
9/3/2023 - Added Avahi so we can find/access serverpi.local