How to Manage Docker Containers using Portainer on Centos 7
You can manage your Docker containers using the terminal (Actually nothing hard, only hardest part if you want specific containers with specific configuration) since I will be deploying several sites with the same based configuration and the same Image then I would prefer a web interface system for managing Docker containers. The one that I know at the moment and it's an open-source is called Portainer.
Portainer can be installed as a docker container and standalone without a docker container. In this tutorial, we will install Portainer as a Docker container. It’s really simple to install and run on any system because we just need to ensure the system support, Docker.
Before installing Portainer, download the Portainer image from the DockerHub using the docker pull command below.
docker pull portainer/portainer
Now run Portainer using the simple docker command below.
docker run -d --name portainer-manager -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer
Portainer is now running as a container, check it using the docker ps command.
docker ps -a
Portainer is now running as a Docker container with the name ‘elatted_hopper’, and it’s running under port 9000. Next, we will configure the Admin password for the Portainer.
Open your web browser and type the server IP address with port 9000.
http://your_IP:9000/ (Replace your_IP, with your server IP)
You will get the page about the admin user and password configuration. (My suggestion don’t use user admin – Its the first thing when someone will try to break your system that hi will try also use strong passwords)
Type your strong admin password and click the ‘Create user’ button.
Now we need to define which environment Portainer will connect. Portainer offers support for standalone Docker environment, Docker Swarm, and Swarm mode.
For this guide, we will configure Portainer to connect to the local Docker environment.
Choose the ‘Local’ environment and click the ‘Connect’ button.
And now you will see the Portainer Admin Dashboard.
Portainer has been installed as a Docker Container