Having a home server has many benefits:
- Spotify-connected speakers 🔈
- wifi printing 🖨
- automated laptop backups over wifi 💿
- and more! 😱
And you might find this useful, when you have:
- unused speakers
- a wired, usb-only printer
- and a laptop that hasn’t been backed up in a year
And I did. And I had an unused Raspberry Pi I could use as a home server. But I kept procrastinating on setting it up.
Because I knew that not only did I have to do a lot of initial configuration, I’d have to repeat the entire process if my server’s storage failed. And Paspberry Pis use SD cards, which have a reputation for higher failure rates.
Of course, there are software solutions to this. They’re all some form of configuration and deployment, and I’d loosely categorize them into three areas:
- Push-based systems
- Pull-based systems
- Docker-based, pull-based systems
Each has their merits, and these are just a subset of the tools that exist.
For my home setup, I opted for Ansible. I did this because I:
- don't want to host anything
- want a fairly simple solution
- can easily change Ansible to ansible-pull, if I want devices to pull updates from a git repo
- don't care about docker--I won't be using a variety of architectures or OSes (I just have a few Pis)
- can easily figure out the IP of all of my Pis and connect to them directly (a requirement, for Ansible)
This solved my problems, and even though though it took a bit of extra time to set things up with Ansible, it was maybe 2-3x the time it’d take me to run the plain bash commands. And setting up my second Raspberry Pi was much faster as a result.
My config sets up the following:
- SSH via your public key instead of password
- ZSH/ohmyzsh set up with Agnoster as the default theme when you SSH in
- Spotifyd set up (just plug in a speaker and you’ve got Wifi speakers)
- Hostnames match your pi’s inventory name
And I’ve made it open source. Here it is on Github, feel free to fork it for your personal setup.