Portainer is a web-based tool to manage Docker containers, easy to install and use.

Table of Contents

Installation

Portainer use Docker as its backend, so first ensure you have Docker installed.

Then, follow these steps to install Portainer with Docker on Linux (run as root or with ‘sudo’, rootless Docker may need additional configuration):

  1. Create a volume.
    docker volume create portainer_data
    
  2. Run Portainer Server container:
    docker run -d -p 8000:8000 -p 9443:9443 --name portainer \
     --restart=always \
     -v /var/run/docker.sock:/var/run/docker.sock \
     -v portainer_data:/data \
     portainer/portainer-ce:2.9.3
    
  3. Go to https://localhost:9443. Replace localhost with your server IP if access remotely (you may need to open the port on your firewall). Accept the self-signed certificate.

Self-signed certificate warning

Self-signed certificate warning

Usage

Create an administrator user

First time you open Portainer, you must create an administrator user. Type a password and press “Create user”.

Portainer

Run a container

To start, press on “Get Started” and then click on “local” to use the local environment.

Portainer

Portainer

You can see all the resources of this environment: images, containers, volumes, networks, etc. Press on the container section.

Portainer

Here you can find all the running or stopped containers. Click on “Add container”.

Portainer

In this window you can type all the options you usually type when running docker run: type an optional name for the container, specify the image, press on “publish a new network port” to map container ports to host.

Portainer

Portainer

Scroll down and you’ll find more options like “Console” to specify if you want interactive mode (-i, keep stdin open even if not attached) and TTY (-t, allocate a pseudo-TTY). When you want to access to container console, you usually select “Interactive & TTY”.

Portainer

Finally, click on “Deploy the container”.

Access container console

On the Container List window, you’ll see some icons below “Quick actions” section. Press “>_” and click “Connect”.

Portainer

Portainer

Portainer

Manage a container

If you press the container name in “Container List” window, you’ll find the container details. Here you can stop or remove the container, check its status or get more info, stats, etc.

Portainer

Other options

You’ve learned the basic use of Portainer, but this great tool has a lot of features:

  • Pull and manage images. Portainer
  • “App Templates”. Templates to run popular containers like “Nginx”. Portainer Portainer
  • Create users (administrators or ordinary users). Portainer

More info

Check https://www.portainer.io/help_about to get more info about Portainer.