Rebuilding my home server

Have you ever had the urge to reinstall a machine from scratch? Maybe you’ve found a better way to do something and feel a clean install would be a good idea?

That’s what I thought a couple of weeks ago. My home server had been running for a couple of years and I’d used it as a combination of a production and test machine. Various things were installed all over the place and I felt the need for a fresh start.

A few hours into the process I started to wish I hadn’t bothered… all those little things I’d fixed on the fly over the years came back to haunt me.

The main drivers behind the rebuild were to migrate my Home Assistant instance to Docker, for ease of maintenance, and to upgrade to the latest ZoneMinder version. I’ll write separate posts on each of those, because there were plenty of headaches getting them all running smoothly. Unsurprisingly, Home Assistant was the easiest to set up and ZoneMinder far and away the hardest.

I considered splitting the tasks across virtual machines and having little more than a hypervisor on the bare metal. In the end I chose not to take that approach. My home “server” is an old i5 mini-desktop with 8GB of RAM. That’s plenty of grunt for what I need to run, but splitting the RAM and cores across VMs would be a tricky juggling act.

I decided on a rule of thumb that if a package was available in the core OS repositories I’d run it directly on the OS, otherwise I’d try to find a Docker solution. I’m running on CentOS 7, so I included the EPEL repo and later extend it to RPM Fusion. Since I wanted to use Docker I also added the Docker CE repository.

The only exception so far has been for Telegraf, which I’m using to monitor server stats. it has to be able to see the host filesystems and network, so it’s easier to run it outside of Docker rather than try to map everything into the container.

My server is now running:

  • Apache, running multiple virtual hosts: a proxy to Home Assistant, Zoneminder and one for other ad-hoc personal projects.
  • MySQL for ZoneMinder and the personal projects.
  • ZoneMinder, running directly on the server. I’d have preferred to use a Docker container but compromised for reasons I’ll come back to in my Docker post.
  • Telegraf, to monitor host stats (CPU, memory etc), running directly on the server
  • Home Assistant running in a Docker container.
  • InfluxDB in a Docker container to store time series data from Home Assistant and Telegraf.
  • Grafana in a Docker container to display data from InfluxDB.
  • The Mosquito MQTT broker to work around a minor issue with Home Assistant.
  • Scripts to update LetsEncrypt certificates for the Apache virtual hosts.
  • Script to update the DDNS entries for the virtual hosts.

And last but by no means least:

  • Scripts to take regular backups and copy them to my Synology NAS. These get copied to cloud storage automatically using Cloud Sync on the Synology.

To complete the roundup I’m also using Surveillance Station on the Synology to complement ZoneMinder. I may yet swap over completely – I’m not completely sold on either ZoneMinder or Surveillance Station as ideal solutions for my requirements.

There’s more on my to-do list, including:

  • Improving the motion detection using ZoneMinder to get meaningful alerts and automatically backup motion clips to cloud storage.
  • Reinstating voice control for Home Assistant with either Alexa or Google Assistant. The old emulated hue method would be OK for Alexa, but full integration would be better and I’m toying with the idea of switching from Alexa to Google anyway.
  • Possibly reinstalling the Zato ESB, as it’s an easy way to get ad-hoc integrations running.
  • Setting up proper alerting of all of this stuff so that I get notified if it isn’t working. Grafana has an alerting capability, so I’ll start by taking a look at that.

I’d taken some time out from playing with home automation, but this has certainly got me back into the swing of it with plenty left to do…

in Home Automation

Related Posts