Install Portainer with Docker on Linux
These instructions are for Portainer Community Edition. For Business Edition, please refer to the Business Edition documentation.

Introduction

Portainer consists of two elements, the Portainer Server, and the Portainer Agent. Both elements run as lightweight Docker containers on a Docker engine. This document will help you install the Portainer Server container on your Linux environment. To add a new Linux environment to an existing Portainer Server installation, please refer to the Portainer Agent installation instructions.
To get started, you will need:
  • The latest version of Docker installed and working
  • sudo access on the machine that will host your Portainer Server instance
  • By default, Portainer Server will expose the UI over port 9443 and expose a TCP tunnel server over port 8000. The latter is optional and is only required if you plan to use the Edge compute features with Edge agents.
The installation instructions also make the following assumptions about your environment:
  • You are accessing Docker via Unix sockets. Alternatively, you can also connect via TCP.
  • SELinux is disabled on the machine running Docker. If you require SELinux, you will need to pass the --privileged flag to Docker when deploying Portainer.
  • Docker is running as root. Portainer with rootless Docker has some limitations, and requires additional configuration.

Deployment

First, create the volume that Portainer Server will use to store its database:
1
docker volume create portainer_data
Copied!
Then, download and install the Portainer Server container:
1
docker run -d -p 8000:8000 -p 9443:9443 --name portainer \
2
--restart=always \
3
-v /var/run/docker.sock:/var/run/docker.sock \
4
-v portainer_data:/data \
5
portainer/portainer-ce:latest
Copied!
By default, Portainer generates and uses a self-signed SSL certificate to secure port 9443. Alternatively you can provide your own SSL certificate during installation or via the Portainer UI after installation is complete.
If you require HTTP port 9000 open for legacy reasons, add the following to your docker run command:
-p 9000:9000
Portainer Server has now been installed. You can check to see whether the Portainer Server container has started by running docker ps:
1
[email protected]:~# docker ps
2
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3
de5b28eb2fa9 portainer/portainer-ce:latest "/portainer" 2 weeks ago Up 9 days 0.0.0.0:8000->8000/tcp, :::8000->8000/tcp, 0.0.0.0:9443->9443/tcp, :::9443->9443/tcp portainer
Copied!

Optional: Adding the Portainer Agent

With Docker Standalone, you have the optional step of installing the Portainer Agent alongside your Portainer Server installation. Doing so provides additional functionality such as volume browsing from within Portainer.
Once you have completed the above installation process, you can run the following command to install the Portainer Agent:
1
docker run -d -p 9001:9001 --name portainer_agent --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker/volumes:/var/lib/docker/volumes portainer/agent:latest
Copied!
You may also want to enable host management features to provide the ability to browse the local filesystem from within Portainer.

Logging In

Now that the installation is complete, you can log into your Portainer Server instance by opening a web browser and going to:
1
https://localhost:9443
Copied!
Replace localhost with the relevant IP address or FQDN if needed, and adjust the port if you changed it earlier.
You will be presented with the initial setup page for Portainer Server.
Last modified 2d ago