For any new Helmut4 installation, the latest versions of Docker and Portainer CE (community version) will always be downloaded and installed.
For more information, please refer to the Helmut4 Server documentation.
Updates
Subsequent updates or upgrades of Docker and Portainer are the responsibility of the customer or hosting support. Helmut4 updates do not manage the current versions of Docker and Portainer.
When performing updates, please review the specific release notes for Docker and Portainer to ensure compatibility. It's important to test updates first in a staging environment before applying them to the production environment.
LTS (Long-Term Support) versions can be identified by the tag :lts
STS (Short-Term Support) versions can be identified by the tag :sts
Remove and re-deploy latest Portainer CE
Please use the provided script with caution, as Portainer is not within Helmut4's scope / support.
#!/bin/bash# Update Portainer to the latest community edition# moovIT GmbH - B. Dimmel# Version 2.2# Changelog: Apr 8th 2024# Update Portainer from v1.x to 2.x# Can also be used to update 2.x to a newer version# Get container ID by 'names', making it more dynamically# Add option to pick LTS or new STS Short-Term version# changed tag latest to lts# Prompt user for LTS, STS, or quit optionwhiletrue; doecho-e"\nDo you want to update to the latest LTS (Long-Term) or STS (Short-Term Support) version?\n"read-p"Enter 'lts', 'sts', or 'quit': "version_choice# Determine the Docker tag or abort based on user inputcase"$version_choice"inlts) docker_tag="portainer/portainer-ce:lts"break ;;sts) docker_tag="portainer/portainer-ce:sts"break ;;quit)# Use 'quit' instead of 'q' for clarityecho-e"Portainer update aborted!\n"exit0;;*)echo-e"Invalid choice!\nPlease enter 'lts', 'sts', or 'quit'.\n" ;;esacdone# Ask for confirmation before proceedingwhiletrue; doecho-e"\n==> You have chosen: $version_choice <==\n"read-p"Proceed with this version? (y/n): "confirm_choice# Validate user confirmationcase"$confirm_choice"in[yY])break ;;[nN])echo-e"Please choose again.\n"whiletrue; doecho-e"Do you want to update to the latest LTS (Long-Term) or STS (Short-Term Support) version?\n"read-p"Enter 'lts', 'sts', or 'quit': "version_choice# Determine the Docker tag or abort based on user inputcase"$version_choice"inlts) docker_tag="portainer/portainer-ce:lts"break ;;sts) docker_tag="portainer/portainer-ce:sts"break ;;quit)# Use 'quit' instead of 'q' for consistencyecho-e"Portainer update aborted!\n"exit0;;*)echo-e"\n==> Invalid choice!\nPlease enter 'lts', 'sts', or 'quit' <==\n" ;;esacdone ;;*)echo"Invalid input. Please enter 'y' or 'n'." ;;esacdone# Get the container ID of the container with the name "portainer"container_id=$(dockerps-q--filter"name=portainer")# Check if container_id is not emptyif [ -n"$container_id" ]; thenecho"Container ID of the container 'portainer': $container_id"elseecho"No container with the name 'portainer' found."exit1fi# Stop and remove the existing Portainer containerecho-e"\nStopping Portainer and deleting it's container ...\n"ifsudodockerstop"$container_id"&&sudodockerrm"$container_id"; thenecho"Portainer container stopped and removed successfully."elseecho"Failed to stop or remove Portainer container. Exiting."exit1fi# Pull the latest Portainer Community Edition imageecho-e"\nPulling the latest Portainer-CE image ...\n"ifdockerpullportainer/portainer-ce:latest; thenecho"Latest Portainer-CE image pulled successfully."elseecho"Failed to pull the latest Portainer-CE image. Exiting."exit1fi# Deploy the new Portainer containerecho-e"\nDeploying the new Portainer-CE container ...\n"if docker run -it -d --restart=always -p 9000:9000 --name=portainer -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data "$docker_tag" -H unix:///var/run/docker.sock; then
echo"Portainer Community Edition has been successfully deployed."elseecho"Failed to deploy Portainer Community Edition. Exiting."exit1fi
Docker Update
To update the Docker environment or engine, please refer to the documentation provided by your host operating system manufacturer, such as Ubuntu.
The update commands can vary depending on the distribution running on your server.