← Self-Hosting · Foundations 2 of 8 · Replaces: typing docker commands for everything
What You'll Build
Portainer Community Edition is a free web interface for Docker. Instead of SSH-ing in to check on an app, open a browser tab: every container, its status, logs, CPU and memory use, and a console — all point-and-click.
Port: 9443 · Time: 10 minutes · Difficulty: Easy
What You Need
- A server with Docker, from Foundations 1.
Step 1: Create the Compose File
mkdir -p ~/stacks/portainer && cd ~/stacks/portainer
nano compose.yaml
services:
portainer:
image: portainer/portainer-ce:lts # long-term-support release
container_name: portainer
restart: unless-stopped
ports:
- "9443:9443" # web UI (HTTPS, self-signed certificate)
volumes:
- /var/run/docker.sock:/var/run/docker.sock # lets Portainer control Docker
- ./data:/data # Portainer's own settings
docker compose up -d
Step 2: Create Your Admin Account (Within 5 Minutes!)
- Open
https://192.168.1.50:9443. Your browser warns about the certificate — that's expected for a self-signed one. Click Advanced → Continue. - Create the admin user with a long password (12+ characters).
- Choose Get Started to manage the local Docker environment.
For security, Portainer locks the setup page if no admin is created within about 5 minutes of starting. If you see a timeout message, run docker compose restart and try again.
Step 3: A Tour of the Useful Bits
- Containers: the list of everything running. Click a container for Logs, Stats, Console (a shell inside it), and Restart.
- Stacks: compose projects. Apps you start from
~/stackswith the terminal show here as "limited" — you can view and restart them, but edit them in the terminal. - Images: clean up old downloaded images to free disk space (tick Unused → Remove).
- Volumes / Networks: advanced; look, don't delete unless you're sure.
Terminal or Portainer? This site keeps every app as a compose.yaml in ~/stacks so it's easy to back up and to copy between machines. Use Portainer to watch and restart; use the terminal to create and change.
Troubleshooting
- Page won't load — make sure you typed
https://(not http) and port 9443. - Forgot the admin password — stop the stack, delete
~/stacks/portainer/data, start it again, and redo Step 2 (your other apps aren't affected).
What's Next?
Give every app a proper name and HTTPS padlock instead of IP:port: