Portainer
Install Portainer
SSH into the server you wish to install Portainer on
Copy paste the below commands to install Docker (assumes Ubuntu)
sudo apt-get update sudo apt-get install ca-certificates curl gnupg sudo install -m 0755 -d /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg sudo chmod a+r /etc/apt/keyrings/docker.gpg echo \ "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt-get update sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-pluginRun the below command to create your Portainer container
docker run -d --label=com.centurylinklabs.watchtower.enable=true -p 8000:8000 -p 9443:9443 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer:/data portainer/portainer-ce:latestI would suggest installing Portainer using this command (rather than the one provided by Portainer themselves) as it adds a WatchTower label to enable auto-updates, which we will set up later in this doco
Run the below command and confirm you see that the Portainer container is running
docker up
Configure Portainer
Now that Portainer is installed, we can browse to the webUI and configure it
Account Creation
Browse to
https://YOURSERVERIP:9443Create your credentials
Save them to your password vault
Create a stack to update Portainer
This will deploy a Watchtower container which will update any apps with the label com.centurylinklabs.watchtower.enable=true . This allows for automatic updates for the Portainer container
Navigate to stacks
Create a new stack and provide the below code
Click on Deploy
This is NOT a recommended solution for updating containers. This guide will only assist you with updating Portainer, as it is potentially a public facing resource and needs to be patched. The WatchTower auto update may (and probably will) break Portainer at some stage. Keep backups.
Last updated
Was this helpful?

