sudo groupadd docker && sudo usermod -aG docker $USER && newgrp docker
curl -fsSL https://raw.githubusercontent.com/suodrazah/docker_swarm/main/deploy.sh -o deploy.sh && sh deploy.sh
- Tested on Ubuntu Server 20.04 LTS and Debian 10 Local or VPS.
- VPS at Linode $5+/month
- VPS at OVH $5+/month
- EC2 VPS at AWS free tier for 12 months
- SSH Access as sudo user (if no user available - create one, add to sudo group, login as user)
- Firewall configured to allow 80/tcp, 443/tcp, 22/tcp
- Public, static IP
- Domain pointing to servers public IP address
- Google Domains $18+/year
- No-IP free
- Designed to be executed on a fresh platform
- All updates are handled
- Wait a minute or so for Traefik to come up after the script finishes
- This will bring up Traefik and Portainer on a manager Docker Swarm node
sudo groupadd docker && sudo usermod -aG docker $USER && newgrp docker
curl -fsSL https://raw.githubusercontent.com/suodrazah/docker_swarm/main/deploy.sh -o deploy.sh && sh deploy.sh
-
Domain shall be configured to point at the new node public IP. Note this domain for entry as the node domain when requested upon execution of the script.
-
Additional configuration of your firewalls is required for swarm communication
-
To add a manager node run this on an existing manager node and copy the output:
docker swarm join-token manager
- To add a worker node run this on a manager node and copy the output:
docker swarm join-token worker
- On the node to be added (not as root):
sudo groupadd docker && sudo usermod -aG docker $USER && newgrp docker
curl -fsSL https://raw.githubusercontent.com/suodrazah/docker_swarm/main/add_worker.sh -o add_worker.sh && sh add_worker.sh
- Output you copied earlier from join-token command above
docker swarm join --token KEY IP:2377
- Add a label to the new node
Portainer
Swarm
<node>
+Label
Name
- e.g. worker1Value
- "True"
- Read the comments at the top of the stack you wish to deploy
- Create a new stack
Portainer
Stacks
Add Stack
Name
- e.g. client1-ignitionWeb editor
- copy contents of stack.yml fileEnvironment variables
- as described by the stack comments
- Fix Traefik headers