Docker for efficient development
Lesson 4 - BONUS Portainer
Welcome to this bonus lesson about Portainer — a powerful, web-based UI that makes managing Docker containers super easy, even if you’re not a terminal wizard. Let’s dive in!
- Step 1: What is Portainer?
- Portainer is a lightweight container that lets you manage your Docker environment from a neat web interface — right from inside a container itself.
- It works by mounting the Docker socket (/var/run/docker.sock) so it can communicate with the Docker engine running on your machine.
- Think of it as a friendly control panel for your containers — great for beginners and pros alike!
- Step 2: Prepare your Docker Compose file for Portainer
- Here’s a simple example of a Docker Compose service for Portainer:
- Uses the official portainer/portainer-ce image.
- Names the container portainer.
- Maps the Docker socket so Portainer can manage Docker.
- Includes a volume for persistent Portainer data storage.
- Step 3: Launch Portainer
- Open a PowerShell or terminal window.
- Run this command to start Portainer in detached mode:

- Docker will download the image (if not already present), create a network, and launch the container.
- Step 4: Access Portainer web UI
- Open your browser and navigate to:

- You’ll be greeted by the Portainer setup screen.
- Create your default admin user — set a username (or leave as admin) and a strong 12+ character password.
- Disable anonymous stats collection if you prefer privacy, then create the user.
- Step 5: Connect Portainer to your Docker environment
- Portainer automatically connects to your local Docker instance via the mounted Docker socket.
- Simply click “Get Started” to confirm the connection.
- You’ll now see your local Docker environment dashboard.
- Step 6: Explore Portainer features
- View your containers — including Portainer itself!
- Manage images, networks, volumes, and Docker stacks.
- Quickly access logs, stats, and container details via handy buttons.
- Deploy new containers or entire Docker Compose stacks from a UI instead of the command line.
- Step 7: Deploy a Docker Compose stack using Portainer
- Go to the Stacks section.
- Click “Add a new stack”.
- You can:
- Upload a Docker Compose file.
- Paste the content directly in the web editor.
- Link a Git repository.
- Use pre-built templates for popular apps.
- For example, paste your MS SQL Compose file content, give the stack a name (e.g., mssql), and hit Deploy stack.
- Portainer will pull the images and start your containers — all visible right away.
- Step 8: Customize and manage stacks easily
- View all stack details — ports, volumes, environment variables — all editable in the UI.
- Update, duplicate, or remove stacks without leaving Portainer.
- Step 9: Bonus — App templates
- Browse through handy templates for popular apps like MongoDB, Elasticsearch, HTTP servers, GitLab, and SQL Servers.
- Deploy apps quickly without hunting down Compose files or commands.
- Final thoughts
- Portainer is a fantastic, free tool to visually manage your Docker environments.
- It’s perfect if you want less command-line hassle and more GUI control.
- For business use or advanced features, check out Portainer’s paid editions.
- If you love the terminal and scripting, stick with Docker Compose files for deployments.
- But if you want a slick dashboard and fast container management, Portainer’s your go-to.
- That’s it for Portainer! Dive in and see how it can make your Docker experience smoother and more fun.