How to Update Portainer

  • Post author:
  • Post last modified:May 29, 2022
  • Post category:Linux

In this tutorial, we’ll take a look at how to update Portainer.

Portainer is an application that you can use to manage your Docker containers. It can be installed on various different devices that run Docker, but periodically, there are updates that must be installed.

When an update is required, you’ll see a message in the bottom left of Portainer informing you that an update is required.

how to update portainer

The update process is slightly different than it is to update other containers since you can’t stop Portainer and still access it from Portainer. However, you can easily update it if you can get to the command line where you have Docker and Portainer installed.

How to Update Portainer

Now that we understand exactly what Portainer does, we’re going to look at how to update Portainer.

1. Connect to the host where Docker is installed. In the example below, I used SSH to access Docker, but you can access it however you’d like.

ssh [email protected]_IP

2. Run the command below to get the Docker containers that you have installed and get the container ID for Portainer.

sudo docker container ls
image 103

3. Run the command below to stop the Portainer container.

sudo docker stop portainer
image 104

NOTE: If the command above does not work, stop the container using the container ID

sudo docker stop [CONTAINER_ID]
image 105

4. Delete the Portainer container by running the command below.

NOTE: If your prior instance of Portainer did not have a persistent volume, your data/configuration will be lost.

Ensure that you have the important data that exists in the /data location of the Portainer container or you will have to recreate your user account and modify your settings.

sudo docker rm portainer
image 106

NOTE: If the command above does not work, delete the container using the container ID.

sudo docker rm [CONTAINER_ID]

5. Pull the latest version of the Portainer container.

sudo docker pull portainer/portainer-ce:latest
image 107

6. Recreate the Portainer container using the command below.

sudo docker run -d -p 8000:8000 -p 9000:9000 -p 9443:9443 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest
image 108

7. You can log back into Portainer and it will be updated!

image 109

Conclusion – How to Update Portainer

This tutorial looked at how to update Portainer. Portainer is the way I’ve been managing my Docker containers for a long time and it’s worked flawlessly. There are other options available, but this is an easy way that you can update and manage your containers.

Thanks so much for checking out the tutorial on how to update Portainer. If you have any questions on how to update Portainer, please leave them in the comments!

Please share if this helped you!