How To Install Jenkins And Set Up Jenkins CI For Rails Projects

Travis CI is a great solution for OpenSource project. However, what if you want to setup an internal CI server for private projects? Jenkins CI is the choice.

In this post, I’ll guide you through installing and configuring Jenkins CI on a VPS (EC2 instance in this post)

OS Assumption

Assume that you are running an EC2 instance with a Ubuntu system as below:

If you don’t yet have a VPS set up, there is an Amazon free tier that is recommended.

Install Rails Environment

Because you’ll be using this Jenkins CI server for Rails projects, install the following Ruby/Rails libs and tools:

– Install RVM and Ruby

We need to have git core and curl for RVM installation, so install them like so:

And install RVM with ruby as user jenkins:

– Install Possible Databases


If you had a problem with UTF-8 take a look at


Now Install Jenkins


Uninstalling Jenkins is easy too, just:

FYI – There is also a detailed guide for installing Jenkins on Ubuntu.

Run Jenkins on Port 80

By default, Jenkins runs on port 8080, so you’ll need to reverse proxy port 80 to port 8080 for Jenkins. This will make the CI server public to the world.

To install nginx and set this up, open up a terminal and type in:

Open up the config file in vim, and update it.

Notice: Jenkins shows build histories and other information. Tto keep the whole CI server private, you’d better use this guide to add basic auth for your Jenkins CI. It is strongly recommended.

Install valuable plugins for Jenkins

After all of the above installations are done, you are able to visit your Jenkins CI server using your domain. Now it’s time to install the following plugins from the JenkinsPlugin > Manager section:

For more plugins, check out the Jenkins Plugins Document.

References & Resources

Ready to build an industry-changing product?

Let’s talk about your project today >>