Install Portainer using Docker – Manage all your Docker containers

In a previous post, I showed you how you can install HTPC Manager using Docker in order to aggregate your favorite services in a single web interface. Today, I will show you how you can install Portainer using Docker. Portainer is also a management user interface that allows you to easily manage your Docker host. Besides that, Portainer allows you to manage your Docker containers, images, volumes, networks and more, making the management of your Docker resources a breeze. While Kitematic for Windows, provides a Docker GUI on Windows, Portainer provides a web-interface that works on any platform.
Must Read: Ultimate Smart Home Media Server with Docker and Ubuntu 18.04 – Basic

Before you install Portainer using Docker, you can try out the public demo instance (login with the username demo and the password tryportainer) in order to check the functionality . 

If you do not know what Docker is, be sure to read our What is Docker guide and comparison to VirtualBox in advance and get familiarized with the terms used. [Read: What is Usenet and why is it better than Torrents?]

Install Portainer using Docker

Before starting the Docker Portainer installation guide, make sure to follow our previous guides where you can learn to Install Docker on Ubuntu, Windows 10 Pro/Ent, and Windows 7 and 8.

Setup Portainer In Docker
Docker Commandline Prompt

You can install Portainer using Docker in a new Docker container from scratch. But, ready-made containers are already available for several apps on Docker Hub. So all you need to do is pull those containers and install. If you are ready, open Docker command prompt and get ready to setup Portainer in Docker.

Recommended HTPC / Home Server Builds:

1. Portainer Pull Command

To install Portainer using Docker, you will first need to grab the latest version of Portainer container from the Portainer Docker Hub. This is the official Docker image for Portainer.

docker pull portainer/portainer

Pull the ready-made Portainer docker container using the above command.

2. Set Portainer Configuration Parameters in Docker

After pulling the container with the latest version of Portainer, we need to configure the usage parameters such as download folders, port number, etc. for the service. Copy all lines in the code block below (it is one single command) and paste it into docker prompt.

sudo docker create --name=portainer \
--restart=always \
-v /home/docker/portainer/data:/data \
-v /var/run/docker.sock:/var/run/docker.sock \
-e PGID=1001 -e PUID=1001 \
-e TZ=Europe/London \
-p 9000:9000 \

While you can just copy and paste the settings mentioned above, I recommend that you understand each parameter using the description below and customize it to your liking, in order to setup Portainer in Docker. Therefore, before issuing the above docker command, change certain parameters (eg. port number, folders, etc.) to fit your situation.

  • sudo docker create --name=portainer \ - Creates a new docker container with the name "portainer"
  • --restart=always \ - Starts the Portainer container automatically during boot.  If you don't want the container to be started automatically, you can skip this command.
  • -v /home/docker/portainer/data:/data \ - Specifies the location of the portainer config files. In this case, the config folder is located in /home/docker/portainer/ directory.
  • -v /var/run/docker.sock:/var/run/docker.sock \ - Specifies the location of the Docker connection. In this case, the config folder is located in /var/run/docker.sock.
  • -e PGID=1001 -e PUID=1001 \ - Specifies the user id in order to minimize permission issues that can arise between the host OS (Ubuntu) and the container.
  • -e TZ=Europe/London \ - Specifies the timezone information. You can check your timezone by following this link.
  • -p 9000:9000 \ - Specifies the ports used by portainer . In this case, the port is 9000:9000.

3. Start and Stop Portainer Container in Docker

If you used the correct parameters, you can go ahead and start the Portainer container you have just created, using the following command.

sudo docker start portainer

After starting the Portainer Docker container, you will be able to open the web interface on port 9000. In my case the ip is

Install Portainer Using Docker
Portainer Homepage Running The Dashboard

Please note that before getting to the Homepage, you will be asked to setup the password for admin user. Make sure you use a strong password.

Portainer Admin Password Setup

Portainer is now installed in Docker. What to do next?

Congratulations! You managed to setup Portainer in Docker successfully. Once Portainer for Docker is setup, it is extremely simple to manage your docker containers. If you want to be able to access the Portainer interface outside your home network, be sure to setup port forwarding on your router. You will have to forward the Portainer port to the local/internal IP address of the system with Docker installation.

Next you can learn how to Install RuTorrent using Docker, a uTorrent-like BitTorrent Client with improved functionality and speeds. Check back soon to learn more about Docker and how you can install various other services in Docker containers.

Did this post help you?
SmartHomeBeginner brings in-depth tutorials easy enough to understand even for beginners. If you are reading this, please consider buying us a coffee (or two) as a token of appreciation.


Ciprian is an enthusiast, always up to date with the latest and greatest in the IT field. Passionate about computers, mobile devices and gadgets. In his spare time, he is a gamer.