Portainer Version

In this post, I will use the Community Edition.

Prerequisites

  • Docker installed and working on Ubuntu 22.04

Installation

First, create the volume that Portainer Server will use to store its database:

1
docker volume create portainer_data

Then, download and install the Portainer Server container:

1
docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest

Running docker ps:

1
2
3
root@server:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
de5b28eb2fa9 portainer/portainer-ce:latest "/portainer" 2 weeks ago Up 9 days 0.0.0.0:8000->8000/tcp, :::8000->8000/tcp, 0.0.0.0:9443->9443/tcp, :::9443->9443/tcp portainer

First, retrieve the stack YML manifest:

1
curl -L https://downloads.portainer.io/ce2-19/portainer-agent-stack.yml -o portainer-agent-stack.yml

Then use the downloaded YML manifest to deploy your stack:

1
docker stack deploy -c portainer-agent-stack.yml portainer

Running docker ps:

1
2
3
4
root@server:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
59ee466f6b15 portainer/agent:latest "./agent" About a minute ago Up About a minute portainer_agent.xbb8k6r7j1tk9gozjku7e43wr.5sa6b3e8cl6hyu0snlt387sgv
2db7dd4bfba0 portainer/portainer-ce:latest "/portainer -H tcp:/โ€ฆ" About a minute ago Up About a minute 8000/tcp, 9443/tcp portainer_portainer.1.gpuvu3pqmt1m19zxfo44v7izx

Accessing

Access the Portainer Server on web browser:

1
https://localhost:9443

Replace localhost with the relevant IP address.

More info: Portainer

Sorry for any grammatical or spelling errors. I am practicing my english.