Always match the agent version to the Portainer Server version. In other words, when you're installing or upgrading to Portainer 2.13.1 make sure all of the agents are also on version 2.13.1.
Before beginning any upgrade, we highly recommend taking a backup of your current Portainer configuration.
Upgrading your Portainer Server
Starting from Portainer CE 2.9 and BE 2.10, HTTPS is enabled by default on port 9443. These instructions will configure Portainer to use 9443 for HTTPS and do not expose 9000 for HTTP. If you need to retain HTTP access, you can add:
to your command.
You can also choose to completely disable HTTP after the upgrade. Before you make Portainer HTTPS only, make sure you have all your Agents and Edge Agents already communicating with Portainer using HTTPS.
This article assumes that you used our recommended deployment scripts.
To upgrade to the latest version of Portainer Server, use the following commands to stop then remove the old version. Your other applications/containers will not be removed.
docker stop portainer
docker rm portainer
Now that you have stopped and removed the old version of Portainer, you must ensure that you have the latest version of the image locally. You can do this with a docker pull command:
To provide your own SSL certs you may use --sslcert and --sslkey flags as below to provide the certificate and key files. The certificate file needs to be the full chain and in PEM format. For example, for Business Edition:
The newest version of Portainer will now be deployed on your system, using the persistent data from the previous version, and will also upgrade the Portainer database to the new version.
When the deployment is finished, go to https://your-server-address:9443 or http://your-server-address:9000 and log in. You should notice that the update notification has disappeared and the version number has been updated.
To upgrade to the latest version of Portainer Agent, use the following commands to stop then remove the old version. Your other applications/containers will not be removed.