{"id":2547,"date":"2023-02-01T17:32:51","date_gmt":"2025-07-20T22:04:25","guid":{"rendered":""},"modified":"2025-02-02T00:46:18","modified_gmt":"2025-02-01T23:46:18","slug":"how-to-install-and-configure-a-docker-swarm-cluster-on-centos-8","status":"publish","type":"post","link":"https:\/\/netcloud24.com\/knowledgebase\/how-to-install-and-configure-a-docker-swarm-cluster-on-centos-8\/","title":{"rendered":"Linux VPS &#038; VPS Windows Setup Guide | NetCloud24 and Configure a Docker Swarm Cluster on CentOS 8"},"content":{"rendered":"<p>\u00a0<\/p>\n<\/p>\n<header>\n<h1>\u00a0<\/h1>\n<\/header>\n<article>\n<p>Docker Swarm is a native clustering and orchestration tool for Docker containers. It allows you to manage a cluster of Docker hosts as a single virtual system. In this guide, we will walk through the process of installing and configuring a Docker Swarm Cluster on CentOS 8. Whether you&#8217;re using CentOS or a , Docker Swarm is a great solution for managing containerized applications at scale.<\/p>\n<h2>Prerequisites<\/h2>\n<p>Before you begin, make sure you have:<\/p>\n<ul>\n<li>A CentOS 8 server with root access.<\/li>\n<li>Docker installed on each node in the swarm (manager and worker nodes).<\/li>\n<li>At least two nodes (one manager and one worker) for setting up the cluster.<\/li>\n<\/ul>\n<p>If you&#8217;re using , ensure Docker is installed and properly configured on your Windows-based server as well.<\/p>\n<h2>Step 1: Install Docker on CentOS 8<\/h2>\n<p>Docker must be installed on each node participating in the swarm. To install Docker on CentOS 8, use the following commands:<\/p>\n<pre><code>sudo dnf install -y yum-utils\r\nsudo yum-config-manager --add-repo https:\/\/download.docker.com\/linux\/centos\/docker-ce.repo\r\nsudo dnf install docker-ce docker-ce-cli containerd.io -y\r\nsudo systemctl start docker\r\nsudo systemctl enable docker<\/code><\/pre>\n<h2>Step 2: Initialize the Docker Swarm Manager<\/h2>\n<p>After Docker is installed, the next step is to initialize the Docker Swarm cluster on the manager node. On your chosen manager node, run the following command to initialize Docker Swarm:<\/p>\n<pre><code>sudo docker swarm init --advertise-addr your_manager_node_ip<\/code><\/pre>\n<p>This command will output a join token, which will be used by the worker nodes to join the swarm cluster.<\/p>\n<h2>Step 3: Add Worker Nodes to the Swarm<\/h2>\n<p>On each worker node, run the following command to join the swarm, replacing the token and IP address with the one provided by the <code>docker swarm init<\/code> command:<\/p>\n<pre><code>sudo docker swarm join --token SWMTKN-1-xyz your_manager_node_ip:2377<\/code><\/pre>\n<p>After executing this command, the worker nodes will be added to the swarm cluster managed by the manager node.<\/p>\n<h2>Step 4: Verify the Docker Swarm Cluster<\/h2>\n<p>To verify that your Docker Swarm cluster is functioning correctly, run the following command on the manager node:<\/p>\n<pre><code>sudo docker node ls<\/code><\/pre>\n<p>This will display a list of nodes in your swarm, with the manager marked as <code>Leader<\/code> and the worker nodes listed accordingly.<\/p>\n<h2>Step 5: Deploy Services to the Swarm<\/h2>\n<p>Now that the swarm cluster is set up, you can deploy services across the nodes. For example, to deploy a simple web server service, run the following command:<\/p>\n<pre><code>sudo docker service create --name my_web --replicas 3 -p 80:80 nginx<\/code><\/pre>\n<p>This command deploys an Nginx service with 3 replicas, accessible via port 80 on your cluster.<\/p>\n<h2>Benefits of Hosting Docker Swarm on a VPS<\/h2>\n<p>Hosting a Docker Swarm cluster on a  or <a href=\"https:\/\/ie.netcloud24.com\">Windows VPSVirtual Private Server Hosting<\/a> provides dedicated resources, allowing you to scale your applications more efficiently. Whether you&#8217;re running your cluster on a <a href=\"https:\/\/ie.netcloud24.com\">UK Windows VPS<\/a> or a <a href=\"https:\/\/ie.netcloud24.com\">Microsoft SQL VPS Windows<\/a>, you&#8217;ll benefit from better performance, scalability, and control over your infrastructure.<\/p>\n<p>Using a <a href=\"https:\/\/ie.netcloud24.com\">Windows VPSServer VPS<\/a> ensures that your Docker Swarm cluster runs smoothly with isolated resources, improving the reliability and uptime of your containerized applications.<\/p>\n<h2>Conclusion<\/h2>\n<p>Setting up a Docker Swarm Cluster on CentOS 8 allows you to manage and scale containerized applications across multiple nodes efficiently. Whether you&#8217;re using CentOS or a <a href=\"https:\/\/ie.netcloud24.com\">Windows VPS Hosting UK<\/a> solution, Docker Swarm provides a powerful tool for orchestration. Consider using <a href=\"https:\/\/ie.netcloud24.com\">Windows VPS<\/a> for optimal performance and scalability when managing Docker Swarm clusters.<\/p>\n<\/article>\n<footer>\n<p>\u00a9 2024 VPS Hosting Solutions<\/p>\n<\/footer>\n<div class=\"post-author-box\" style=\"border-top:1px solid #ddd;margin-top:20px;padding-top:15px;\">\n<p><strong>Author:<\/strong> \u0141ukasz Bodziony<\/p>\n<p><strong>Website:<\/strong> <a href=\"https:\/\/ca.netcloud24.com\" target=\"_blank\" rel=\"dofollow\">Windows VPS<\/a><\/p>\n<p><em>\u0141ukasz Bodziony is the CEO and founder of <a href=\"https:\/\/netcloud24.com\" target=\"_blank\" rel=\"dofollow\">NETCLOUD24<\/a>, a global VPS hosting brand proudly originating from Poland. With extensive experience in cloud computing, virtualization, and server management, he delivers high-performance <strong>Windows VPS<\/strong> and <strong>Remote Desktop Services (RDS)<\/strong> solutions to clients across Europe, North America, and beyond.<\/em><\/p>\n<p><em>His expertise covers a wide range of technologies, including <strong>Microsoft Azure<\/strong>, <strong>Proxmox VE<\/strong>, <strong>Amazon Web Services (AWS)<\/strong>, and numerous other virtualization and cloud platforms.<\/em><\/p>\n<p><em>Beyond running his hosting business, \u0141ukasz also provides <strong>professional paid server configuration and optimization services<\/strong> for companies and individuals. Outside of work, he is dedicated to caring for his children and building a secure future for them.<\/em><\/p>\n<p><em>If you are interested in working with him or need expert assistance with your hosting, cloud environment, or server setup, feel free to reach out via <a href=\"https:\/\/ca.netcloud24.com\" target=\"_blank\" rel=\"dofollow\">Windows VPS<\/a>.<\/em><\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0 \u00a0 Docker Swarm is a native clustering and orchestration tool for Docker containers. It allows you to manage a cluster of Docker hosts as a single virtual\u2026<\/p>\n","protected":false},"author":1,"featured_media":3421,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[],"tags":[14,12,11,23,20,21,22,17,7,8,6,10,18,19,15,24,16,5,13,9],"class_list":["post-2547","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","tag-cheapvps","tag-cloudvps","tag-hostingvps","tag-rds","tag-rdscal","tag-remotedesktop","tag-remotedesktopvps","tag-servervps","tag-ukvps","tag-virtualserver","tag-vpshosting","tag-vpsserver","tag-vpssolutions","tag-vpswindows","tag-vpswithwindows","tag-windowsrds","tag-windowsserver","tag-windowsvps","tag-windowsvpshosting","tag-windowsvpsuk"],"jetpack_publicize_connections":[],"_links":{"self":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/2547","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=2547"}],"version-history":[{"count":0,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/2547\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/media\/3421"}],"wp:attachment":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=2547"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=2547"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=2547"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}