How to setup Jenkins in Linux

What is Jenkins?

Jenkins is an open source automation server written in Java. Jenkins helps to automate the non-human part of the software development process, with continuous integration and facilitating technical aspects of continuous delivery. (Wikipedia)

1. Required packages

sudo apt-get update
wget -q -O - | sudo apt-key add -
sudo sh -c 'echo deb binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install jenkins

2. Start jenkins service

service jenkins start

3. Command to fix permission

setfacl -m user:jenkins:rwx ~/
setfacl -m user:jenkins:rwx /home/username