Portainer is a lightweight management UI which allows you to easily manage your Docker host or Swarm cluster.
Setup Portainer in Docker
- Double click on Docker app-icon to start Docker engine
- Open Terminal on MacOS or Command-line on Windows after Docker is running
- Type docker and press enter
- If docker comands gets listed then it is runnning properly, otherwise read logs to debug further
- Now type this command to create a container named portainer and run it
- docker run --name portainer -d -p 9000:9000 --restart always -v /var/run/docker.sock:/var/run/docker.sock -v /Users/abhishekkumar/Documents/Programs/portainer:/data portainer/portainer
- Here, /Users/abhishekkumar/Documents/Programs can be replaced with your custom path
- Open web-browser and go to localhost:9000
- A Portainer GUI would open, if everything works fine
- Fill up the form by setting admin password
- Click on Local Connection tab to connect with locally running portainer webapp
- Further explore the app
Stop the running Portainer or start/restart again
- Open Terminal and run this command to stop the container
- docker stop portainer
- Run this command to restart the container again
- docker restart portainer
- Or run this command to start the container in future
- docker start portainer
Comments
Post a Comment