Running Docker from the command line is great for learning, but after a few containers it gets hard to keep track of what’s running, what has crashed, and which volumes belong to which app. Portainer gives you a web dashboard for all of it. You can see every container, read its logs, restart it, and deploy new apps by pasting in a Compose file.
This guide shows you how to run Portainer on a mini PC with Docker Compose, take a tour of what it can do, and use it safely. Portainer has one serious security trade-off that many tutorials skip, so we’ll cover that before you start. If you’re new to Docker, read our Docker Compose tutorial for beginners first.
What Portainer is
Portainer is a management interface for Docker. The free version is called Community Edition (CE), and it’s what this guide uses. Portainer also sells paid editions for businesses, which you don’t need for a home lab. Portainer itself runs as a container, and it manages Docker by talking to the Docker engine on the same machine.
Do you need it?
Not at first. The command line teaches you what’s really happening, and a few containers are easy to manage with Compose files. Portainer starts to earn its place when you run enough apps that you want one overview, or when someone else in your home needs to restart a service without opening a terminal. Many people use both: Compose files for setup and Portainer for looking around.
Read this first: the Docker socket risk
Portainer needs access to Docker’s control socket, which is a special file on your server. Anything that can use that socket can start containers with access to your whole machine, so it’s effectively administrator access. One 2026 Portainer guide describes it as “root-shaped power.”
That doesn’t make Portainer unsafe on a home network, but it sets the rules:
- Use a long, unique admin password.
- Keep the number of Portainer accounts small.
- Never expose the Portainer page to the internet.
What you need
- A Linux mini PC with Docker and the Compose plugin. If you’re starting fresh, see our guide to installing Ubuntu Server on a mini PC.
- Docker installed from Docker’s own repository. Portainer’s community guides warn that Docker installed as a Snap package can cause socket and path problems.
- A second device with a browser to open the dashboard.
Step 1: Create the folder
sudo mkdir -p /srv/docker/portainer
sudo chown -R $USER:$USER /srv/docker
cd /srv/docker/portainerStep 2: Write the Compose file
nano compose.yamlPortainer’s usual install command and several 2026 guides use the same pieces: the Community Edition image, port 9443 for the web interface, the Docker socket, and a place to keep data. Here they are as a Compose file:
services:
portainer:
container_name: portainer
image: portainer/portainer-ce:lts
restart: unless-stopped
ports:
- "9443:9443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./data:/dataWhat each part does
- The image tag lts follows Portainer’s long-term support release. Some older guides use
latest, so check Portainer’s documentation for the tag it currently recommends. - Port 9443 is the secure web page. Many guides also publish port 8000, but that’s only for a feature called Edge Agents, so you can leave it out.
- The socket line is what lets Portainer see and manage your containers.
- The data folder keeps your accounts and settings, so they survive updates.
Step 3: Start it and create your account
docker compose up -dOpen https://YOUR-SERVER-IP:9443 in a browser. Use https, not http. Your browser will warn that the connection isn’t private, because Portainer uses a self-signed certificate by default. On your own home network that’s expected, so continue past the warning.
Create your admin account straight away. Portainer asks you to do this within a limited time after it first starts, and if the page says the setup window expired, restart the container with docker compose restart and try again.
Step 4: Take a tour
After you log in, click the local environment. The sections you’ll use most are:
- Containers: every container, its status, and buttons to start, stop, restart, or remove it. Click one to read its logs or see CPU and memory use.
- Images: the downloaded images, including old ones you can clean up.
- Volumes: where your containers store data.
- Networks: the virtual networks Docker has created.
- Stacks: Compose-style groups of containers, which we’ll use next.
The logs view alone is worth the setup. When an app misbehaves, you can read its output in a browser instead of typing commands.
Step 5: Deploy an app as a stack
In Portainer, a stack is the same thing as a Compose file. To try one:
- Open Stacks and choose to add a stack.
- Give it a name, like
uptime-kuma. - Paste in a Compose file, such as the one from our Uptime Kuma monitoring guide. Use absolute paths for volumes, like
/srv/docker/uptime-kuma/data:/app/data, because relative paths work differently inside Portainer. - Click deploy.
Pick one way to manage each app. Portainer can show containers you started from the command line, but a stack you create in Portainer is the one it can edit. Mixing both for the same app causes confusion. Whichever you choose, keep a copy of every Compose file in your own folder or a Git repository, so you can rebuild without Portainer.
Keep Portainer safe
- Never forward port 9443 on your router. For access away from home, use a private network. Our Tailscale remote access guide shows how.
- Don’t rely on ufw alone. Ports published by Docker can bypass ufw rules on Ubuntu, so check Docker’s firewall documentation if you want to restrict who can reach Portainer.
- Use unique accounts if more than one person logs in, and give out admin rights sparingly.
- Update regularly. Run
docker compose pullanddocker compose up -dfrom the Portainer folder.
Back it up
Portainer’s data folder holds your accounts and settings. Include /srv/docker/portainer in your backups, and copy it while Portainer is stopped. Treat the backup like a secret, because it contains authentication material. Our homelab backup strategy for beginners shows a simple routine.
Troubleshooting common problems
The setup window expired
Restart the container, reload the page, and create the admin account right away.
The browser shows a certificate warning
That’s the self-signed certificate. It’s normal on a home network, and you can continue. You can add your own certificate later in Portainer’s settings.
The local environment is empty or shows an error
The Docker socket probably isn’t mounted correctly, or Docker isn’t running. Check the volume line in your Compose file and run systemctl status docker.
The container exits right away
Another program may be using port 9443. Check with ss -tlnp | grep 9443, and read the logs with docker compose logs.
Problems with Snap-installed Docker
Reinstall Docker from Docker’s official repository, following the Docker Engine installation guide.
Frequently asked questions
Is Portainer free?
The Community Edition is free and open source. Paid business editions exist, but home users usually don’t need them.
Is Portainer safe?
It’s safe enough on a private home network if you use a strong password and never expose it to the internet. Remember that it has broad control over Docker.
Do I still need to learn Docker commands?
Yes. Portainer is a convenient view of Docker, but the command line still helps you understand and fix problems.
Can Portainer manage more than one server?
Yes, it can connect to other Docker hosts, but that’s an advanced step, so start with one machine.
Wrapping up
Portainer gives you a clear, friendly view of everything Docker is doing on your mini PC. Run it with a short Compose file, create your admin account quickly, explore the containers and logs, and deploy a stack. Respect the Docker socket risk by keeping it on your home network and your accounts limited, back up the data folder, and keep your own copies of your Compose files.