Yahoo
Advertisement
Advertisement
Advertisement
Advertisement

Docker Compose made my homelab 10 times easier to manage—here’s why

Docker Compose file for Audiobookshelf open in the Portainer stack editor.
Patrick Campanale / How-To Geek

I have used Docker for over half a decade now, and the vast majority of that time I've used Docker Run commands. I recently switched to Docker Compose, and it made my homelab so much easier to manage.

I always used Docker Run commands because they're straightforward

I just translated them to be Portainer launch commands

The Hello World Docker container being run on an Ubuntu server.

I went straight from using Docker in Unraid to using Docker in Portainer , which meant I basically never touched Docker Compose files. Docker on Unraid is very point and click as most of the apps have templates that auto configure them.

With Portainer, I wanted something that felt familiar, so I just modified the Docker Run commands (or even Docker Compose files) to work within the normal launch parameters for Portainer. Effectively, i was using Docker Run, just with extra steps.

Advertisement
Advertisement

I liked this method because it was familiar, relatively simple, and showed me all of the options up front instead of me having to figure out what to type into a command. Portainer really made Docker easy to use. The problem is, that doesn't help when moving to a different system.

Docker Compose, however, is system-agnostic and works identically no matter where you use it. Eventually, I decided to ditch my old way of launching containers and fully embrace Docker Compose and I've been very happy with the change.

Docker Compose is way easier to customize

It's all done in YAML, instead of settings screens

Docker Compose stacks list in Portainer with Audiobookshelf Duplicati Linkstack Postiz ReadDeck and Speedtest Tracker.

If you've never used Docker Compose before, it's essentially just a YAML file that tells Docker what to do. You can include multiple containers within a single Compose file and they all automatically share a local network, which makes it very convenient for larger services.

You can also view and edit Compose files after launching a service. With normal Docker Run commands in the terminal, that's not possible. You have to manually stop that container and then re-type the command to launch the container again.

Advertisement
Advertisement

With something like Portainer, you're effectively rebuilding the container and have to change the settings you want and then de-deploy it. It's a bit simpler then normal Docker Run commands, but it's still not all that simple.

Using Docker Compose, I'm now able to just open up the Compose file, make whatever modifications I need to it, then redeploy the Compose file. It's so much simpler now to make a change to a container then it used to be.

Docker Compose allows me to move a container to a different system easily

Copy and pasting the Compose file is all that's required

Three mini PCs stacked on top of each other in a homelab.

Patrick Campanale / How-To Geek

Moving containers to different systems is the exact reason that I moved everything to Compose. A month or so ago, I had a pretty catastrophic data loss event happen in my homelab—and it was all my fault.

Thankfully I didn't lose anything too important, but it was still a royal pain to get everything working again. This included any Docker containers I had to re-launch. I lost all of the configurations for the containers. For the containers I didn't lose, I didn't have any real way to back up their launch commands.

Advertisement
Advertisement

So, I decided to recreate all of my containers using Docker Compose. It was tedious, but it has definitely been worth it in the end. Now, I'm able to take the same Docker Compose file that's running on one system, copy and paste it to another, and that Docker stack is up and running in seconds.

It's so convenient, and I don't know why I didn't embrace Docker Compose before. Take today, for instance. As of writing this, Plex recently announced the price hike for Lifetime Plex Pass .

While I already have a Lifetime Plex Pass, I wanted to try out Jellyfin as it had been a while since I last used it. I was able to simply open up my Plex Compose file, copy the file paths for where my media is stored, and even copy the device paths for the transcoding device, and paste them into the Jellyfin Compose file.

Within five minutes, I had Jellyfin up and running with full transcoding support and reading all of the movie and TV show libraries that Plex already had access to. I didn't have to go to multiple tabs to see what settings were there, I didn't have to copy and paste things line-by-line, and I didn't have to try to remember which toggles to flip.

Advertisement
Advertisement

Since it's all YAML, and it's on the same system, all of the ancillary information, like the media and device paths, are identical for both streaming platforms. This made it super simple to deploy Jellyfin.

I've also used the same technique to move Docker stacks to a completely different system. I have three mini PCs running in my homelab , as well as a full-size desktop and two NAS servers—all of which run Docker.

So, I'm able to simply take the Compose file and any configuration files stored on the server, move it to a new system, and spin it up in seconds.


Docker Compose is a homelab change I wish I made years ago

At the end of the day, Docker Compose simply makes my homelab easier to manager. I wish I employed it long ago, as it would have saved me quite a bit of heartache when moving containers to new servers.

Advertisement
Advertisement

If you're not already using Docker Compose, try it out. It's not as intimidating as you might think, and it'll vastly improve your Docker workflow.

Advertisement
Advertisement
Mobilize your Website
View Site in Mobile | Classic
Share by: