Installing Jenkins on Ubuntu Server 15.10 (Get started with Jenkins part 2)
Articles,  Blog

Installing Jenkins on Ubuntu Server 15.10 (Get started with Jenkins part 2)


Hi everyone and welcome back to the “Get
started with Jenkins” series. In this video I’m going to show you can install Jenkins. Just a quick note before I continue: the instructions
in this video will only work for Linux distributions that are based on Debian.
Jenkins can run on practically all Linux distributions but for this video I will use Ubuntu Server
15.10. If you prefer to use another Linux distribution
you can skip this video and checkout the official Jenkins documentation and read the instructions
for your distribution. Okay, so with that out of the way, let’s
get going! I’ll start by showing you how to install
the open source version of the Java JRE and JDK. I’m not going to use the Oracle installation
because the Jenkins documentation specifically recommends OpenJDK. Afterwards we’re going to add the Jenkins
apt-get repository to our system and then install Jenkins itself. So let’s get going! So here I am logged into my Ubuntu Server
installation and the first thing that I’m going to do is I’m going to install the JDK
and the JRE: the Java Development Kit and the Java Runtime Environment. So to do this
I’m going to run “sudo apt-get install openjdk-7-jre”. And I’m going to say “Yes” to downloading
all these dependencies. And now this is going to take some time so I’m going to speed up
this video and get back to you when it’s finished. Okay so that’s probably the fastest install
of the JRE that you’ve ever seen! And now we’re going to continue by installing the
development kit for Java. So I’m going to run “sudo apt-get install openjdk-7-jdk”.
And
again I’m going to say “Yes” to downloading and installing these dependencies and I’ll
speed up this video once more. Okay so now that Java is installed we can
check out if it’s installed correctly. I can run “java -version” to see the current version,
which is 1.7 or Java 7. So Java is installed correctly. Now the next thing that we’re going
to do is we’re going to add the security key for the Jenkins apt-get repository to our
system. And I’m going to take a little cheat sheet here with some commands. I’m just going
to copy the first command which downloads the key and adds it to our system. So this
is wget, which downloads this URL, saves it to our disks and then gives that key (it pipes
it) to the apt-key command. So I’m going to run this command and give it my password.
And there we go! The key has been added to our system. Now the next step is to add the URL of the
Jenkins repository to our sources list. And that’s what the second command does. So I’m
going to copy this here as well. This echo’s this text into the “jenkins.list” file. So
if I hit enter, boom, that’s done! And now all that’s left is running “sudo apt-get
update” to update our list of packages. And finally we can install Jenkins by running
“apt-get install jenkins”. Again it asks me to download all these dependencies and I’m
going to say yes. And once more I’ll be fast forwarding this video for you. And there we go. Jenkins is now installed
and we can actually verify that it’s running because when you install Jenkins it automatically
starts up the service. So if I go to Safari and I navigate to the IP address of my server
and I add port 8080 to it and hit enter. Sure enough there is my Jenkins instance, already
up and running! That’s it! Jenkins is up and running on
our server and we can continue with the series. In the next video I’ll show you how you
can import source code from git repositories straight into Jenkins. Thanks for watching and be sure to subscribe
to my channel or follow me on Twitter if you liked this video.

7 Comments

  • Eddie L

    It's very specific for people not running their webserver on port 8080. I just want to let people know there are instructions here: https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Ubuntu In case you're running Apache Tomcat7 on port:8080 (like I am)

    But otherwise, very helpful, thank you!

  • Stiofán Davies

    Adding Jenkins in a LinuxVM and then opening the port in Safari wont work unless you crate vm Settings to allow the service to be exposed on the host. This doesn't just work on mac as you suggest. I recommend you cover how to expose the Jenkins port to the Host OS

Leave a Reply

Your email address will not be published. Required fields are marked *