Portainer is a lightweight, open-source platform that serves as a management layer for containerized environments. Launched in 2016, it has grown into a popular tool due to its ability to simplify tasks that would otherwise require intricate command-line operations. Whether you’re deploying a single Docker container or managing a Kubernetes cluster, Portainer provides a centralized interface to visualize and control your container resources.

Containers are isolated environments that package an application with its dependencies, ensuring consistency across development, testing, and production. Tools like Docker and Kubernetes are powerful but often require users to master complex syntax. Portainer eliminates this barrier by offering a web-based solution where users can click through menus to perform actions like launching containers, managing images, or configuring networks.

Portainer’s versatility lies in its support for multiple platforms:

  • Docker: Manage individual containers or small-scale deployments.
  • Docker Swarm: Orchestrate multi-container applications in a clustered environment.
  • Kubernetes: Handle large-scale, cloud-native workloads.
  • Azure Container Instances (ACI): Integrate with Microsoft’s serverless container service.

This multi-platform support makes Portainer a unified tool for diverse container ecosystems, appealing to both small teams and enterprises.

Key Features of Portainer

Portainer offers a robust set of features that enhance container management. Here are the highlights:

  • Web-Based Interface: A clean, intuitive dashboard accessible via a web browser, eliminating the need for command-line proficiency.
  • Multi-Platform Support: Manage Docker, Swarm, Kubernetes, and ACI from one tool, reducing the need for multiple management solutions.
  • Resource Visualization: View containers, images, volumes, and networks in real time, with options to inspect or modify them.
  • Application Templates: Deploy popular applications (e.g., WordPress, MySQL) quickly using pre-configured templates.
  • User Management: Set up role-based access control (RBAC) for teams, ensuring secure and organized collaboration.
  • Security Features: Support for TLS encryption and optional analytics that respect user privacy.
  • Extensibility: Integrate with external tools or customize via APIs and community contributions.

These features make Portainer a versatile and powerful tool, balancing simplicity with functionality.

How to Install and Run Portainer on Linux

In this example, we’ll look at how to install Portainer on a VPS or dedicated server.

sudo apt update
sudo apt install docker.io
sudo systemctl start docker
sudo systemctl enable docker

Installation Steps

Create a Volume for Persistent Data
Portainer stores its configuration and user data in a Docker volume. Create one with:

docker volume create portainer_data

Run the Portainer Container
Launch Portainer using this command:

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

Here’s what each parameter does:

  • -d: Runs the container in the background.
  • -p 9000:9000: Maps port 9000 on the host to the container, making the web interface accessible.
  • –name portainer: Names the container for easy reference.
  • –restart always: Ensures Portainer restarts automatically after a system reboot.
  • -v /var/run/docker.sock:/var/run/docker.sock: Allows Portainer to communicate with the Docker daemon.
  • -v portainer_data:/data: Persists Portainer’s data in the volume.

Access the Web Interface

Open your browser and go to: http://your_VPS_IP:9000 or, if you installed it locally, http://localhost:9000. On first login, create an admin user with a strong password. Portainer will then detect your Docker environment, and you can start managing it.

Installing Portainer with the Unihost script

Prerequisite: Run the script as the root user.

  1. Connect to the server via SSH.
  2. Execute the command:
curl -sS https://screen.unihost.com/portainer/portainer.sh | bash

After the script finishes, it will display the Portainer panel URL and access credentials.

Follow the URL and login witn credentials provided.

Conclusion

Portainer is a valuable tool for anyone working with containers, offering a user-friendly alternative to command-line management. Its support for multiple platforms, lightweight design, and active community make it ideal for developers, small teams, and hobbyists.