Install Portainer with Docker on Ubuntu

Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

Introduction

Portainer is a program that helps you manage your docker containers. If you want to delete , stop, or restart a docker container; you can easily do so with the portainer user interface (rather than going SSH and typing all kinds of commands). You can adjust containers settings, manage resource, and manage from within inside the container to gain perspective.

Just think of Portainer as the GUI version to manage your containers compared to using CMD Line; while having powerful functions such as replication or amending containers on the go!

Also Portainer enables centralized configuration, management and security of Kubernetes and Docker environments, allowing you to deliver ‘Containers-as-a-Service’ to your users quickly, easily and securely.

In this article, we will install Portainer with Docker in Ubuntu 20.04

Installation

  • Update your system
sudo apt-get update -y
  • Then Install the required dependencies for Docker
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common -y
  • Add the Docker CPG Key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
  • Verify that you have the key by searching for the last 8 characters of the fingerprint.
 sudo apt-key fingerprint 0EBFCD88
  • Add the Docker Repo
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
  • Then Install Docker .
sudo apt-get update -y && sudo apt-get install docker-ce -y
  • Start and enable Docker
systemctl start docker && systemctl enable docker
  • Also Create the volume and name it portainer-data
sudo docker volume create portainer-data
  • Then Pull the Portainer image from Docker hub with running the command below.
sudo docker run -d --name portainer -p 8090:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer-data:/data portainer/portainer
  1. “-d” : Detached to start a container in detached mode
  2. “-p”: refers to port to make the port maping inside the container listening on port 9000 and for outside the container connection on port 8090
  3. “-v” : refers to mount volume /var/run/docker.sock on the container into /var/run/docker.sock on the native shell. and portainer-data and data are the same mount points.
  4. “portainer/portainer” : the image name.

Access the Portainer

  • Navigate to your browser and access the Portainer by using http://server_IP:8090 and set admin password and finish the installation as shown below.
  • Now you can access your container or control, remove and create a containers within GUI through Portainer.
  • Go to local endpoint, you will be directed then to your containers Dashboard as shown below.
  • Try to access the container as shown below, you will find your containers listed.

Conclusion

That’s it..

IN this installation guide, we illustrated how to install Portainer with Docker on Ubuntu

Thanks !!!

Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"
MQ-Jr
MQ-Jr
unixcop Admin

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest articles

Join us on Facebook