There are two ways to deploy Jenkins server into Ubuntu host.
1. Using Docker image.
2. Start on localhost using war file.
Let’s see details to install a Jenkins server below:
I. Using Docker image.
Docker’s fundamental platform and container design means that a single Docker image (for any given application like Jenkins) can be run on any supported operating system (macOS, Linux and Windows) or cloud service (AWS and Azure) which is also running Docker.
1. Downloading Docker Image
There are several Docker images of Jenkins available.
The recommended Docker image to use is the jenkinsci/blueocean image (from the Docker Hub repository). This image contains the current Long-Term Support (LTS) release of Jenkins (which is production-ready) bundled with all Blue Ocean plugins and features. This means that you do not need to install the Blue Ocean plugins separately.
docker pull jenkinsci/blueocean
2. Run the Docker image as a container
sudo docker run \ -u root \ --rm \ -d \ -p 8080:8080 \ -p 50000:50000 \ -v jenkins-data:/var/jenkins_home \ -v /var/run/docker.sock:/var/run/docker.sock \ jenkinsci/blueocean
3. Proceed to the Post-installation setup wizard
– access to container bash to get automatically-generated password.
docker exec -it bash
II. Install Jenkins using .war file
- Install Java Version 8 – Jenkins is a Java based application, hence Java is a must.
- Install Apache Tomcat Version 9 – Tomcat is required to deploy Jenkins war file.
- Download Jenkins war File – This war is required to install Jenkins.
- Deploy Jenkins war File – Jenkins war file needs to be deployed using Tomcat to run Jenkins.
- Unlock Jenkins with auto-generated password and Install Suggested Plugins
For the details , you can refer to this good blog post: https://www.edureka.co/blog/install-jenkins/
Reference Sources:
https://jenkins.io/doc/book/installing/
https://hub.docker.com/r/jenkinsci/blueocean/
https://www.edureka.co/blog/install-jenkins/