Upgrade a Standalone Docker Deployment

Docker Standalone

Assuming you've used our recommended deployment scripts: when upgrading to the latest version of Portainer, use the following commands:

docker stop portainer
docker rm portainer

Those 2 commands will stop and remove the container respectively. Doing this will NOT remove your other applications/containers/etc.

Now that you have stopped and removed the old version of Portainer, you can run this command

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

That will deploy the newest version of Portainer on your system, using the persistent data and upgrade the DB

Now you can go to http://your-server-address:9000 and login. You should notice that the bottom left corner looks different than it did before. There is no more update nag and the version is no longer shown next to the Portainer logo.

Upgrading from Version <1.24.1

Upgrades from versions prior to version 1.24.1 require an intermediate upgrade to portainer/portainer:1.24.1 prior to upgrading to the current release. Similar to the steps above, we stop and remove the container and run the 1.24.1 release of portainer.

docker stop portainer

docker rm portainer

docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always --pull=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer:1.24.1
At this point, you are running version 1.24.1 which can be verified by to http://your-server-address:9000, logging in and confirming the version number in the lower left. To complete the upgrade, perform the steps defined in the previous section.

Agent Only Upgrade

When upgrading to the latest version of Portainer Agent, use the following commands:

docker stop portainer_agent
docker rm portainer_agent

Those 2 commands will stop and remove the container respectively. Doing this will NOT remove your other applications/containers/etc.

Now that you have stopped and removed the old version of Portainer Agent, you can run this command

docker run -d -p 9001:9001 --name portainer_agent --restart=always --pull=always -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker/volumes:/var/lib/docker/volumes portainer/agent

Notes

Contribute to these docs