Containerization of my server 🐋
Published on 10/11/2024
ContainersDockerUbuntuLinuxBashCI/CD
When I started out with my first Ubuntu server I manually installed everything that I needed. Postgres, Plex, some game servers like Minecraft and Factorio and many more.
But eventually I found out that I have a hard time making small improvements to existing applications. For Plex I wanted to auto update it, so I got a random update script from GitHub. Of course this was going to break, and it did after a while. It was also hard to find the update file because I put it all over the place. And not in my user space. Then I was getting issues with files being saved as root. Which makes cleanup difficult as I need to also be read to fix everything.
Eventually I wanted to move everything to some sort of easier setup. So I started to migrate away everything to containers. Specifically Docker Compose hence the Composes Github repository name. I could have choosen to run something like a K3s or K9s cluster. But for a small server without replication, I think using Docker Compose is just fine.
Here is a small (not really up-to-date) list of things I have running currently on my server:
Containers
- Portainer: to see and debug containers without using the CLI.
- Traefik: to proxy all connections and make them support HTTPS (SSL) only connections.
- Jellyfin: to display my media.
- Rtorrent: to download torrents.
- Flood: torrent UI to manage them online.
- Gluetun: VPN networking container
- Prowlerr: indexer for Radarr and Sonarr.
- Radarr: searches for movies.
- Sonarr: searches for series and anime.
- Bazarr: searches subtitles for all movies, series and anime.
- Jellyseer: people can request for movies, series or anime.
- Scrutiny: to see the SMART status of all drives in the system.
Installed natively, but which I want to migrate soon
- Samba: To serve files on my local network.
- Minecraft Server(s): to play on of course
- Bedrock
- Better MC Java
Scripts
I also created some scripts to more easily update all containers. Check out the repository’s scripts directory.
As example I have this simple update script, where you can give the compose folder name and it will bring all containers down, pull new versions and bring them up again.
#!/bin/bash
git pull
services=("$@")
if [ ${#services[@]} -eq 0 ]; then
services=("traefik" "portainer" "scrutiny" "jellyfin")
fi
for service in "${services[@]}"; do
cd "../$service/"
pushd .
docker-compose down
docker-compose pull
docker-compose up -d
popd
done