How to install and upgrade Portainer – Best Docker UI Manager
Portainer is an open source container management tool that eliminates the need to write code. For this, Portainer provides a graphical user interface for everything that can be realized via a Docker command line.
Within Ecosystem, Portainer allows users to manage their own containerized applications, for example, customer applications or tools for internal use. This applies both to containers operated individually and to operation on clusters based on Kubernetes and Docker Swarm, for example. The assignment of permissions also works via this.
Portainer provides a lot of features like:
- Manage Docker images – pull, delete, Build
- Quickly deploy applications from app templates
- Manage containers – start, stop, kill, restart, pause, resume, remove, create
- Manage networks – add, remove, edit
- Manage Volumes – add, remove, manage permissions
- Check docker engine events
- Add custom docker registry and add authentication for docker hub
- Create endpoints
- Add users to manage Docker
- Manage Docker swarm
- Create custom container templates
Some prerequisites are:
- Docker engine running on target host – Can be local or remote
- Linux, macOS or Windows docker host machine
- Internet connection to download Portainer docker image
If you don’t have Docker installed and running, use our guides below:
And in this Tutorial I will show you how to install Portainer – so let’s start:
Step 1: To persist docker container data, let’s create a directory that will hold all Portainer data.
mkdir ~/portainer
You can specify any other directory you wish to use.
Step 2: Let’s now download the image from Docker hub and store it locally on docker host.
docker pull portainer/portainer
Using default tag: latest
latest: Pulling from portainer/portainer
94cfa856b2b1: Pull complete
49d59ee0881a: Pull complete
a2300fd28637: Pull complete
Digest: sha256:fb45b43738646048a0a0cc74fcee2865b69efde857e710126084ee5de9be0f3f
Status: Downloaded newer image for portainer/portainer:latest
docker.io/portainer/portainer:latest
You can tag the image and give it a custom name
docker tag portainer/portainer portainer
Step 3: With everything already configured, let’s start the container:
export CONT_NAME="portainer"
# Create container
docker run -d -p 9000:9000 \
> --restart always \
> -v /var/run/docker.sock:/var/run/docker.sock \
> -v ~/portainer:/data \
> --name ${CONT_NAME} \
> portainer
Container ID is returned if the container is started successfully:
21cbc236aa73342c12b8e7f06eec732ef446bf9bedad907c094be40f351fcca3
Step 4: Access the Web dashboard on the ip you have set with the port :9000
You will be asked to create an admin user and provide a password, then click create user. You will then be asked to add Docker environment, this can be local Docker engine, remote or you can connect to a Portainer agent or to Microsoft Azure ACI.
In my Case I will choose a local Docker environment and finally you will land on your Portainer UI Page:
Upgrading from version 2.0.0 and later
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:
docker pull portainer/portainer-ce:2.11.1
Finally, deploy the updated version of Portainer:
docker run -d -p 8000:8000 -p 9000:9000 -p 9443:9443 \
> --name=portainer --restart=always \
> -v /var/run/docker.sock:/var/run/docker.sock \
> -v portainer_data:/data \
> portainer/portainer-ce:2.11.1
And again you will get a Container ID:
3d00990be52bdf676636645973b2f1a6b60efb0ae7f1bb8c8bfb4b138b8d1883
And that’s it, if you have any questions please leave it in the comments. 🙂