Your first production-ready Jenkins

You heard about Jenkins and you want to try it. Good news: it’s so simple to do it in a production environment. So, skip trying it at your localhost and then installing it again in your production environment. The steps are these:

1. Get a production server. We use to get it at To build Android apps you’ll need 2GB of memory. About the number of cores: it will work with only one core, but if you can afford a machine with more cores, gradle will use them. Fewlaps’ Jenkins has two cores and it performs great.

2. Install Java 8. You can also use Java 7 but… well. At some time, someone, will write a lambda, and you will need to update to Java 8 :·)

su root
echo "deb trusty main" > /etc/apt/sources.list.d/webupd8team-java.list
echo "deb-src trusty main" >> /etc/apt/sources.list.d/webupd8team-java.list
apt-key adv --keyserver --recv-keys EEA14886
apt-get update
apt-get install oracle-java8-installer
java -version

3. Install Jenkins

4. http://yourserver:8080 it works! (note that it’s not too fast starting the daemon)

5. Install git, mercurial… All the things that Jenkins will need to pull your projects from your repos. You know:

apt-get install git
apt-get install mercurial

… and so on


Important: before creating any Job, check your security configuration. Create an user for you, another one for every colleague, and grant them the needed permissions. Also check that “anonymous” doesn’t have any permission, and that the “users can register to the environment” box is not checked.

There’s an issue builiding Android things, related to the AAPT. Fix it with this solution:

Wep! More info! Your Android SDK will be downloaded at /var/lib/jenkins/tools/android-sdk/

Wep! More info! If you have issues starting an emulator, apt-get install libglu1-mesa