Mastering Automation: How to Set Up Jenkins on DigitalOcean for Effortless DevOps Bliss
Automating tasks such as building, testing, and deploying software is essential for streamlining development processes. Jenkins, an open-source automation server, is a powerful tool for achieving this goal. Pairing Jenkins with DigitalOcean, a cloud hosting platform offering simplicity and cost-effectiveness, provides a robust environment for managing applications in the cloud. In this guide, we'll walk through setting up Jenkins on DigitalOcean.
Step 1: Create a Droplet on DigitalOcean
\=> Log in to your DigitalOcean account and navigate to the "Create" button, then select "Droplets."
\=> Choose a Region: Select the region closest to your target audience or based on your specific requirements.
\=> Choose an Image: Opt for an operating system image suitable for your project needs, typically Ubuntu or another Linux distribution.
\=> Choose Size: Select a Droplet size based on your project's resource requirements.
\=> Choose Authentication Method: It's recommended to use SSH keys for secure access to your Droplet. However, you can also opt for a password if preferred.
i) Password
ii) SSH key (We are Using)
\=> Click on the "Create Droplet" button to initiate the Droplet creation process.
\=> Renaming Your Droplet:
After creation, you can customize your Droplet by renaming it through the DigitalOcean dashboard.
\=> Creating a Firewall:
Configure inbound and outbound rules for your Droplet by accessing the Networking section and creating a firewall.
Inbound Rules :
Outbound Rules :
Firewall Created :
Step 2: Install Docker on your Droplet
\=> SSH to Your Droplet:
Access your Droplet via SSH by copying its IPv4 address and using your preferred terminal emulator.
\=> Update Package Index:
Keep your package index up to date by executing the command:
sudo apt update
\=> Install Docker:
Install Docker on your Droplet with the command:
sudo apt install docker.io
Step 3: Install Jenkins on the Docker container
\=> Run Jenkins Docker Container:
Launch a Docker container running Jenkins with the following command:
docker run -p 8080:8080 -p 50000:50000 -d -v
jenkins_home:/var/jenkins_home jenkins/jenkins:lts
docker ps
\=> Access Jenkins:
Open a web browser and enter your Droplet's IP address followed by the Jenkins port to access the Jenkins dashboard.
\=> Unlock Jenkins:
Retrieve the initial unlock password from the Jenkins container's logs and proceed with the setup.
\=> Install Plugins:
Install the suggested plugins to extend Jenkins' functionality according to your requirements.
\=> Create Admin User:
Create the first administrative user to manage Jenkins and its configurations effectively.
Congratulations! ๐ You've successfully set up Jenkins on DigitalOcean, creating a robust environment for automating your software development processes.
Happy automating