Are you developing, deploying, and managing container-based applications? 🚀 While it’s great to be familiar with the Docker CLI commands, sometimes you really need a visual tool. Managing tons of containers, images, volumes, and networks with commands is inefficient and prone to mistakes.
That’s where “Portainer” comes in! ✨ In this article, we’ll take a closer look at what Portainer is, what it does, why you should use it, and how to install and utilize it.
—.
1. What is Portainer?
Portainer is a powerful open source tool that enables you to manage container orchestration platforms like Docker, Docker Swarm, and Kubernetes with a web-based UI. It helps you easily control your container environment with just a few clicks from a web dashboard, without having to type complex commands.
It’s like a car dashboard, giving you a quick glance at your driving information and allowing you to manipulate the features you need without having to know the intricacies of the engine 🚗.
2. Key features of Portainer
Portainer provides many features to efficiently manage your container environment. Let’s take a look at the key features.
- Environment Management: * Manage Docker daemons on local and remote servers.
- *Connect and manage multiple environments in one place: local Docker daemons, Dockers on remote servers, Docker Swarm clusters, and even Kubernetes clusters. 🌐.
- *Centrally monitor and control container environments distributed across different infrastructures.
- Container Management: **Create, start, stop, and manage containers.
- Create, start, stop, restart, and delete containers, as well as detailed settings (port mapping, volume attachments, environment variables, etc.) can be intuitively operated from the web UI.
- View real-time logs of each container, monitor resource (CPU, memory, network) usage, and even shell into the container. 📊
- Image Management: Image Management: **Image Management.
- Pull images from public/private registries such as Docker Hub, build and tag local images, and delete unnecessary images. 📦.
-
- Get an at-a-glance list of images and facilitate versioning.
- Volume Management: **Volume Management.
- Creating, attaching to, and managing volumes for data persistence is intuitive. 💾.
- Clearly shows which volumes are in use and which are available.
- Network Management: Create networks for communication between containers.
- Create and configure networks for communication between containers. Easily set up bridges, overlay networks, etc. 🔗.
- Stack Deployment: * Deploy Docker Compose files in the UI.
- You can deploy and manage applications (stacks) consisting of multiple containers at once by pasting Docker Compose files into the UI. Even complex microservice architectures can be deployed with ease. 🚀.
- User & Access Control: **User & Access Control.
- You can register multiple users, and grant each user access to specific environments or features. Very useful for working in teams. 🔑 (RBAC – Role-Based Access Control).
- Application Templates (App Templates):.
- Predefined templates make it easy to deploy popular applications like WordPress, MySQL, Redis, and more in just a few clicks. It helps even beginners to configure services with ease 🚀.
- Registry Management:.
-
- *Add and manage private Docker registries (e.g. Harbor, private Docker Hub).
-
- Events and Notifications:
- View a history of key events such as container creation, deletion, and more.
3. Portainer, why should you use it?
There are clear benefits to using Portainer, such as
- Ease of Use: * No need to memorize complex CLI commands.
- No need to memorize complex CLI commands, everything can be done through an intuitive web UI. It makes it easily accessible even for beginners. 👍.
- Time-Saving: Time-saving.
- Save time typing commands and fixing typos, and quickly accomplish repetitive tasks. ⏱️
-
- Reduce the time it takes to visually understand container health and diagnose issues.
- Error Reduction: Visually verify configurations and reduce the time it takes to diagnose issues.
- Reduce the risk of configuration errors or malfunctions by visually verifying your configuration as you work, especially with complex port mappings or volume settings. 👀.
- Centralized Management: Centralized Management.
-
- *Maximize management efficiency by being able to monitor and control container environments spread across multiple servers from one place. 🌍.
-
- Ease of Team Collaboration: User rights management allows you to manage your team members.
- User rights management allows team members to access and work with container environments based on their roles. 🤝.
- Gentle learning curve:* Gentle learning curve.
- Helps users new to Docker understand container concepts and how they work in a much friendlier way than the CLI. 🎓
4. How to install Portainer
Installing Portainer is very simple if you have Docker! You can get started with just a single line of command.
4.1. Prerequisites.
- Linux server with Docker installed (or Windows/macOS with Docker Desktop installed)
**4.2. Installation process
-
Create a volume to store the Portainer data: “`bash”
docker volume create portainer_data
This volume will be used to permanently store Portainer’s settings, user information, environment data, etc.
-
Run a Portainer container: **.
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:latest
-d
: Run the container in the background.-p 8000:8000
: Port for Portainer Edge Agent communication (may be used later to connect other Docker environments).-p 9000:9000
: Port for accessing the Portainer web UI.--name portainer
: Specify the container name asportainer
.--restart always
: Ensure that the Portainer container is automatically restarted when the Docker daemon is restarted.-v /var/run/docker.sock:/var/run/docker.sock
: Mount a Docker socket so that Portainer can communicate with the Docker daemon on the host. (Very important!)-v portainer_data:/data
: Mount theportainer_data
volume created above to the/data
path inside the container to ensure data persistence.portainer/portainer-ce:latest
: The Portainer Community Edition (CE) image to run.
-
**Accessing the Web UI Once the installation is complete, connect to
http://서버IP:9000
in a web browser (for example,http://localhost:9000
orhttp://192.168.1.100:9000
). -
Initial setup:**
- Set up an administrator account (username, password) for the first time.
- Select the Docker environment you want to manage. Typically, you will be managing a local Docker, so select “Local”. (Other environments such as Kubernetes, Docker Swarm, etc. can also be connected).
You are now ready to start managing your container environment through the Portainer dashboard! 🎉 Enjoy!
5. Examples of Portainer in action
Let’s take a look at a few examples to see how easy Portainer makes container management in practice.
-
*Creating a new container:** 1.
- from the Portainer dashboard, click
Containers
in the left menu. - click the
Add container
button. - Enter the desired image name (e.g.
nginx:latest
), port mapping (e.g.80:80
), volume attachment, environment variables, etc. into the GUI form. - Press the
Deploy the container
button and you’re done. No need to type long commands likedocker run -p 80:80 -v /mydata:/data nginx
in the CLI! (After the creation is complete, you can see the newly created Nginx container in the ‘Container list’).
- from the Portainer dashboard, click
-
Deploying the Docker Compose stack: 1.
- click
Stacks
in the left menu and press theAdd stack
button. - enter a stack name (for example,
my-wordpress
). - Paste the Docker Compose YAML content you created earlier in the
Web editor
.version: '3.8' services: wordpress: image: wordpress:latest ports: - "80:80" environment: WORDPRESS_DB_HOST: db WORDPRESS_DB_USER: wordpress WORDPRESS_DB_PASSWORD: password WORDPRESS_DB_NAME: wordpress volumes: - wordpress_data:/var/www/html db: image: mysql:5.7 environment: MYSQL_ROOT_PASSWORD: root_password MYSQL_DATABASE: wordpress MYSQL_USER: wordpress MYSQL_PASSWORD: password volumes: - db_data:/var/lib/mysql volumes: wordpress_data: db_data:
- Click the
Deploy the stack
button, and even complex applications consisting of multiple services will be deployed at once. (After deployment, you can manage that stack in theStacks
list and see all the related containers running).
- click
-
Checking container logs and monitoring resources:.
- click the desired container in the list of running containers.
- You’ll be taken to the container’s details page.
- Here you can check the real-time logs, or monitor performance by visually viewing CPU, memory, and network usage graphs in the
Stats
tab. 📈 This will help you quickly determine the cause when something goes wrong.
6. Portainer, who is it useful for?
- Docker/Kubernetes beginners: For those who find the CLI intimidating, it helps them visually understand and manipulate their container environment. It reduces the learning curve.
- Developers/Operators who prefer a GUI environment: Rather than doing everything with the CLI, this is perfect for those who want to increase efficiency through a fast and intuitive web interface.
- Professionals managing multiple containers and stacks: An essential tool for DevOps engineers and sysadmins who need to easily manage and monitor dozens or hundreds of containers.
- Teams sharing container environments: Per-user permission management enables a secure and efficient collaborative environment.
- Enterprises running containers in an on-premises environment: Centrally manage your container environment on your own servers, just like the management console of a cloud service.
—.
In closing.
Portainer is an incredibly useful tool that effectively reduces the complexity of container technology while maintaining its power. For anyone using containers, from individual developers to large-scale enterprise environments, it will greatly improve productivity and efficiency.
If you haven’t tried Portainer yet, why not install it today and experience the new world of container management? It’s sure to make your container life a lot smarter and more enjoyable! 😄