{"id":19214,"date":"2025-04-06T09:17:19","date_gmt":"2025-04-06T07:17:19","guid":{"rendered":"https:\/\/tremhost.com\/blog\/?p=19214"},"modified":"2025-04-06T09:17:19","modified_gmt":"2025-04-06T07:17:19","slug":"how-to-set-up-jenkins-ci-server-on-a-vps","status":"publish","type":"post","link":"https:\/\/tremhost.com\/blog\/how-to-set-up-jenkins-ci-server-on-a-vps\/","title":{"rendered":"How to set up Jenkins CI server on a VPS"},"content":{"rendered":"<p>Jenkins is one of the most popular open-source automation servers that provides hundreds of plugins to support building, deploying, and automating any project. This article guides you through the process of setting up a Jenkins Continuous Integration (CI) server on a Virtual Private Server (VPS). We\u2019ll start with the installation and then move on to configuring Jenkins for optimal use. Whether you are a software developer, a project manager, or just someone looking to streamline your development process, setting up Jenkins on a VPS can enhance your ability to manage and automate software deployments efficiently.<\/p>\n<h2>Step-by-Step Guide to Installing Jenkins CI<\/h2>\n<ol>\n<li>\n<p><strong>Prepare Your VPS<\/strong>: Before installing Jenkins, ensure that your VPS is running either Ubuntu, Debian, CentOS, or any other popular Linux distribution. Update your system using the package manager, for example, on Ubuntu, you would use <code>sudo apt update && sudo apt upgrade<\/code>. It\u2019s also a good idea to install Java, as Jenkins is a Java-based application. Use <code>sudo apt install openjdk-11-jdk<\/code> for Ubuntu or the appropriate package manager command for your distribution.<\/p>\n<\/li>\n<li>\n<p><strong>Install Jenkins<\/strong>: You can install Jenkins by adding the repository key to your system, adding the repository to your system\u2019s software sources, and then installing Jenkins. For Debian-based distributions like Ubuntu, use these commands:<\/p>\n<pre><code>wget -q -O - https:\/\/pkg.jenkins.io\/debian-stable\/jenkins.io.key | sudo apt-key add -\nsudo sh -c 'echo deb https:\/\/pkg.jenkins.io\/debian-stable binary\/ > \/etc\/apt\/sources.list.d\/jenkins.list'\nsudo apt update\nsudo apt install jenkins<\/code><\/pre>\n<p>For Red Hat-based distributions, use the equivalent <code>yum<\/code> or <code>dnf<\/code> commands.<\/p>\n<\/li>\n<li>\n<p><strong>Start and Verify Jenkins<\/strong>: Once Jenkins is installed, start the Jenkins service using <code>sudo systemctl start jenkins<\/code>. Enable it to start at boot with <code>sudo systemctl enable jenkins<\/code>. You can verify that Jenkins is running by accessing it at <code>http:\/\/your-vps-ip:8080<\/code>. Initially, you\u2019ll need to unlock Jenkins using the administrator password found with <code>sudo cat \/var\/lib\/jenkins\/secrets\/initialAdminPassword<\/code>.<\/p>\n<\/li>\n<\/ol>\n<h2>Configuring Jenkins on Your VPS for Optimal Use<\/h2>\n<ol>\n<li>\n<p><strong>Secure Your Jenkins Dashboard<\/strong>: After initial access, it\u2019s crucial to configure security settings. Navigate to &quot;Manage Jenkins&quot; > &quot;Configure Global Security&quot;, and enable security. Configure Jenkins to use Jenkins\u2019 own user database and set the authorization to &quot;Logged-in users can do anything&quot;. This step helps ensure that only authorized users can make changes.<\/p>\n<\/li>\n<li>\n<p><strong>Install Necessary Plugins<\/strong>: Jenkins has a vast ecosystem of plugins. Depending on your project requirements, you might need various plugins such as Git, Maven, Docker, or Slack for notifications. You can install these plugins through &quot;Manage Jenkins&quot; > &quot;Manage Plugins&quot;. Ensure to also regularly update existing plugins to secure and enhance your CI environment.<\/p>\n<\/li>\n<li>\n<p><strong>Optimize Performance and Create Jobs<\/strong>: To optimize Jenkins for better performance, consider configuring your build jobs to run on slave nodes or distributed systems, which can help in managing load and speeding up builds. You can also set up regular backups of your Jenkins configuration and jobs. Creating jobs in Jenkins is straightforward; go to the Jenkins dashboard and select &quot;New Item&quot;, name your project, and choose the type of project from freestyle, pipeline, and others.<\/p>\n<\/li>\n<\/ol>\n<p>Setting up Jenkins on a VPS can dramatically improve your development operations by automating builds, tests, and deployments. By following the steps outlined for installation and configuration, you can get your Jenkins CI server up and running efficiently on your VPS. Remember to keep security in mind and regularly update both Jenkins and its plugins to safeguard your automation environment. With Jenkins configured, you are now well-equipped to streamline and manage your development workflows effectively.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Guide to Installing Jenkins CI on a VPS<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1],"tags":[],"class_list":{"0":"post-19214","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-general"},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/posts\/19214","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/comments?post=19214"}],"version-history":[{"count":1,"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/posts\/19214\/revisions"}],"predecessor-version":[{"id":19236,"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/posts\/19214\/revisions\/19236"}],"wp:attachment":[{"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/media?parent=19214"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/categories?post=19214"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/tags?post=19214"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}