How to Install Portainer on Ubuntu 22.04


Looking to manage Docker containers effortlessly on your Ubuntu 22.04 system? Portainer is here to save the day! In this step-by-step guide, we’ll show you just how simple it is to install and set up Portainer, the ultimate Docker management tool.

No need to be an expert, as we’ll break down the process in easy-to-follow instructions. With Portainer, you can easily monitor, configure, and deploy Docker containers with a user-friendly interface. Let’s get started and revolutionize your Docker experience with Portainer!

How to Install Portainer on Ubuntu 22.04?

To proceed with the Installing process of Portainer on Ubuntu 22.04, first, we will update the packages list:

sudo apt update

To use Portainer, you need to install some packages to access the Docker repository over HTTPS, for that use the below command:

sudo apt install -y apt-transport-https ca-certificates curl software-properties-common

To proceed further, add the Docker GPG key:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

Now, add the Docker repository:

echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Add the Docker repository to the packages list by updating it once more.

sudo apt update

Finally, install Docker by utilizing the below command:

docker volume create portainer_data

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

Now, add your user to the “docker” group:

sudo usermod -aG docker $USER

Reboot your system to apply group membership changes:

sudo reboot

Finally, install Portainer on Ubuntu 22.04 by writing out this command:

docker volume create portainer_data

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

How to Uninstall Portainer on Ubuntu 22.04?

If you want to uninstall or remove Portainer from Ubuntu 22.04, run the below command:

docker stop portainer
docker rm portainer

That is how you install Portainer on Ubuntu 22.04.

Conclusion

To install Portainer on Ubuntu 22.04, first, fulfill the prerequisite and then start the installation process by utilizing the command “docker volume create portainer_data

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

And if you want to uninstall it then run out the “docker stop portainer

docker rm portainer” command.

 

Print Friendly, PDF & Email
Categories