Short answer: Portainer CE runs as one Docker container. On a Linux machine with Docker, create a volume with docker volume create portainer_data, then start Portainer with the docker run command in Step 2. Open https://your-server-ip:9443, paste the setup token that docker logs portainer prints, and create your admin user within 5 minutes. After that, you start containers and Docker Compose stacks from your browser.
We tested every step on 13 November 2026 with Portainer CE 2.45.3 LTS on Docker Engine 29.9.3, in a disposable lab. All the screenshots and command outputs below come from that test. Where you see localhost, use the IP address or the name of your own server.
What is Portainer?
Portainer is a web interface for Docker. Instead of typing docker commands, you see your containers, images, volumes and networks in your browser, and you start, stop, update and inspect them with a click. Portainer Community Edition (CE) is free and open source. Portainer also sells a Business Edition: in CE, its extra features show a "Business Feature" label.
Portainer itself is a container. It talks to Docker through the Docker socket, so it manages every container on the same machine, also the ones you started before you installed it.
What you need
- A Linux machine (a server, a virtual machine, a mini PC or a NAS) with Docker Engine installed and running. No Docker yet? Follow our guide to install Docker and Docker Compose on Ubuntu. New to containers? Start with Docker for beginners.
- A terminal on that machine, with a user in the
dockergroup orsudorights. If your user is not in thedockergroup, putsudoin front of everydockercommand below. - Port 9443 free on the machine. Port 8000 is only for Edge Agents, so you can leave it out.
- A browser on a computer that can reach the machine.
Step 1: Create a volume for Portainer's data
Portainer keeps its database (your admin user, your settings and your environments) in the /data folder of its container. Put that folder in a named Docker volume, so that it survives updates:
docker volume create portainer_dataDocker answers with the name of the new volume:
portainer_dataStep 2: Start the Portainer container
This is the command from the official Portainer documentation, for the long-term support (LTS) version:
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:ltsWhat each part does:
-p 9443:9443: the web interface, over HTTPS.-p 8000:8000: a tunnel for Edge Agents only. If you manage only this machine, you can remove it.--restart=always: Docker starts Portainer again after a reboot or a crash.-v /var/run/docker.sock:/var/run/docker.sock: gives Portainer control of Docker on this machine. This is full control, so never open Portainer to the internet (see Keep Portainer safe).-v portainer_data:/data: the volume from Step 1.portainer/portainer-ce:lts: the Community Edition image, LTS channel. On the day of our test, thelts,stsandlatesttags all pointed to the same image, version 2.45.3.
The first time, Docker downloads the image, then prints the ID of the new container. Check that the container runs:
docker psCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e9c8e2f965b6 portainer/portainer-ce:lts "/portainer" 6 seconds ago Up 4 seconds 0.0.0.0:8000->8000/tcp, [::]:8000->8000/tcp, 0.0.0.0:9443->9443/tcp, [::]:9443->9443/tcp, 9000/tcp portainerThe STATUS column must start with Up. The 9000/tcp without an arrow is the old HTTP port: Portainer still listens on it inside the container, but the command does not publish it. Use port 9443.
Step 3: Get the setup token
Since versions 2.43 and 2.39.4, a new Portainer instance asks for a one-time setup token before anyone can create the admin user. The token stops a stranger who reaches your new instance first from taking it over. Portainer prints the token in its log:
docker logs portainerNear the end of the log, you see this block. Your token is a string of 64 letters and digits.
==========================
setup_token=<your 64-character token>
Paste it into the setup screen, or send it in the X-Setup-Token header.
Start with --no-setup-token to disable.
========================== |To see only the token line, run the command below. Portainer writes its log to the error stream, so the 2>&1 part is necessary: without it, grep finds nothing.
docker logs portainer 2>&1 | grep setup_tokenCopy the 64 characters after setup_token=. If Portainer restarts before you create the admin user, it prints a new token. Always use the last token in the log.
Step 4: Open Portainer and create the admin user
In your browser, open https://your-server-ip:9443 (on the machine itself: https://localhost:9443). Portainer uses a self-signed certificate, so the browser says that the connection is not private. This is normal for a new install: click Advanced, then continue to the site.

- Username:
adminis already there. You can change it. - Password and Confirm password: at least 12 characters. Keep it in your password manager: Portainer has no default password.
- Setup token: paste the token from Step 3.
- Click Create user.
Do it within 5 minutes. If nobody creates the admin user within 5 minutes of the start, Portainer locks itself for safety. We let it happen in our test, and the browser showed this page:

