Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@scyto
Last active March 23, 2023 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scyto/a57d63a3b905b24e9eb25618848c8e80 to your computer and use it in GitHub Desktop.
Save scyto/a57d63a3b905b24e9eb25618848c8e80 to your computer and use it in GitHub Desktop.
Installing Portainer on a swarm

This is how to install portainer on the swarm you created using this gist note this should work on non-swarm installs too!

Setup Portainer

Download the portain stack yaml that will do this for you

curl -L https://downloads.portainer.io/ce2-17/portainer-agent-stack.yml -o portainer-agent-stack.yml

now run it

sudo docker stack deploy -c portainer-agent-stack.yml portainer

this will create a single portainer container that runs on the management node and deploy the agent to all worker nodes, once complete you can now access portainer at http://docker-host-ip:9000 and define your admin users etc

You now have a fully function docker swarm with portainer and can deploy containers, stacks or templates.

How to use portainer is beyond the scope of this gist

This is the portainer install doc at time of writing for reference but the instructions above will work just fine

@scyto
Copy link
Author

scyto commented Mar 23, 2023

##note##
alter the portainer-agent-stack.yml volume directives if you want to store the data in a different location from where you downloaded the yml too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment