Docker

How to Upgrade Portainer (Docker Web UI) to the Latest Version

Portainer is a web-based management software for Docker. If you have Portainer installed on your Docker host and a newer version of Portainer is available, you might want to upgrade to the latest version of Portainer to get the newest features and bug fixes.

In this article, we will show you how to upgrade Portainer (installed on your Docker Host) to the latest version.

Topic of Contents:

  1. Checking the Currently Installed Version Number of Portainer
  2. Stopping the Portainer Docker Container
  3. Removing the Portainer Docker Container
  4. Downloading the Latest Version of the Portainer Docker Image
  5. Upgrading Portainer to the Latest Version
  6. Checking If Portainer Is Upgraded to the Latest Version
  7. Conclusion

Checking the Currently Installed Version Number of Portainer

To find the version of the installed Portainer on your Docker Host, visit the Portainer web UI from a web browser and log in to your Portainer account.

The version number should be printed on the left-bottom corner of the Portainer Web UI. In our case, we have Portainer 2.9.0 installed on our Docker host.

A screenshot of a computer Description automatically generated

Stopping the Portainer Docker Container

Before Portainer can be upgraded, you must stop the Portainer Docker container with the following command:

$ docker stop portainer

Removing the Portainer Docker Container

The older Portainer Docker container also needs to be removed to replace it with a new and updated one.

To remove the Portainer Docker container, run the following command:

$ docker rm portainer

Downloading the Latest Version of the Portainer Docker Image

You need to download the latest version of the Portainer Community Edition (CE) or Portainer Enterprise Edition (EE) Docker image.

To download the latest version of the Portainer Community Edition (CE) Docker image, run the following command:

$ docker pull portainer/portainer-ce:latest

To download the latest version of the Portainer Enterprise Edition (EE) Docker image, run the following command:

$ docker pull portainer/portainer-ee:latest

The latest version of the Portainer Docker image is being downloaded. It takes a while to complete.

At this point, the latest version of the Portainer Docker image should be downloaded.

A screenshot of a computer Description automatically generated

Upgrading Portainer to the Latest Version

To create a Portainer Docker container using the latest Portainer Community Edition (CE) Docker image, run the following command:

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

To create a Portainer Docker container using the latest Portainer Enterprise Edition (EE) Docker image, run the following command:

$ docker run -d -p 8000:8000 -p 9443:9443 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ee:latest

NOTE: Here, the “-v portainer_data:/data” mounts the “portainer_data” volume to the “/data” directory of the upgraded Portainer Docker container. When you remove the old Portainer Docker container, the “portainer_data” volume retains the data of the Portainer container. The newer Portainer container will use it as well.

If you’re using a directory path of your Docker host instead of a Docker volume to store the data of Portainer, replace “-v portainer_data:/data” in the previous commands with “-v /docker-host/portainer/data/directory:/data”. Here, the “/docker-host/portainer/data/directory” is the directory path of the Docker host where you store the old Portainer data.

A new Portainer Docker container that uses the latest Portainer Docker image should be created.

A screenshot of a computer Description automatically generated

Checking If Portainer Is Upgraded to the Latest Version

To verify if Portainer is upgraded to the latest version, visit the Portainer web UI from a web browser and check the version number at the bottom-left corner. As you can see, we are running Portainer 2.19.1 which is the latest version of Portainer at the time of this writing.

Conclusion

In this article, we showed you how to upgrade the Portainer Docker web UI to the latest version on your Docker host.

About the author

Shahriar Shovon

Freelancer & Linux System Administrator. Also loves Web API development with Node.js and JavaScript. I was born in Bangladesh. I am currently studying Electronics and Communication Engineering at Khulna University of Engineering & Technology (KUET), one of the demanding public engineering universities of Bangladesh.