Restart the container, read the new token, and go back to the setup page:
docker restart portainer
docker logs portainer 2>&1 | grep setup_tokenAfter the restart, our log had a second, different token, and the setup page was back.
Step 5: Skip Edge Compute and finish the quick setup
Portainer 2.45 then offers to set up Edge Compute, a feature to manage remote devices. You do not need it to manage Docker on this machine. Click Skip:

On the Quick Setup page, Portainer has already found the Docker engine it runs on. Click Get Started to use it:

You land on the Home page. Your machine is the local environment, with its state, its Docker version and its number of containers:

Step 6: Open the dashboard
Click local. The dashboard counts your stacks, containers, images, volumes and networks. On a new install, the only container is Portainer itself. The menu on the left opens each list.

Step 7: Run your first container from Portainer
Now start a small web server (nginx) without a docker run command. In the left menu, open Containers, then click Add container:

Fill in the form:

- Name:
hello-nginx. - Image:
nginx:latest. Keep Always pull the image on, so Portainer downloads the newest version. - Under Port mapping, click Map additional port, then type
8080in the Host box. - Type
80in the Container box and keep TCP. - Click Deploy the container.
This form does the same as docker run -d --name hello-nginx -p 8080:80 nginx:latest. A few seconds later, Portainer shows the container list: hello-nginx is running, and its published port is 8080:80.

Open http://your-server-ip:8080. You see the nginx welcome page:

In the same list, you can stop, restart or remove a container. The small icons under Quick Actions open its logs, its details, its live stats and a console. The logs view works like docker logs -f: see how to follow container logs.
Step 8: Deploy a stack (Docker Compose) from Portainer
A stack is a Docker Compose file that Portainer runs for you. As an example, we deploy Uptime Kuma, a free monitoring tool. In the left menu, open Stacks, click Add stack, then:
- Type a Name in lowercase:
uptime-kuma. - Keep Web editor and paste this Compose file:
services:
uptime-kuma:
image: louislam/uptime-kuma:2
container_name: uptime-kuma
restart: unless-stopped
ports:
- "3001:3001"
volumes:
- uptime-kuma:/app/data
volumes:
uptime-kuma:
Scroll down and click Deploy the stack:

Portainer downloads the image and starts the container. In our test, the container showed starting first, then healthy a few minutes later:

