If you’re managing Docker containers on Linux and want a visual interface to simplify things, Portainer Community Edition (CE) is your best friend. It’s lightweight, fast to deploy, and gives you full control over your Docker environment through a clean web interface.
In this guide, you’ll learn how to install Portainer CE using Docker in just a few steps.
Prerequisites
Before you start, make sure:
- Docker is installed and running on your Linux machine.
- You have sudo/root access.
If Docker isn’t installed yet, you can set it up with:
sudo apt update
sudo apt install docker.io -y
sudo systemctl enable docker
sudo systemctl start docker
Step 1: Create a Docker Volume for Portainer Data
Portainer stores data like container configurations in a volume. Let’s create that:
docker volume create portainer_data
Step 2: Deploy Portainer CE Container
Run the following command to launch Portainer:
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:latest
Let’s break that down:
-p 9443:9443
: Exposes the Portainer web UI on port 9443 (HTTPS).-v /var/run/docker.sock:/var/run/docker.sock
: Lets Portainer talk to the Docker engine.-v portainer_data:/data
: Uses the volume we created to persist data.--restart=always
: Ensures Portainer starts automatically after reboots.
Step 3: Access Portainer
Once the container is running, open your browser and go to:
https://<your-server-ip>:9443
The first time you log in, you’ll be prompted to set up an admin user and choose how Portainer should connect to Docker. Select “Local” to manage your current Docker host.
Bonus: Enable HTTP (Optional)
If you’d rather use plain HTTP on port 9000 (not recommended for production), you can run this instead:
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:latest
Then access it at:
http://<your-server-ip>:9000
Wrapping Up
That’s it—you now have Portainer CE running on your Linux machine with Docker. It’s a powerful way to monitor and manage your containers without needing to touch the CLI every time.
Got questions or need help with more advanced configurations like managing remote environments or stacks? Drop them in the comments below.
Happy containerizing!
Leave a Reply