Bart Simons

Bart Simons


Thoughts, stories and ideas.

Bart Simons
Author

Share


Tags


.net .net core Apache C# CentOS LAMP NET Framework Pretty URLs Windows Server WireGuard WireGuard.io access log add analysis android api at the same time authentication authorization automate automation azure azurerm backup bash basics batch bootstrap build capture cheat sheet chromium chroot class cli click to close code snippet command line commands compile compiling compression containers control controller controlling convert cpu usage create credentials csv csvparser curl data dd deployment desktop detect devices disable diskpart dism distributed diy docker dom changes dotnet core drivers ease of access encryption example export file transfer files fix folders generalize getting started ghost ghost.org gui guide gunicorn gzip html html tables icewarp igd imagex import inotify install installation interactive ios iphone itunes java javascript jquery json kiosk kotlin linux live load data loading screen lock screen loopback audio lxc lxd lxml macos manage manually message messages minio mirrored mod_rewrite monitor monitoring mutationobserver mysql nexmo nginx no oobe node node.js nodejs not installing notification notifications object storage on desktop one command openssl owncloud parallels parallels tools parse perfect philips hue play port forwarding portainer.io powershell processing ps-spotify python quick raspberry pi record rip ripping rsync rtmp save save data sbapplication scraping script scripting scriptingbridge scripts security send server service sharedpreferences sms songs sonos spotify spotify api spotlight ssh stack streaming streamlink studio sudo swarm swift sync sysprep system audio systemd tables terminal tracking tutorial twilio ubiquiti ubuntu ubuntu 18.04 ui code unifi unlock unsplash source upnp uptime usb tethering wallpapers wasapi website websites webview windows windows 10 without itunes without oobe workaround xaml

Using Portainer.io to build and manage your Docker swarm

Are you planning on deploying a Docker swarm anytime soon? Just rethink about how you want to manage your Docker compute hosts. Do you want to go with the CLI way of doing things, or are you most likely preferring a GUI-based frontend to manage your Docker swarm? Personally I'm a fan of doing all the things over a CLI interface, but hey: GUI-managed solutions can be good if they are done right.

So, let's get straight into talking about what Portainer.io can do for you and your (future) Docker environment: most of the things that you would usually do in the Docker CLI interface are made into a sleek-looking graphical interface with Portainer.

Setting up a basic Docker swarm with two compute nodes

Imagine having three servers for your Docker setup:

These are the IP addresses of the 3 machines

On the 'Docker Manager' machine, you execute the following command to initialise a new Docker swarm:

docker swarm init --advertise-addr 10.131.38.69

This command also returns what you need to know to make compute nodes join your Docker swarm:

Docker Swarm Init

Once you have all your member servers joined into your swarm you can install Portainer.io on your Docker management server with this command:

docker service create --name portainerio -p 9000:9000 --constraint 'node.role == manager' --mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock portainer/portainer -H unix:///var/run/docker.sock

You are now running a Portainer.io instance on port 9000, great! Open your webbrowser and navigate to the web interface, fill in a password and login with the password that you just set.

Docker swarm in portainer.io

Boom! It works and shows you all the worker machines inside the web panel. Now it's all up to you what you are going to build and/or deploy. I hope this article was informative for you, enjoy the freedom of containers!

Bart Simons
Author

Bart Simons

View Comments