Install Portainer on Ubuntu 18.04

Portainer helps you manage your Docker containers with a graphical interface, works with Docker servers or Swarm clusters.
Portainer consumes very few resources and works like a Docker container (the Docker image weighs less than 4MB). Therefore, once we have Docker installed it will be very easy to install.

Docker Installation

As usual, before installing a package we will make sure that our server is updated:

apt update
apt upgrade

We install the necessary packages to be able to install Docker:

apt install apt-transport-https ca-certificates curl software-properties-common

We add the official Docker GPG key:

curl -fsSL | sudo apt-key add -

We activate Docker repository and update it:

add-apt-repository "deb [arch=amd64] $(lsb_release -cs) stable"
apt update

We install the latest Docker version:

apt-get install docker-ce

Portainer Installation

As we mentioned at the beginning of this article, installing Portainer is very simple since it works in a Docker container, for this we will execute:

docker volume create portainer_data
docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer

First of all, you have to open port 9000 TCP on the client panel. Now that we have Portainer installed and the port opened, the first thing to do is set it up, for this we will enter http: // IP_Publica_servidor: 9000, create a password for our admin user, select “Local” and connect with our Docker container. The next step will be to setup the IP of our server so we will go to “Endpoints” and click on “local”, and in the window that will open we will fill in the Public IP of our server in “Public IP”. Below are some screenshots of the whole process:

Now that we have installed and set up Portainer we can create the containers that we want. We can do it in different ways: “App Templates”, “Stacks” or “Images + Containers”. Below are several screenshots with different examples:

Have you tried it? Leave a comment! ­čÖé


To write a comment on this article, fill out the form below. Fields marked with an asterisk (*) are required.

Visitors comments
  1. Comment (Published by Daniel C├│rdoba)

    Thank you very much, excellent clarity of the article.
    Regards …!!!


  2. Comment (Published by NiteLava)

    add-apt-repository "deb [arch=amd64] $(lsb_release -cs) stable"

    add-apt-repository “deb [arch=amd64] $(lsb_release -cs) stable”


  3. Comment (Published by Nick)

    This was a great guide, helped me get this up and running on my server! Thanks


  4. Comment (Published by John)

    Hello Nice article ­čÖé

    I have one question, how can i start portainer automatically on a reboot of the server.
    Now i have to start manually portainer after every reboot

    regards John


    • Comment (Published by cldn-kb-admin)

      Add in your /etc/rc.local before “exit 0”:
      docker volume create portainer_data
      docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer