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


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.

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

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.


Illustration of the Docker logo, featuring a stylized whale carrying containers and a NAS server.


The “lazy” way to manage Docker Containers like a DevOps pro

You get a keyboard-first UI to start/stop containers, watch logs, and debug easily without leaving the terminal.

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. Credit: 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.

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.

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.

KAMRUI Hyper H1 mini PC.

Brand

KAMRUI

CPU

AMD Ryzen 7 7735HS

Graphics

AMD Radeon 680M

Memory

16GB LPDDR5

Storage

512GB NVMe

The KAMRUI Hyper H1 mini PC is perfect for setups that need a high-performance desktop without spending an arm and a leg. It boasts the AMD Ryzen 7 7735HS 8-core 16-thread processor and 16GB of LPDDR5 RAM (which is not user-upgradable). The pre-installed 512GB NVMe drive can be swapped out for a larger one though, and there’s a second NVMe slot for extra storage if needed.



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.

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.



Source link

Leave a Reply

Subscribe to Our Newsletter

Get our latest articles delivered straight to your inbox. No spam, we promise.

Recent Reviews


Reaching people who have been let down so many times they’ve stopped expecting anything different takes time, consistency, and trust. The Winter Surge project does all these things and more.

Running every November to March for the past four years, the Winter Surge project – part of our Higher Needs Floating Support service – provides high support temporary accommodation for 17 beds, daily welfare checks, and intensive, trauma-informed care for Bristol’s most entrenched rough sleepers.

Commissioned by Bristol City Council as part of its cold weather provision, it brings together a powerful network of partners including St Mungo’s Outreach, Social Care, Homeless Health, drug and alcohol services and housing providers.

Team Manager Sam Scott has been involved in shaping the project from the start – from planning how it works and selecting temporary accommodation providers, to troubleshooting, managing risk, and feeding back learning to improve the service year-on-year. She says it has been a privilege:

Bristol City Council gave me the opportunity to run Winter Surge and the autonomy to shape it into what it’s become. From the planning stages right through to being on the ground – it’s an extraordinary project to be part of.”

A landmark year

This winter, 42 people came into the service and not one of them went back to the streets. This is the result of a small, skilled team of support workers focused on stabilisation, move-on planning, and wrap-around support covering mental health, safeguarding, benefits, addiction, and wellbeing. After the project ended on 31 March, the wider team makes sure clients move on from the service smoothly with no gap in care.

There are some truly amazing personal stories hidden behind the headline numbers. Four clients who had resisted support for years agreed to come in and stayed for the full duration. One man, who had been living with undiagnosed cancer for over three years, was supported by the team to access hospital treatment. He has now had two major operations and is receiving ongoing care. Sam said:

It’s our patient, trauma-informed relationship building that makes all the difference. I’m so proud of the team and the work we’ve done, particularly this year when not one person went back onto the streets.”

Building trust where it’s been broken

At the heart of the Winter Surge is a commitment to breaking the cycle that sees the most vulnerable people going through many services and feeling constantly let down. The project successfully reduced evictions, improved access to housing, rebuilt confidence in receiving support, and promoted a My Team Around Me approach, ensuring every agency took genuine ownership of their role in a client’s journey.

This is what person-centred, trauma-informed care looks like in practice, and this year it worked for every single person who walked through the door.

Image L-R: Amy O’Loughlin, Sam Scott, Emma Ireland



Source link