Well I like to maintain my Stuff thru webUI as much as possible so Portainer was the perfect solution for that and it is an Docker also so its a win win situation. Here we go:

Install Docker Compose

Once the docker is installed, run the following command to install docker-compose on Ubuntu.

$ sudo curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose

Set the permission using the command:

$ sudo chmod +x /usr/local/bin/docker-compose

Configure Portainer

We have installed docker and verified by running the simple docker image. Now we will pull the docker portainer/portainer-ce image (formerly portainer/portainer) and run it as a container. Before running the container, create a persistent docker volume to store portainer data.

$ sudo docker volume create portainer_data

Now create the portainer container using the following command.

$ sudo docker run -d -p 9000:9000 -p 8000:8000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v /srv/portainer:/data portainer/portainer-ce

Where:

  • -d => Run the container in detached mode
  • -p => Map the container’s port with docker host port
  • –name => Name of the container
  • -v => Volume Map

Output :

Create a container for Portainer

Please note that the screenshot still uses the old portainer/portainer package, use the new package portainer/portainer-ce instead as used in the updated command above the screenshot.

Run the following command to check the container status

$ sudo docker ps -a

Output :

Docker process list

Portainer is running on port 9000. Browse your server’s IP address with port 9000 in the browser and create a user.

Portainer Login

After creating the user, you will be able to find the portainer’s dashboard. You can manage different docker resources like volumes, containers, networks and images from the UI manager

Portainer dashboard