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 it | Inside the container or VM that runs Docker. The script has no Proxmox VE host check |
| Requires | Docker and the Compose plugin, already installed. Missing either one exits with code 10; the script does not offer to install Docker |
| Supported OS | Not checked. The script's own curl bootstrap uses apt-get |
| Port | 9443 (HTTPS) |
| Source | tools/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:
| Prompt | Answer |
|---|---|
Install Portainer? (y/N) | y installs. Anything else exits |
When /opt/portainer/compose.yaml exists or a container named portainer is found:
| Prompt | Answer |
|---|---|
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
| Item | Value |
|---|---|
| Compose project | /opt/portainer/compose.yaml, downloaded from https://downloads.portainer.io/ce-sts/portainer-compose.yaml |
| Update helper | /usr/local/bin/update_portainer |
| Address | https://<ip>:9443 |
| Credentials | None. 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:
| Situation | What the update does |
|---|---|
/opt/portainer/compose.yaml exists | docker compose pull, then docker compose up -d --remove-orphans in /opt/portainer |
The portainer container carries Compose labels and its project directory still exists | Pulls and restarts only that service, using the project's recorded Compose files |
A standalone portainer container | Pulls 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.