{"id":2205,"date":"2024-12-18T03:04:53","date_gmt":"2023-10-19T14:35:43","guid":{"rendered":""},"modified":"2025-02-02T00:46:18","modified_gmt":"2025-02-01T23:46:18","slug":"how-to-setup-jenkins-master-and-slave-on-ubuntu","status":"publish","type":"post","link":"https:\/\/netcloud24.com\/knowledgebase\/how-to-setup-jenkins-master-and-slave-on-ubuntu\/","title":{"rendered":"How to Setup Jenkins Master and Slave on Ubuntu"},"content":{"rendered":"<p>\u00a0<\/p>\n<\/p>\n<header>\n<h1>\u00a0<\/h1>\n<\/header>\n<article>\n<p>Jenkins is an open-source automation tool that helps with continuous integration and continuous delivery (CI\/CD) of software. It can be used in a master-slave configuration to distribute workloads across multiple machines. In this article, we&#8217;ll walk through the steps to set up a Jenkins master and slave on Ubuntu. Additionally, we&#8217;ll show you how to mirror your setup using <strong>rsync<\/strong> to ensure consistency across servers. If you&#8217;re looking for hosting solutions, consider using  for your Jenkins setup.<\/p>\n<section>\n<h2>Step 1: Install Jenkins on the Master Server<\/h2>\n<p>Start by updating your Ubuntu system and installing Jenkins on the master server. Run the following commands to do so:<\/p>\n<pre><code>sudo apt update &amp;&amp; sudo apt upgrade<\/code><\/pre>\n<p>Next, install Jenkins using the official repository:<\/p>\n<pre><code>\r\nsudo apt install openjdk-11-jdk\r\nwget -q -O - https:\/\/pkg.jenkins.io\/debian\/jenkins.io.key | sudo apt-key add -\r\nsudo sh -c 'echo deb http:\/\/pkg.jenkins.io\/debian-stable binary\/ &gt; \/etc\/apt\/sources.list.d\/jenkins.list'\r\nsudo apt update\r\nsudo apt install jenkins\r\n            <\/code><\/pre>\n<p>Once Jenkins is installed, start the Jenkins service:<\/p>\n<pre><code>sudo systemctl start jenkins<\/code><\/pre>\n<p>This process is applicable whether you&#8217;re running Jenkins on a local server or a <a href=\"https:\/\/ie.netcloud24.com\">Windows VPSVirtual Private Server hosting<\/a> platform.<\/p>\n<\/section>\n<section>\n<h2>Step 2: Configure Jenkins Master<\/h2>\n<p>After installation, access Jenkins through your browser at <code>http:\/\/your-server-ip:8080<\/code>. Unlock Jenkins using the password found in the following file:<\/p>\n<pre><code>sudo cat \/var\/lib\/jenkins\/secrets\/initialAdminPassword<\/code><\/pre>\n<p>Complete the setup by installing the recommended plugins and creating an admin user. Once done, your Jenkins master will be ready. Setting up Jenkins on a virtual private server, such as a <a href=\"https:\/\/ie.netcloud24.com\">UK VPS Windows<\/a>, can offer additional flexibility and performance.<\/p>\n<\/section>\n<section>\n<h2>Step 3: Install Jenkins Slave<\/h2>\n<p>To set up the Jenkins slave, you need to install Java on the slave machine, which could be another Ubuntu server or a <a href=\"https:\/\/ie.netcloud24.com\">VPS Windows VPS Servers<\/a>. Run the following command to install Java:<\/p>\n<pre><code>sudo apt install openjdk-11-jdk<\/code><\/pre>\n<p>After installing Java, navigate to the Jenkins master dashboard, go to <strong>Manage Jenkins &gt; Manage Nodes and Clouds &gt; New Node<\/strong>, and add the slave machine details. Make sure to configure the slave with the appropriate labels and settings based on your use case.<\/p>\n<\/section>\n<section>\n<h2>Step 4: Connect Jenkins Slave to Master<\/h2>\n<p>Once the slave is configured, connect it to the master server. On the slave machine, you can use the <strong>Launch agent via SSH<\/strong> option from the Jenkins dashboard. This requires the slave to be accessible via SSH<\/p>\n<\/section>\n<\/article>\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 Jenkins is an open-source automation tool that helps with continuous integration and continuous delivery (CI\/CD) of software. It can be used in a master-slave configuration to\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-2205","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\/2205","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=2205"}],"version-history":[{"count":0,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/2205\/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=2205"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=2205"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=2205"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}