Installing Portainer #
Portainer is a web interface for managing Docker. This guide will help you install Portainer on your server.
-
Create a Docker object
portainer_datato store Portainer data:docker volume create portainer_data -
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 -
Open a web browser and go to
http://<server-ip>:9000. You will see the Portainer setup screen. -
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.
-
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. -
Click the “Create User” button and create a new user for Portainer.
-
That’s it! You can now use Portainer to manage your Docker containers.