Install Jenkins on Raspberry Pi (Raspbian)

NOTE: Instructions can also be obtained here 
  1. Open a terminal window
  2. Run wget -q -O – | sudo apt-key add –
  3. Run sudo nano /etc/apt/sources.list
  4. Append to the file deb binary/
  5. Run sudo apt-get update
  6. Run sudo apt-get install jenkins
  • Jenkins will run up on start as a daemon via the script /etc/init.d/jenkins
  • The log file will be placed in /var/log/jenkins/jenkins.log
  • To change the default port of 8080 to something else can be done in /etc/default/jenkins
NOTE: Jenkins home directory can be found in Jenkins under 
Manage Jenkins > System Information > user.home property value 

Add Nexus user to Gradle profile

To upload to Nexus from Jenkins using Gradle then add the credentials like so:

  • Go to the .gradle folder in Jenkins home directory (e.g. /var/lib/jenkins/.gradle).
  • Create a file called (e.g. sudo vi
  • Add
  • Change the owner and group of the file if necessary (e.g. to change from root to jenkins user)
  • In build.gradle one can now use the following authentication
authentication(userName: mavenUser, password: mavenPassword)

Remote ssh to application server

NOTE: If the .ssh folder does not exist on the application server 
then create it first using the below commands before beginning:
 - mkdir ~/.ssh
 - chmod 700 ~/.ssh
  1. On Jenkins server
    • cd ~ (As the Jenkins user e.g. sudo su jenkins)
    • ssh-keygen -t rsa to create public/private keys (select the defaults without entering passphrase by pressing Enter)
    • cd ./ssh
    • ssh-add id_rsa to add the identity to the local ssh authorizer
      • If message “Could not open a connection to your authentication agent.” appears, start “ssh-agent” using eval `ssh-agent`
    • scp to copy the public key to the remote host (e.g. scp pi@
  2. On Application server (e.g.
    • cd ~/.ssh
    • cat >> authorized_keys to add the public key to “authorized_keys”
    • chmod 600 authorized_keys

To test that it works on the Jenkins server run the command (should return a result without prompting for a password):

ssh remoteuser@remotehost uname -a (e.g. ssh pi@ uname -a)

The above used the following link for information