Getting Started w/ Portainer
Portainer is a GUI for adding and managing docker containers with the option to run Windows containers too. This feature-rich application includes automated startup and recovery, App templates, custom image formatting, and much more. Here, I will guide you through setting up your Portainer instance.
To start, spin up a Ubuntu VM, preferably Ubuntu Server 20.04 as I will be using. I went with 6 cores, 10gb of RAM, and a 50gb Thin Provisioned drive.
Next, download docker with
sudo apt install docker -y
When that is finished, you can run the following command to pull and spin up Portainer:
docker run -d -p 9000:9000 -p 8000:8000 –name portainer –restart always -v /var/run/docker.sock:/var/run/docker.sock -v /portainerd/data:/data portainer/portainer
It is important to understand what each of these parts of the command accomplish:
- -p Specifies port and which port to connect from the host to the container
- –name Denotes the name of the container that will run
- –restart always Tells Docker to restart the container after boot
- -v Denotes the Volume and socket where the Container will tie into the host
- portainer/portainer This is where you specify the Author of the container, and the template to pull from the Docker Hub.
Next, navigate in your browser to http://ip-of-your-vm:9000
It will then ask for you to create your Admin account. After filling out the required information, you’ll see your new Portainer Home Page!