Installing Portainer

Installing Portainer #

Portainer is a web interface for managing Docker. This guide will help you install Portainer on your server.

  1. Create a Docker object portainer_data to store Portainer data:

    docker volume create portainer_data
    
  2. Start Portainer on port 9000:

    docker run -d -p 9000:9000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer
    
  3. Open a web browser and go to http://<server-ip>:9000. You will see the Portainer setup screen.

  4. Choose the type of Portainer setup. If you are using Docker locally, choose the “Local” option. If you are using Docker Swarm, choose the “Swarm” option.

  5. After choosing the type of setup, enter the container name and select the Docker API URL. If you are using local Docker, the API URL should be unix:///var/run/docker.sock.

  6. Click the “Create User” button and create a new user for Portainer.

  7. That’s it! You can now use Portainer to manage your Docker containers.