From CLI to GUI: Manage Docker with Portainer

Portainer is a lightweight management UI that allows you to easily manage your Docker environments. Learn how to install Portainer on an Ubuntu Server.

Step 1: Update Your System

Before installing anything, ensure your system packages are up-to-date:

sudo apt update ; sudo apt upgrade -y

Step 2: Install Docker and Docker Compose

Install Required Dependencies

sudo apt install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings

Add Docker’s Official GPG Key

sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

Add the Docker Repository

echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Install Docker Engine and Plugins

sudo apt update ; sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Step 3: Install Portainer

With Docker installed, you can now deploy Portainer.

Create a Docker Volume for Portainer

sudo docker volume create portainer_data

Run the Portainer Container

sudo 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:lts

Installation Complete

Portainer is now running on your server. To access the web interface, open a browser and go to:

https://<your-server-ip>:9443

You’ll be prompted to set up an admin user. Once complete, you can begin managing your Docker containers through the Portainer web UI.

After creating a Password for the Admin user, clock on Live Connect:

Now go to “Stack” and create your first Docker compose!

That’s it!

Now that you installed Portainer successfully, create some containers!

Video Walk-through

Leave a Reply

Your email address will not be published. Required fields are marked *