Installing Portainer

Register to Stay in Contact

How simple is it to deploy Portainer?

Portainer installation using Docker

Portainer is comprised of two elements, the Portainer Server, and the Portainer Agent. Both elements run as lightweight Docker containers on a Docker engine or within a Swarm cluster.
Due to the nature of Docker, there are many possible deployment scenarios, however, we have detailed the most common below. Please use the scenario that matches your configuration (or if your configuration is not listed, see portainer.readthedocs.io for additional options).

Note that the recommended deployment mode when using Swarm is using the Portainer Agent.

Deploy Portainer Server on a standalone LINUX Docker host/single node swarm cluster (or Windows 10 Docker Host running in “Linux containers” mode).

Use the following Docker commands to deploy the Portainer Server; note the agent is not needed on standalone hosts, however it does provide additional functionality if used (see portainer and agent scenario below):

$ docker volume create portainer_data
$ docker run -d -p 8000:8000 -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer

You'll just need to access the port 9000 of the Docker engine where portainer is running using your browser.

Note: the -v /var/run/docker.sock:/var/run/docker.sock option can be used in Linux environments only.

Deploy Portainer Server on a standalone WINDOWS Docker Host (running Windows Containers) – note must be Windows 1803 or newer.

$ docker volume create portainer_data
$ docker run -d -p 8000:8000 -p 9000:9000 --name portainer --restart always -v \\.\pipe\docker_engine:\\.\pipe\docker_engine -v portainer_data:C:\data portainer/portainer

You'll just need to access the port 9000 of the Docker engine where portainer is running using your browser.

Note: the -v \\.\pipe\docker_engine:\\.\pipe\docker_engine option can be used in Windows 1803+ Container environments only.

Manage a LINUX Swarm cluster with Portainer Server and the Portainer Agent

Deploying Portainer and the Portainer Agent to manage a Swarm cluster is easy ! You can directly deploy Portainer as a service in your Docker cluster. Note that this method will automatically deploy a single instance of the Portainer Server, and deploy the Portainer Agent as a global service on every node in your cluster.

$ curl -L https://downloads.portainer.io/portainer-agent-stack.yml -o portainer-agent-stack.yml
$ docker stack deploy --compose-file=portainer-agent-stack.yml portainer

You'll just need to access the port 9000 of the Docker engine where portainer is running using your browser.

PORTAINER AGENT DEPLOYMENTS ONLY

Deploy Portainer Agent on a remote LINUX Swarm Cluster as a Swarm Service, run this command on a manger node in the remote cluster.

$ docker service create --name portainer_agent --network portainer_agent_network --publish mode=host,target=9001,published=9001 -e AGENT_CLUSTER_ADDR=tasks.portainer_agent --mode global --mount type=bind,src=//var/run/docker.sock,dst=/var/run/docker.sock --mount type=bind,src=//var/lib/docker/volumes,dst=/var/lib/docker/volumes –-mount type=bind,src=/,dst=/host portainer/agent

Deploy Portainer Agent on a standalone Windows Server 2016 Docker Host

$ docker run -d -p 9001:9001 --name portainer_agent --restart=always -v \\.\pipe\docker_engine:\\.\pipe\docker_engine portainer/agent

Deploy Portainer Agent on SINGLE  Windows Server 2016 Docker Host running as a Swarm Node (for multi-node deployments, please see advanced configurations)

$ docker run -d -p 9001:9001 --name portainer_agent --restart=always -v \\.\pipe\docker_engine:\\.\pipe\docker_engine -e AGENT_CLUSTER_ADDR=tasks.agent portainer/agent

Note: the three options above only deploy the agent, you must connect to the agent from an existing Portainer Server instance.

And more deployment scenarios

To see how to use our Edge compute agent, see the user guides here: https://downloads.portainer.io/edge_agent_guide.pdf

Have a look at our installation documentation for more deployment scenarios such as Portainer with data persistence, TLS authentication enabled engine, non-Docker setup or reverse proxy integrations.https://portainer.readthedocs.io/en/stable/deployment.html