Skip to main content
Community Scripts logo
Skip to Content
Tools & Add-onsAdd-ons

Portainer

Run Portainer CE as a Docker Compose project on a system that already has Docker.

portainer.sh downloads Portainer's own Compose file and starts it. It can also update a Portainer container that was created some other way.

Run itInside the container or VM that runs Docker. The script has no Proxmox VE host check
RequiresDocker and the Compose plugin, already installed. Missing either one exits with code 10; the script does not offer to install Docker
Supported OSNot checked. The script's own curl bootstrap uses apt-get
Port9443 (HTTPS)
Sourcetools/addon/portainer.sh

Run

bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/addon/portainer.sh)"

Prompts

On a system without Portainer:

PromptAnswer
Install Portainer? (y/N)y installs. Anything else exits

When /opt/portainer/compose.yaml exists or a container named portainer is found:

PromptAnswer
Uninstall Portainer? (y/N)Asked only when /opt/portainer/compose.yaml exists. y removes it
Update Portainer? (y/N)y updates. Anything else exits with No action selected

What it creates

ItemValue
Compose project/opt/portainer/compose.yaml, downloaded from https://downloads.portainer.io/ce-sts/portainer-compose.yaml
Update helper/usr/local/bin/update_portainer
Addresshttps://<ip>:9443
CredentialsNone. Portainer asks you to create the admin account on first access

Update

Run update_portainer, answer y to the update prompt of the script, or let the container's update command offer it (see how update finds add-ons).

The update method depends on how Portainer was installed:

SituationWhat the update does
/opt/portainer/compose.yaml existsdocker compose pull, then docker compose up -d --remove-orphans in /opt/portainer
The portainer container carries Compose labels and its project directory still existsPulls and restarts only that service, using the project's recorded Compose files
A standalone portainer containerPulls the image. If it changed, the container is removed and recreated with the same restart policy, network mode, privileged flag, user, port bindings, mounts, environment and command. If the new container fails to start, the previous image is started again and the script exits with code 10

An update also creates /usr/local/bin/update_portainer when it is missing.

A container named portainer that does not use a portainer-ce or portainer-ee image stops the script with code 10.

Remove

Offered only for an installation made by this script. It runs docker compose down --volumes --remove-orphans in /opt/portainer, deletes /opt/portainer and /usr/local/bin/update_portainer.

--volumes deletes the Portainer data volume, so users, settings and stack definitions stored in Portainer are gone. Containers that Portainer managed keep running. Docker itself is not removed.

A Portainer container that was not installed by this script can be updated but not uninstalled with it.