DEV Community

Cover image for Install Jenkins in Ubuntu 18.04
Z. QIU
Z. QIU

Posted on • Edited on

1

Install Jenkins in Ubuntu 18.04

Info: This post is one of the article in context of this post: Huawei Cloud ECS server notes

Install firstly Java:

sudo apt update
sudo apt install openjdk-8-jdk
Enter fullscreen mode Exit fullscreen mode

Add official Jenkins source key into Ubuntu source:

wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -

sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
Enter fullscreen mode Exit fullscreen mode

Update apt source and install Jenkins:

sudo apt update
sudo apt install jenkins
Enter fullscreen mode Exit fullscreen mode

Service Jenkins shall automatically start once the installation finishes. One can check its status using:

systemctl status jenkins
Enter fullscreen mode Exit fullscreen mode

or

serviec jenkins status
Enter fullscreen mode Exit fullscreen mode

Alt Text

We can use systemctl cmd to stop/start/restart jenkins service.

Default port of Jenkins is 8080, thus one can visit Jenkins in browser via address: http://localhost:8080/. In order to change default port of Jenkins, one should modify file /etc/default/jenkins:

vim /etc/default/jenkins
Enter fullscreen mode Exit fullscreen mode

Change HTTP_PORT to his/her expected port id:

# port for HTTP connector (default 8080; disable with -1)
HTTP_PORT=8080
Enter fullscreen mode Exit fullscreen mode

Jenkins requires the default password when user logs in for ths first time. The initial Password can be viewed using:

sudo cat /var/lib/jenkins/secrets/initialAdminPassword
Enter fullscreen mode Exit fullscreen mode

Image of Datadog

The Future of AI, LLMs, and Observability on Google Cloud

Datadog sat down with Google’s Director of AI to discuss the current and future states of AI, ML, and LLMs on Google Cloud. Discover 7 key insights for technical leaders, covering everything from upskilling teams to observability best practices

Learn More

Top comments (0)

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay