BLOG POSTS
    MangoHost Blog / DevOps Made Visual: Use Portainer and Lazydocker to Manage Containers
DevOps Made Visual: Use Portainer and Lazydocker to Manage Containers

DevOps Made Visual: Use Portainer and Lazydocker to Manage Containers

What This Article Is About (And Why You Should Care)

Let’s be real: managing Docker containers doesn’t have to be an endless parade of docker ps, cryptic container IDs, and forehead-shaped dents in your desk. If you run your own stack—whether it’s on a home server, a juicy cloud VPS, or a beefy dedicated box—you want to spend more time shipping apps, and less time deciphering logs or cleaning up zombie containers.

This guide is your fast lane to “DevOps made visual.” We’ll break down Portainer (the slick web UI for Docker/Swarm/Kubernetes) and Lazydocker (the terminal-based, supercharged TUI for Docker, Compose & friends). Why? Because seeing is debugging, and visual tools are the difference between “huh?” and “aha!” moments.

  • Practical, step-by-step setup—minimum hassle, maximum clarity.
  • Clear answers to “how does this work, and why would I use it?”
  • Real admin stories, mistakes to dodge, and creative new tricks.

By the end, you’ll know if Portainer and/or Lazydocker belong in your toolbox, how to get them running in minutes, and how to impress your future self with clever container management skills.

The Reality Check: DevOps Headaches in the Wild

It’s 3AM (because of course it is). Your app is down. You SSH into your VPS, only to discover your Docker containers are playing musical chairs, one is stuck in a restart loop, and your logs read like the Dead Sea Scrolls. You Google “docker command to see logs,” but there are five different ways, and none of them feels right. Meanwhile, users are tweeting “broken again 😢.”

Or maybe you’re new to Docker, and you’re tired of pasting in endless terminal commands just to see what’s running. You wonder: “Isn’t there a visual way to manage all this?” Spoiler: there is.

Why Container Management Still Feels Like Rocket Science

  • CLI Overload: The classic Docker CLI is powerful, but can feel like hacking in the dark, especially when you have lots of containers/networks/volumes flying around.
  • Time = Money: The longer you spend managing infrastructure, the less you ship code.
  • Visibility: Text output doesn’t show relationships, performance, or errors at a glance.
  • Onboarding Pain: New teammates (or future you) need a faster way to grok what’s running and why.

Enter visual tools: Portainer is your “mission control” dashboard, while Lazydocker is a friendly, mouse-free cockpit for the power user.

DevOps Goes Visual: Meet Portainer & Lazydocker

Portainer is like the Swiss Army knife of container management. It’s a web-based UI that lets you:

  • See all containers, images, networks, and volumes in one place
  • Start/stop/restart containers with a click
  • View logs, inspect environment variables, manage stacks, deploy new apps, roll out updates, and more

Lazydocker is a terminal-based, interactive UI—think of it as “htop for Docker.” It gives you a live, navigable dashboard right in your terminal, perfect for SSH sessions or when you want the speed of a CLI with the context of a UI.

Why does this matter? Because visual feedback = faster troubleshooting, less cognitive load, and fewer “oh no, I nuked the wrong container” moments.

How Does It Work? 🧩 Under the Hood

  • Portainer runs as a Docker container itself. When you launch it, it connects to the Docker API on your host (or remote hosts) and presents all your resources in a browser-based dashboard. It uses the API to manage containers, images, volumes, networks, and even orchestrators like Docker Swarm or Kubernetes.
  • Lazydocker is a Go binary that connects to the Docker socket (/var/run/docker.sock) and composes a live, terminal-based dashboard. It’s read-only by default, but lets you start/stop/restart containers, tail logs, and view resource usage—all through your keyboard.

Both tools are “ops friendly”: they don’t require you to expose the Docker socket externally (unless you want remote access), and they’re designed to be quick to install, easy to upgrade, and safe for day-to-day use.

Use Case Tree: Where Portainer & Lazydocker Shine

  • Quick Troubleshooting

    • Need to check which containers are crashing? See logs instantly.
    • Restart a stuck service with a click or a keystroke.
  • Onboarding & Demos

    • Show a new dev what’s running on the server—visually.
    • Walk through network topologies and volume mounts without a whiteboard.
  • Everyday Maintenance

    • Clean up unused images/volumes (Portainer: one click!)
    • See CPU/memory stats per container (Lazydocker: super fast overview)
  • Multi-Server Ops

    • Portainer can manage multiple endpoints (local or remote Docker, Swarm, or Kubernetes clusters) from one dashboard.
  • Security & Auditing

    • Quickly spot containers running as root, or with weird port mappings.
    • Audit images and clean up old, unused stuff before it bites you.

TL;DR: Use these tools anytime you want to see, not guess, what’s happening in your container world.

Step-By-Step Setup: From Zero to Visual Hero

What You’ll Need

  • A Linux VPS, dedicated server, or even your laptop (if you want to practice).
    Need a solid VPS? Order one here.
  • Docker installed (official instructions)
  • Basic terminal skills (SSH access, sudo rights)

1. Install Portainer

We’ll use the official Portainer Docker image. To run it on the same host as your containers:


docker volume create portainer_data


docker run -d -p 9443:9443 -p 9000:9000 --name=portainer \
--restart=always \
-v /var/run/docker.sock:/var/run/docker.sock \
-v portainer_data:/data \
portainer/portainer-ce:latest

  • Visit https://your-server-ip:9443 in your browser. First time? Set up an admin password and point it to your local Docker environment.
  • Port 9443 is HTTPS; 9000 is HTTP (for legacy reasons).

2. Install Lazydocker

You want the Go binary (single file, no dependencies). On Linux:


curl https://raw.githubusercontent.com/jesseduffield/lazydocker/master/scripts/install_update_linux.sh | bash

  • Now just run lazydocker in your terminal. If you’re SSH’d in, it’ll use your host’s Docker socket.

3. First Steps in Portainer

  • Browse containers: start/stop/restart with a click
  • Inspect logs (tail in real time)
  • Clean up unused images/volumes (“Prune” button!)
  • Deploy a new container from the UI (“Add container”)

4. First Steps in Lazydocker

  • Use arrow keys to navigate containers, images, volumes, networks
  • Press l to view logs, r to restart, s to stop/start
  • Press ? for help

5. (Optional) Secure Your Setup

  • Portainer: Set strong admin password; use HTTPS; firewall the management ports.
  • Lazydocker: Only run on trusted hosts. (Don’t expose Docker socket over the internet!)

Mini Glossary: No-Nonsense Definitions

  • Container: A lightweight, isolated “mini-server” running your app or service. Like a virtual machine, but faster.
  • Image: The blueprint for a container (think: “recipe” for your app).
  • Volume: Persistent storage for your containers.
  • Network: How your containers talk to each other and the outside world.
  • Docker socket: The magic pipe (/var/run/docker.sock) through which Docker commands are sent to the engine.
  • Swarm/Kubernetes: Ways to run lots of containers across many servers (“orchestration”).

Comic Table: Portainer vs Lazydocker vs CLI

Tool Personality Best For Superpower Weakness
Portainer 🕶️ The Cool Dashboard DJ Multi-server, “Show me everything” ops, onboarding newbies Web UI, multi-node, role-based access, easy cleanups Needs a browser; maybe “too much” for tiny home labs
Lazydocker 🎩 The Terminal Magician SSH sessions, quick troubleshooting, power users Fast TUI, works over SSH, logs and stats at your fingertips No web UI, single host only, keyboard required
Docker CLI 🧙 The Mysterious Old Wizard Automation, scripting, very fine control Ultimate power, works everywhere Steep learning curve, not visual, easy to typo yourself into trouble

Beginner Mistakes, Myths & Decision Tree

  • Mistake: Exposing Portainer or the Docker socket to the public internet. (Big security risk!)
  • Mistake: Forgetting to set up backups for your portainer_data volume.
  • Myth: “Visual tools are only for beginners.” Nope! They save time for pros, too.
  • Myth: “Visual tools are less secure.” Not if you firewall and use good passwords.

Use This If… (Decision Tree)

Want multi-server, browser-based UI?  ————> Portainer 🕶️
        |
        |  
Need fast, terminal-based, SSH-friendly UI? ——> Lazydocker 🎩
        |
        |
Automating scripts, CI pipelines, or advanced features? —> CLI 🧙

Still unsure? If you’re running more than one container, or just want to see logs and stats without guessing, you will benefit from Portainer or Lazydocker.

Weird Tricks, Scripting, and Automation Fun

  • Portainer API: Automate deployments, cleanups, or user creation via REST API (docs)
  • Lazydocker as a wrapper: Use it as your default docker ps—it’s that fast!
  • Monitoring: Pair Portainer with Prometheus/Grafana for deep stats (Portainer can show basic stats out of the box, too).

Sample Bash Script: Daily Image Cleanup with Portainer API


# Get Portainer API key (once, then use in scripts)
curl -X POST "https://localhost:9443/api/auth" \
-d '{"Username":"admin","Password":"YOUR_PASSWORD"}' \
-H "Content-Type: application/json"

# Prune unused images
curl -X POST "https://localhost:9443/api/endpoints/1/docker/images/prune" \
-H "Authorization: Bearer YOUR_API_TOKEN"

Unconventional Uses

  • Use Portainer to demo container concepts to students—less “death by PowerPoint,” more hands-on fun.
  • Lazydocker as a “dashboard” for Raspberry Pi clusters—minimal resource usage!
  • Combine with Docker Compose for managing microservices visually.

Real Admin Story: From “Oh No” to “Oh Wow”

A friend (let’s call him “Mitch”) once managed 15+ containers across three VPSes. One day, a memory leak in a sidecar service started eating all the RAM on one host. Instead of Grepping logs and squinting at docker stats, he opened Portainer, sorted containers by memory, and found the culprit in seconds. Slack notification sent, container restarted, disaster averted. (He now starts every ops session with Portainer or Lazydocker—just in case.)

Wrap-Up: Should You Go Visual?

If you’re still stuck in the terminal-only world, life’s too short for that much guesswork. Portainer and Lazydocker shrink the learning curve, speed up ops, and give you superpowers for debugging, onboarding, and daily maintenance.

  • Use Portainer if you want a full-featured, browser-based dashboard—especially for multi-server setups or teams.
  • Use Lazydocker if you spend lots of time in SSH, love keyboard shortcuts, or want a “Docker htop.”
  • Still love the CLI? No shame in that! Just know you can use these tools side-by-side.

Ready to level up your infrastructure? Grab a fresh VPS or dedicated server, install Docker, and bring your containers out of the dark ages. Visual DevOps is here—and your future self will thank you.

Links:



This article incorporates information and material from various online sources. We acknowledge and appreciate the work of all original authors, publishers, and websites. While every effort has been made to appropriately credit the source material, any unintentional oversight or omission does not constitute a copyright infringement. All trademarks, logos, and images mentioned are the property of their respective owners. If you believe that any content used in this article infringes upon your copyright, please contact us immediately for review and prompt action.

This article is intended for informational and educational purposes only and does not infringe on the rights of the copyright owners. If any copyrighted material has been used without proper credit or in violation of copyright laws, it is unintentional and we will rectify it promptly upon notification. Please note that the republishing, redistribution, or reproduction of part or all of the contents in any form is prohibited without express written permission from the author and website owner. For permissions or further inquiries, please contact us.

Leave a reply

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