LocalHake

Tutorial

Deploy Portainer Server

How to deploy Portainer Server on Docker Desktop

Hake HardwarePublished Updated ~5 minbeginner

This post contains paid links (affiliate) — how that works.


▶ Watch this build on YouTube
Contents

Prerequisites

You should have Docker Desktop installed.

Portainer Server

Create Volume

Open up a terminal in Windows with win + x and then select "Terminal". Create the "portainer_data" volume:

bash
docker volume create portainer_data

Deploy Server

Then deploy the portainer server:

bash
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.21.3

Open Portainer

In the browser, navigate to "https://localhost:9443".

Firefox browser warning for self-signed certificate

This is okay, it's because it is using a self-signed certificate since you are hosting the website locally. Click "Advanced" and then "Accept the Risk and Continue". Now you need to create a login for Portainer, I usually leave the Username as "Admin" and then create whatever password you wish. Then hit "Create user".

Portainer admin user creation form

Once you log in, click the big "Get Started" button to view your Environments

Portainer Quick Setup page with Get Started button

Here is where you can view your PC running Portainer.

This is not really a guide on how to use Portainer, but a few quick notes: If you click the card for the "local" environment that is the PC running Portainer. We will see how to add external environments for other PCs running on your network soon. But inside this environment there is a menu on the left side that has all sorts of options - for the most part this can also be seen in the main content area

  1. Stacks - These are like Docker Compose files, basically infrastructure as code. Allowing you to deploy many Docker containers at once.
  2. Container - This will list out all the containers you have running
  3. Image - This will show you all the images you have downloaded
  4. Volume - This will show you all the volumes you have created
  5. Networks - If you see the pattern here, this will show you the Networks. By default you will already have some.

Gear used