Skip to main content

Command Palette

Search for a command to run...

7 of 10: Portainer in the Docker Container.

Or: Installing a Docker Management UI.

Updated
3 min read
7 of 10: Portainer in the Docker Container.
B

Thank you for reading this post.

My name is Brian and I'm a developer from New Zealand. I've been interested in computers since the early 1990s. My first language was QBASIC. (Things have changed since the days of MS-DOS.)

I am the managing director of a one-man startup called Digital Core (NZ) Limited. I have accepted the "12 Startups in 12 Months" challenge so that DigitalCore will have income-generating products by April 2024.

This blog will follow the "12 Startups" project during its design, development, and deployment, cover the Agile principles and the DevOps philosophy that is used by the "12 Startups" project, and delve into the world of AI, machine learning, deep learning, prompt engineering, and large language models.

I hope you enjoyed this post and, if you did, I encourage you to explore some others I've written. And remember: The best technologies bring people together.

Homelab | LXD Manager | Docker | Docker Desktop | Deno | MariaDB | Portainer | More Docker | Docker Swarm | CrowdSec

TL;DR.

I will install Portainer in a remote Docker container to manage and monitor my Docker environment. Portainer will be accessible at http://localhost:9000 or http://<server_ip>:9000.

An Introduction.

My previous post in this 8-part mini-series covered how I installed Deno, ExpressJS, and Axios in the remote Docker container. This time, I'm going to show how I install Portainer in the remote Docker container.

The purpose of this post is to demonstrate how to install Portainer on a Docker system.

The Big Picture.

Sometimes, it's the little things.

I'm bombastic in my posts. I'm so busy showing off that sometimes the message gets buried in all the noise. (BTW: being bombastic is a bad thing.)

I'm going to try something different.

Welcome to my first micro post.

Installing Portainer CE Server.

  • From a terminal (CTRL + ALT + T) that is connected to the Docker container, I create a persistent Docker volume to store Portainer's data:
docker volume create portainer_data
  • I use the Docker command to pull, and run, the Portainer image while including a few setup flags:
docker run -d -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce

This command will:

  • Run the Portainer container in detached mode -d

  • Expose Port 9000 -p 9000:9000

  • Name the container portainer
    --restart=always` to restart the container on reboot

  • Mount the Docker socket -v /var/run/docker.sock:/var/run/docker.sock

  • Mount the data volume -v portainer_data:/data

  • Use the Portainer Community Edition image portainer/portainer-ce

  • Access the Portainer UI by navigating to http://localhost:9000 in your browser.

  • Set the admin password during the initial setup.

  • The Portainer UI will show you the local environment containing your Docker containers, images, volumes, etc.

I can then use Portainer to manage, and monitor, my Docker environment. After installation, the Portainer UI will be available at http://localhost:9000 or http://<server_ip>:9000.

Attribution:

https://docs.portainer.io/start/install-ce/server

The Results.

I demonstrated how to install Portainer in a remote Docker container. Portainer is used to manage and monitor my Docker environment. By following the steps outlined, I can easily set up Portainer and access its UI to gain insight into my containerized applications. With this powerful tool, I can simplify container management and enhance my overall experience in working with Docker.

In Conclusion.

You know what? Cutting out the drivel and sticking to the point helped get this post down to a 3-minute read time.

Here's my new rule for writing posts: Cut the crap and stick to the point.

Until next time: Be safe, be kind, be awesome.

Homelab | LXD Manager | Docker | Docker Desktop | Deno | MariaDB | Portainer | More Docker | Docker Swarm | CrowdSec

The Ops Series

Part 35 of 46

In the Ops series, I describe the server "operations" I use for app development and technology evaluations.

Up next

6 of 10: Installing MariaDB and MySQL Workbench.

Or: MariaDB + MySQL Workbench = Editing a Remote Database.