How to update containers in Portainer with 3 clicks

How to update containers in Portainer with 3 clicks

Yes, it really is as simple… with one condition.

Disclaimer

This will only work if all of the relevant data/settings are in external volumes or were passed in as ENV variables. It depends on what tag you are using for your image, most people will be running some form of “Lastest” which is what I will be showing here.

Most of the containers that I run are from Linuxserver.io, you can find their containers here: https://hub.docker.com/u/linuxserver/. They are a great collective that has a lot of quality self-host applications already made and they are consistently updated. All of their docker containers are guaranteed to work with this method.

The 3 clicks

Okay, this is actually 4 clicks unless you are already on the container that you want to update.

Select the container you want to update

Select on the Container you want to update

Click on Recreate

You may want to gracefully shutdown your container and save any work/jobs that may be running. If not Portainer will shut it down for you.

This is the magic set right here. Since Portainer is pretty much magic, with some awesome coding thrown in there, it will recreate the same container along with all of the same ENV variables that you created it with along with any other changes you made after.

By “other changes” I do NOT mean any changes that occurred within the container that you manually did. If you added another network to the container or if you edited one of the ENV vars then it will launch with those same changes.

Conclusion

The conclusion is to go do it yourself! Make sure to take the proper backups though just in case something goes wrong. You should always have a plan B and you should always be backing up your docker configs/volumes if they are within a reasonable size.

Thanks to my friend Taegan for the inspiration for this post.