Open http://your-server-ip:3001 to create your Uptime Kuma account. Our Uptime Kuma guide shows the next steps. To learn what Portainer does behind this button, see docker compose up.
Install Portainer with Docker Compose instead
If you prefer Compose, Portainer publishes a ready file. Download it and start it:
curl -L https://downloads.portainer.io/ce-lts/portainer-compose.yaml -o portainer-compose.yaml
docker compose -f portainer-compose.yaml up -dThe file contains:
services:
portainer:
container_name: portainer
image: portainer/portainer-ce:lts
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- portainer_data:/data
ports:
- 9443:9443
- 8000:8000 # Remove if you do not intend to use Edge Agents
volumes:
portainer_data:
name: portainer_data
networks:
default:
name: portainer_networkWe ran it on a second, empty Docker engine (Docker Compose v5.7.1):
$ docker compose -f portainer-compose.yaml up -d
Image portainer/portainer-ce:lts Pulling
Image portainer/portainer-ce:lts Pulled
Network portainer_network Creating
Volume portainer_data Creating
Volume portainer_data Created
Network portainer_network Created
Container portainer Creating
Container portainer Created
Container portainer Starting
Container portainer StartedPortainer 2.45.3 started and printed a setup token, as in Step 3. Then continue with Step 4. The volume has the same name as in Step 1. The Portainer documentation links the STS file (ce-sts in the address), which uses the sts tag; ce-lts gives the LTS file above.
Install Portainer on a Synology NAS
A Synology NAS runs Docker through the Container Manager package, so the same commands work there. We did not repeat this part on a Synology for this update, so check each screen on your model:
- Install Container Manager from Package Center. Before DSM 7.2, the package is called Docker.
- Turn on SSH and connect as an administrator: see how to SSH into your Synology.
- Run the commands of Step 1 and Step 2 with
sudoin front. - Open
https://your-nas-ip:9443and continue with Step 3 (sudo docker logs portainer 2>&1 | grep setup_token).
Container Manager keeps working: Portainer is a second view of the same containers. To update containers the Synology way, see how to update a Docker container on Synology.
How to update Portainer
Your users, settings and stacks are in the portainer_data volume, not in the container. To update, you replace the container and keep the volume. Make a backup first: in Portainer, open Settings, go to Back up Portainer and click Download backup. The file holds the Portainer configuration, not your containers.
Then run these four commands. The last one is the command of Step 2:
docker stop portainer
docker rm portainer
docker pull portainer/portainer-ce:lts
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:ltsOur output. Our image was already the newest, so the pull said "up to date":
$ docker stop portainer
portainer
$ docker rm portainer
portainer
$ docker pull portainer/portainer-ce:lts
lts: Pulling from portainer/portainer-ce
Digest: sha256:3609c307943bca8e5c492f69ddd6965df177208b50678a4cff28391c8dd4e96e
Status: Image is up to date for portainer/portainer-ce:lts
docker.io/portainer/portainer-ce:lts
$ 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:lts
d56ee0659b9f…We then logged in with the same admin user, and hello-nginx and the uptime-kuma stack were still there. Portainer asked for no token, because the instance already had an admin. While Portainer is stopped, your other containers keep running.
If you installed Portainer with Compose, update it from the folder of the Compose file:
docker compose -f portainer-compose.yaml pull
docker compose -f portainer-compose.yaml up -d$ docker compose -f portainer-compose.yaml pull
Image portainer/portainer-ce:lts Pulling
Image portainer/portainer-ce:lts Pulled
$ docker compose -f portainer-compose.yaml up -d
Container portainer RunningWhen a newer image exists, the up -d command replaces the container. In our test, the image was the newest, so the container stayed as it was ("Running").
How to uninstall Portainer
docker stop portainer
docker rm portainer
docker volume rm portainer_dataThe last command deletes Portainer's users and settings for good. Skip it if you may come back. Your other containers are not touched. Our output, with a check at the end:
$ docker stop portainer
portainer
$ docker rm portainer
portainer
$ docker volume rm portainer_data
portainer_data
$ docker ps --format 'table {{.Names}}\t{{.Status}}'
NAMES STATUS
uptime-kuma Up 9 minutes (healthy)
hello-nginx Up 16 minutesKeep Portainer safe
- Do not open ports 9443, 9000 or 8000 to the internet on your router. A person who gets into Portainer controls every container and, through the Docker socket, the machine itself.
- To use Portainer away from home, connect through a VPN, or put it behind a Cloudflare Tunnel with a login page in front: see how to create a Cloudflare Tunnel on Synology. If you use Nginx Proxy Manager, see how to keep the real visitor IP.
- Use a long, unique admin password, and update Portainer regularly.
Troubleshooting
"Your Portainer instance timed out for security purposes"
Nobody created the admin user within 5 minutes of the start. Run docker restart portainer, read the new token, and finish Step 4 right away.
The setup token is refused
You probably used an old token: each start prints a new one. Run docker logs portainer 2>&1 | grep setup_token, take the last line, and copy only the 64 characters after setup_token=.
grep shows nothing
Add 2>&1 before the pipe. Portainer writes its log to the error stream, and a pipe passes only the normal output.
The page does not open
Use https://, not http://, and port 9443. Check that docker ps shows 0.0.0.0:9443->9443/tcp. If the machine has a firewall, allow the port. On Ubuntu with ufw: sudo ufw allow 9443/tcp.
"port is already allocated"
Another program uses port 8000 or 9443. If you do not use Edge Agents, remove -p 8000:8000. For the interface, publish another host port, for example -p 9444:9443, and open https://your-server-ip:9444.
Frequently asked questions
Is Portainer free?
Portainer Community Edition is free and open source. The menus with a "Business Feature" label need the paid Business Edition. Everything in this guide works in CE.
What is the default Portainer username and password?
There is no default password. On the first visit, you create the admin user yourself. The username box starts with admin, and the password needs at least 12 characters.
Which port does Portainer use?
Port 9443 for the web interface, over HTTPS. Port 8000 is the tunnel for Edge Agents. Port 9000 is the old HTTP port: the current install command does not publish it.
Should I use the lts or the sts tag?
Use lts (long-term support) on a home server: it gets fixes for longer. sts (short-term support) gets new features first. On 13 November 2026, both tags pointed to version 2.45.3.
Does removing Portainer remove my containers?
No. Portainer only manages Docker. In our test, hello-nginx and Uptime Kuma kept running after we removed the Portainer container and its volume.
Can I install Portainer without the setup token?
Yes: start it with --no-setup-token, or set the admin password at start with --admin-password-file. Portainer advises --no-setup-token only on a network that you fully control. The token step takes one minute, so keep it.
Related guides
- Your first self-hosted service
- How to install Uptime Kuma on Docker
- Install Docker Compose on Ubuntu
- How to SSH into your Synology
Sources
Leave a comment
Your email address will not be published. Required fields are marked *
