portainer create container from image

How To Install Portainer Web UI For Docker On Linux

How to install and configure Portainer containers, and also create volume in Linux. you must have installed a docker on the machine. you can manage your docker with GUI on Portainer. you can create, stop, restart, pause and also manage cluster containers, etc. 

Let’s create a volume for the Portainer container. I have attached the additional disk and mount it on a directory using LVM.

Check Out: Command To Check Swap Partition On Linux Server

Create Volumes

You can also use the below command for volume container.

docker volume create portainer_data

I have created a directory and LVM then mounted on the folder for Portainer volume.

mkdir portainer_data

mount /dev/mapper/vg-lv_vg portainer_data/

mount -a

df -Th

how to install portainer

Check Out: Create Apache Docker Image Using Dockerfile In Linux

you have to pull the Portainer image from the docker hub using the below command.

docker pull portainer/portainer:latest

portainer install

Now you have the Portainer image, I have used port 8000 to bind it with Portainer container. So. I can access the Portainer with IP and port 8000 from the outside.

docker run -d --name portainer-con --restart unless-stopped -p 8000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer

portainer create container from local image

Check Out: How To Add Docker Host To Rancher Server In Linux

The container created now with container id: ae68db2af6d9 and port 800 binds with the container port 9000.

docker ps

install portainer docker

Add these port in the firewall

firewall-cmd –permanent –add-port=8000/tcp

firewall-cmd –reload 

install portainer docker centos 7

Check Out: Copy Data From Docker Host In a Running Container

Now access the Portainer using browser and check your docker host machine IP address using ifconfig.

Enter your ip:8000 in the browser.

configure portainer linux

Put the password minimum of 8 digits and click on create a user.

Now you need to choose your environment where you want to deploy and I’m choosing local and click on connect.

portainer run on linux

Manage the Docker environment where Portainer is running.

Ensure that you have started the Portainer container with the following
Docker flag:

-v "/var/run/docker.sock:/var/run/docker.sock" (Linux). or -v \\.\pipe\docker_engine:\\.\pipe\docker_engine (Windows).

Check Out: Change Jenkins Default Port To Access On CentOS 7

volume for portainer container

Click on local and you can see all the information about dockers that are running on your machine.

You can check the container information by clicking on the Container on the left side.

Check Out: How To Install Podman and Run Container On Linux 8

you can also check container statistics using the below command.

docker stats ae68db2af6d9 –no-stream

You’re done configure portainer linux

Leave a Reply

avatar
  Subscribe  
Notify of