Portainer is a lightweight and powerful UI for managing Docker environments. This guide covers both docker run and docker-compose installation methods.

Prerequisites
  1. Docker installed and running
  2. Docker Compose (v2 preferred)
  3. Basic Docker knowledge

Option 1: Install Using docker run


Step 1: Create a Docker Volume
Code:
docker volume create portainer_data


Step 2: Run Portainer Container
Code:
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


Step 3: Access Portainer
Open your browser and go to:
Code:
https://localhost:9443


Note: You'll be prompted to create an admin account on first access.




Option 2: Install Using Docker Compose


Step 1: Create a docker-compose.yml file

Save this as docker-compose.yml:
YAML:
version: '3.8'


services:portainer:image: portainer/portainer-ce:latestcontainer_name: portainerrestart: alwaysports:- "8000:8000"- "9443:9443"volumes:- /var/run/docker.sock:/var/run/docker.sock- portainer_data:/data


volumes:portainer_data:


Step 2: Start Portainer
Code:
docker compose up -d


Step 3: Access Portainer UI
Go to:
Code:
https://localhost:9443




Optional: Run on HTTP instead of HTTPS


If you prefer HTTP:


  1. Change the ports in your compose file to:
    Code:
    ports:
    [/LIST]
    
    [LIST]
    [*]"9000:9000"

  1. Access via:
    Code:
    http://localhost:9000



You're all set!
  • logo_alt.png
    logo_alt.png
    10.8 KB · Views: 57