Back in the day it was nice, apt get update && apt get upgrade and you were done.

But today every tool/service has it’s own way to being installed and updated:

  • docker:latest
  • docker:v1.2.3
  • custom script
  • git checkout v1.2.3
  • same but with custom migration commands afterwards
  • custom commands change from release to release
  • expect to do update as a specific user
  • update nginx config
  • update own default config and service has dependencies on the config changes
  • expect new versions of tools
  • etc.

I selfhost around 20 services like PieFed, Mastodon, PeerTube, Paperless-ngx, Immich, open-webui, Grafana, etc. And all of them have some dependencies which need to be updated too.

And nowadays you can’t really keep running on an older version especially when it’s internet facing.

So anyway, what are your strategies how to keep sanity while keeping all your self hosted services up to date?

  • vegetaaaaaaa@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    59 minutes ago
    • use APT repository when possible -> then unattended-upgrades
    • For OCI images that do not provide tagged releases (looking at you searxng…), podman auto-update
    • for everything else, subscribe to releases RSS feed, read release notes when they come out, check for breaking changes and possibly interesting stuff, update version in ansible playbook, deploy ansible playbook
  • totoro@slrpnk.net
    link
    fedilink
    English
    arrow-up
    8
    ·
    4 hours ago

    Wow, that sounds like a nightmare. Here’s my workflow:

    nix flake update
    nixos-rebuild switch
    

    That gives me an atomic, rollbackable update of every service running on the machine.

  • 1984@lemmy.today
    link
    fedilink
    English
    arrow-up
    2
    ·
    5 hours ago

    I just run watchtower in docker. It will watch all your other docker images and update them to latest version automatically if you want.

    It works fine but with time, I stopped thinking i need to be on latest version all the time. It really isnt very important.

    Just a few of my services are open on the internet, mainly caddy and wireguard.

  • conrad82@lemmy.world
    link
    fedilink
    English
    arrow-up
    6
    ·
    7 hours ago

    I do it manually. update the container version and docker pull and run

    I have reduced the number of containers to ones i actually use, so it is manageable.

    i use v2 instead of v2.1.0 docker container tags if the provider don’t make too many bleeding edge changes between updates

  • mlfh@lm.mlfh.org
    link
    fedilink
    English
    arrow-up
    17
    ·
    11 hours ago

    Everything I run, I deploy and manage with ansible.

    When I’m building out the role/playbook for a new service, I make sure to build in any special upgrade tasks it might have and tag them. When it’s time to run infrastructure-wide updates, I can run my single upgrade playbook and pull in the upgrade tasks for everything everywhere - new packages, container images, git releases, and all the service restart steps to load them.

    It’s more work at the beginning to set the role/playbook up properly, but it makes maintaining everything so much nicer (which I think is vital to keep it all fun and manageable).

    • Jeena@piefed.jeena.netOP
      link
      fedilink
      English
      arrow-up
      6
      ·
      11 hours ago

      Yeah, For some reason I didn’t think of ansible even though I use it at work regularly. Thanks for pointing it out!

      • SayCyberOnceMore@feddit.uk
        link
        fedilink
        English
        arrow-up
        3
        ·
        9 hours ago

        Just a word of caution…

        I try to upgrade 1 (of a similar group) manually first to check it’a not foobarred after the update, then crack on with the rest. Testing a restore is 1 thing, but restoring the whole system…?

  • irmadlad@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    ·
    8 hours ago

    I keep it simple, although reading down through the thread, there are some really nice and ingenious ways people accomplish about the same thing, which is totally awesome. I use a WatchTower fork and run it with --run-once --cleanup. I do this when I feel comfortable that all the early adopters have done all the beta testing for me. Thanks early adopters. So, about 1 a month or so, I update 70 Docker containers. As far as OS updates, I usually hit those when they deploy. I’m running Ubuntu Jammy, so not a lot of breaking changes in updates. I don’t have public facing services, and I am the only user on my network, so I don’t really have to worry too much about that aspect.

    • Jeena@piefed.jeena.netOP
      link
      fedilink
      English
      arrow-up
      5
      ·
      10 hours ago

      Because you point to :latest and everything is dockerized and on one machine? How does it know when it’s time to upgrade?

      • Overspark@piefed.social
        link
        fedilink
        English
        arrow-up
        5
        ·
        10 hours ago

        Yeah only for :latest containers, that’s true. It automatically runs a daily service to check whether there are newer images available. You can turn it off per container if you don’t want it.

        One of the nice things about it is that I have containers running under several different users (for security reasons) so that saves me a lot of effort switching to all these users all the time.

          • prenatal_confusion@feddit.org
            link
            fedilink
            English
            arrow-up
            5
            ·
            edit-2
            6 hours ago

            Depends on what you want to do. For production with sensitive data, yes it is. For my ytdl and jellyfin? Perfectly fine.

          • Overspark@piefed.social
            link
            fedilink
            English
            arrow-up
            3
            ·
            6 hours ago

            Depends. There are a few things I update by hand, but as long as you have proper backups it’s generally safer to run the latest versions of things automatically if you don’t mind the possibility of breakage (which is very rare in my experience). This is in the context of self-hosting of course, not a business environment.

    • BlackEco@lemmy.blackeco.com
      link
      fedilink
      English
      arrow-up
      2
      ·
      10 hours ago

      I guess auto merge isn’t enabled, since there’s no way to check if an update doesn’t break your deployment beforehand, am I right?

        • BlackEco@lemmy.blackeco.com
          link
          fedilink
          English
          arrow-up
          2
          ·
          8 hours ago

          Yes, but usually when you use automerge you should have set up a CI to make sure new versions don’t break your software or deployment. How are you supposed to do that in a self-hosting environment?

          • tofu@lemmy.nocturnal.garden
            link
            fedilink
            English
            arrow-up
            1
            ·
            6 hours ago

            Ideally, you have at least two systems, test updates in the dev system and only then allow it in prod. So no auto merge in prod in this case or somehow have it check if dev worked.

            Seeing which services are usually fine to update without intervening and tuning your renovate config to it should be sufficient for homelab imho.

            Given that most people are running :latest and just yolo the updates with watchtower or not automated at all, some granular control with renovate is already a big improvement.

  • SayCyberOnceMore@feddit.uk
    link
    fedilink
    English
    arrow-up
    3
    ·
    9 hours ago

    I don’t use docker, etc, so for me, if it’s in the normal Arch repos or AUR then I don’t need to think about it until there’s a .pacnew file to look at

    Then, it’s just the odd git pull on literally 2 devices.

    All organised by ansible…

    (well except the .pacnew, but I think it’s nice to keep in touch with the packages)

  • halcyoncmdr@piefed.social
    link
    fedilink
    English
    arrow-up
    5
    ·
    10 hours ago

    All of my self-hosted systems are on a TrueNAS system and using the built-in app system (basically docker). It notifies me when they’re needing updates, and has a single click update process for everything. I just login weekly to see if the button is yellow, then check on it like 15 minutes later to see if anything failed to update. Yeah they’re all on the same hardware, which is probably bad, but nothing there is strictly necessary, it’s all just media stuff and for fun.

    The one service that is separate is Pangolin on a DigitalOcean droplet. I just handle that manually when it says there’s an update. Still effectively just docker, but no easy button.

    I could automate these more, but I would spend more time setting it up than I would save since it only takes me a couple minutes maybe once a week.

  • ccryx [he/him]@discuss.tchncs.de
    link
    fedilink
    English
    arrow-up
    1
    ·
    9 hours ago

    All my services run in podman containers managed by systemd (using quadlets). They usually point to the :latest tag and I’ve configured the units to pull on start when there is a new version in my repository. Since I’m using opensuse microos, my server (and thus all services) restart regularly.

    For the units that are configured differently, I update the versions in their respective ansible playbooks and redeploy (though I guess I could optimize this a bit, I’ve only scratched the surface of ansible).