Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

To create a Docker Swarm on Linux VPS servers, install Docker Engine on every VPS, initialize one VPS as the manager with docker swarm init --advertise-addr <MANAGER_IP>, join the remaining VPS instances with the generated worker or manager token, and verify the cluster with docker node ls. Before initialization, restrict the Swarm control and overlay ports to traffic between trusted nodes.

This guide covers Swarm mode, not the obsolete Swarm Classic project. It also distinguishes the ports and firewall rules required for a current Swarm-mode cluster from older or unofficial port lists.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What you are building

Docker Swarm mode turns several Docker Engine installations into one cluster. A manager maintains the cluster state, accepts administrative commands, schedules services, and distributes tasks. Workers run the containers assigned to them. A node can be both a manager and a worker, although separating those roles is usually easier to reason about as the cluster grows.

Swarm mode uses mutual TLS certificates issued by a swarm-wide, self-signed root certificate authority. During initialization, Docker also creates a worker join token, a manager join token, and an overlay network named ingress. The ingress network supports the routing mesh used when a published service port receives traffic on a node.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application:Upgraded attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Warranty & Support: Our Electric air duster comes with 5 years warranty and 24/7 customer service. During this period, if you have any questions,pls kindly feel free to contact us.

The steps below assume Linux VPS instances that can reach one another over stable IP addresses and that you have root or equivalent administrative access on each server.

Prerequisites and planning

VPS layout

  • Choose one VPS as the initial manager. Its address must be reachable by every node that will join the swarm.
  • Prepare one or more additional VPS instances as workers, or plan to add additional managers if you need manager redundancy.
  • Use a private address between VPS instances when your hosting provider supplies a private network. If no private network exists, use the manager’s reachable address and limit access to the known node addresses with your firewall.
  • Give each server a stable hostname and synchronized system time. Record which address belongs to each node before running initialization.

Docker Engine

Install Docker Engine on every VPS using the installation instructions for that Linux distribution. The installation is not a Swarm operation, and a node cannot join until the Docker daemon is running. Confirm locally on each server with:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
docker version

Check the Engine version and distribution-specific support before production. The exact minimum version and behavior can change, and the current documentation should be treated as authoritative for your chosen release.

Privileges and network policy

Run the swarm commands as root or through an account permitted to access the Docker socket. Configure both the VPS operating-system firewall and any provider-level firewall. Allow Swarm ports only between node addresses; expose application ports separately according to the services you intend to publish.

Open the required Swarm ports

The following list is for Docker Swarm mode. Verify the current Docker documentation before production because port requirements and wording can change between releases.

Port or protocol Transport Purpose Recommended exposure
2377 TCP Communication with and between manager nodes, including joins to the manager. Only between trusted swarm nodes; do not expose it publicly.
7946 TCP and UDP Overlay-network node discovery. Allow between every swarm node.
4789 UDP Overlay-network traffic, using VXLAN by default. Docker documents this port as configurable. Allow between every swarm node that carries overlay traffic.
IP protocol 50 IPSec ESP Encrypted overlay networks created with the --opt encrypted option. Allow between nodes only when you use encrypted overlays.

Ports 7946/TCP, 7946/UDP, and 4789/UDP must be available between nodes before enabling swarm mode for the routing mesh. Do not blindly add TCP 2376, 2375, 3375, or 8500 from old blog posts: community lists may describe a different product or Swarm Classic, not current Swarm mode.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Example UFW policy

If your distribution uses UFW, add rules that name the other node addresses rather than allowing the ports from the whole internet. Replace the address values with real node IPs; the commands are examples of the policy shape, not a substitute for your provider’s firewall configuration.

Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth
sudo ufw allow from <NODE_IP> to any port 2377 proto tcp
sudo ufw allow from <NODE_IP> to any port 7946 proto tcp
sudo ufw allow from <NODE_IP> to any port 7946 proto udp
sudo ufw allow from <NODE_IP> to any port 4789 proto udp

Repeat the rules for each trusted node, then apply the firewall according to your distribution’s procedure. Keep SSH access available from your administration network so a firewall change does not lock you out.

Initialize the first manager

  1. Connect to the VPS selected as the manager.
  2. Identify the address that the other VPS instances can actually reach. A public address may be necessary when the provider has no private network; otherwise prefer the private inter-node address.
  3. Run the initialization command, replacing the example address:
docker swarm init --advertise-addr <MANAGER_IP>

Docker’s reference example uses docker swarm init --advertise-addr 192.168.99.121. Do not copy that address unless it is the reachable address of your own manager.

A successful initialization prints a message similar to:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Swarm initialized: current node (bvz81updecsj6wjz393c09vti) is now a manager.

The identifier in that message is an example node ID. Your output will contain a different ID. Initialization creates the swarm certificate authority, join credentials, and the ingress overlay network. Save the join commands in a protected password manager or other restricted location; anyone who obtains a manager token can join with control privileges.

Choosing the advertised address correctly

--advertise-addr tells other nodes which address to use for swarm communication. It is not simply the address displayed by a local command: it must be routable from every node. Advertising a loopback address, an unreachable private address, or an interface blocked by a provider firewall commonly produces joins that time out or nodes that remain unreachable.

If a VPS has several interfaces, use the address on the network that carries node-to-node traffic. Test reachability from another VPS before initialization and confirm that the firewall permits TCP 2377 plus the discovery and overlay traffic described above.

Join worker VPS servers

Initialization prints a worker join command containing a token and the manager endpoint. On each worker VPS, run the exact command printed by the manager:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.
docker swarm join --token <WORKER_TOKEN> <MANAGER_IP>:2377

The token and address are intentionally shown as placeholders inside the command. Copy the real values from the manager’s output, keep the manager endpoint on port 2377, and do not wrap the token in extra quotation marks.

When the join succeeds, Docker reports that the node joined the swarm as a worker. Repeat the command on every worker. A worker does not need a separate initialization step; it must have Docker Engine running and network access to the manager and the overlay ports.

Add another manager when appropriate

A manager token makes the joining node a manager rather than a worker. Use it only for servers that should participate in cluster administration and state management:

docker swarm join --token <MANAGER_TOKEN> <MANAGER_IP>:2377

Manager credentials are more sensitive than worker credentials because they grant control over the swarm. Store them separately from routine application secrets, limit who can retrieve them, and rotate them if they may have been exposed.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The evidence available for this guide does not establish a particular manager-quorum count or a required odd-number pattern. For a production design, consult the current Docker manager and quorum documentation for your release instead of assuming a fixed topology.

Retrieve or rotate join tokens

Run these commands on an existing manager:

docker swarm join-token worker
docker swarm join-token manager

Each command displays a fresh join command containing the current token. Add -q when you need only the token value:

docker swarm join-token -q worker
docker swarm join-token -q manager

Use token rotation after a credential has been disclosed or when your access policy requires it. Rotation invalidates the previous token for future joins; nodes that already joined remain members. Treat the manager token as highly sensitive because it can be used to add administrative nodes.

Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.

Verify that the cluster is healthy

On the manager, list every node:

docker node ls

The output identifies each node, its role, availability, and status. The initial manager should appear as a manager, and successfully joined workers should appear as workers. Run this command on a manager; a worker does not have permission to display the complete node inventory.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Ready: the node is connected and available for scheduling.
  • Down or unreachable: check that Docker is running, the advertised address is correct, and TCP 2377 plus the discovery and overlay ports are allowed between the affected nodes.
  • Drain: the node is connected but will not receive new tasks. This may be intentional maintenance configuration.

For a second local check, run docker info on each server and confirm that the node reports swarm mode as active. The manager’s node list is the authoritative view of membership.

Deploy a small service to test scheduling and publishing

Once membership is healthy, create a simple replicated service from the manager to test scheduling. For example, this command asks Swarm to run two replicas and publish container port 80 on port 8080 of the routing mesh:

docker service create --name web --publish published=8080,target=80 --replicas 2 nginx

This is a functional test rather than a production deployment pattern. Inspect placement and task state with:

docker service ls
docker service ps web

The routing mesh means a request to a published port can enter through a node and be routed to an active task elsewhere in the swarm. Open the published application port in your firewall only if the service is meant to be publicly reachable; it is separate from the internal Swarm ports.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Remove the test service when finished:

docker service rm web

For real workloads, define services in a version-controlled stack file, set explicit resource and restart policies, and publish only the ports required by users or upstream proxies.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Use encrypted overlay networks deliberately

Swarm overlay traffic is not automatically the same as an encrypted overlay. If you create an encrypted overlay with --opt encrypted, nodes also need IP protocol 50 (IPSec ESP) permitted between them. A firewall that allows only UDP 4789 can therefore pass ordinary overlay traffic while breaking an encrypted network.

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.

Enable encryption only after confirming that your VPS provider and network firewall pass ESP. Test service-to-service communication on the encrypted network and monitor for dropped packets before moving production workloads. The protocol requirement applies to encrypted overlay networks, not to every Swarm installation.

Firewall and security practices for VPS swarms

  • Keep 2377 private. The manager control plane should be reachable only from trusted swarm nodes and tightly controlled administration paths.
  • Scope discovery and overlay traffic. Restrict 7946/TCP, 7946/UDP, and 4789/UDP to the node addresses rather than opening them globally.
  • Separate control and application exposure. A publicly published web port does not require public access to 2377, 7946, or 4789.
  • Protect tokens. Never paste manager tokens into tickets, public logs, shell history shared with other users, or source repositories.
  • Use least privilege. Give routine operators the access they need to deploy services without distributing manager join credentials.
  • Plan certificate and token response. If a token or node credential is exposed, rotate the affected join token and investigate the node and account that handled it.
  • Document the network. Record which interface is advertised, which addresses are trusted, and which provider firewall rules permit node traffic.

Troubleshooting common failures

docker swarm join times out

Confirm that the manager address resolves to the interface selected with --advertise-addr. From the worker, test TCP connectivity to the manager on port 2377. Then check provider and host firewalls for 2377/TCP, 7946/TCP, 7946/UDP, and 4789/UDP. A port that is open on the manager’s local firewall can still be blocked by a cloud security group.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The node joins but remains unreachable

Look for asymmetric routing, a private address that is not shared by all VPS instances, or a firewall that permits the initial TCP connection but blocks UDP discovery or VXLAN traffic. If the manager has multiple interfaces, verify that the advertised address is reachable in both directions.

Services cannot communicate across nodes

Check 7946/TCP and UDP for discovery and 4789/UDP for overlay traffic between every node carrying tasks. If the network was created with encryption, also check IP protocol 50. Inspect task placement with docker service ps <SERVICE_NAME> and review daemon logs on the nodes that host failed tasks.

A published port is inaccessible

Verify that the service has a running replica and that the published application port, not a Swarm control port, is allowed from the client network. The routing mesh can accept traffic on a node without a local task, but it still depends on healthy node-to-node overlay and routing traffic.

A token no longer works

The token may have been rotated, copied incompletely, or used with the wrong role. On a manager, generate the current worker or manager command with docker swarm join-token worker or docker swarm join-token manager, then run the matching command on the joining VPS.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Operational checklist

  1. Install and verify Docker Engine on every VPS.
  2. Choose a reachable manager address and document the interface.
  3. Restrict 2377/TCP, 7946/TCP and UDP, and 4789/UDP to swarm node addresses; add protocol 50 only for encrypted overlays.
  4. Run docker swarm init --advertise-addr <MANAGER_IP> on the first manager.
  5. Store the generated worker and manager commands securely.
  6. Join workers with the worker token and any additional managers with the manager token.
  7. Run docker node ls on a manager and resolve every node that is not Ready.
  8. Deploy a non-production test service before exposing application traffic.
  9. Rotate join tokens after suspected disclosure and review firewall rules whenever the node inventory changes.

Version and documentation caveat

Docker’s official pages used for the port and command references can change, and the visible revision dates for those pages were not available here. Confirm the current Swarm reference, distribution-specific Docker installation instructions, and provider firewall behavior immediately before a production rollout. In particular, verify the port list for the Docker Engine release you install and do not substitute an older Swarm Classic guide.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.