Skip to main content

Deployment

To deploy the Portainer container, you'll need to first set up a couple of configurations. These configurations will create a persistent volume, expose ports, and enable the container to run at start up automatically. 

Create Persistent Volume

In your docker engine CLI, run the following command:

  • docker volume create portainer_data

    • Volume name is portainer_data

Run the Container

Run the container as you would any other container, with the following ports exposed: 8000 (Portainer Agent), 9000(Web GUI)

  • docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce

    • -d to run in background
    • -p to expose ports
    • --name to name container
    • --restart to make it run constantly
    • /var/run/docker.sock:/var/run/docker.sock to enable portainer to manage the docker registry of the local machine
    • -v declares a volume to use
    • portainer/portainer-ce refers to the community edition version of the container

You're all set! Run through the set-up wizard via the web GUI that can be accessed at your docker engine IP port 9000 and create your admin account. You can now view the following dashboard:

image.png