On Debian-based distributions, such as Ubuntu, you can install Jenkins through
You need to have a JDK and JRE installed. openjdk-7-jre and openjdk-7-jdk are suggested. As of 2011-08 gcj is known to be problematic - see https://issues.jenkins-ci.org/browse/JENKINS-743.
Please make sure to back up any current Hudson or Jenkins files you may have.
Once installed like this, you can update to the later version of Jenkins (when it comes out) by running the following commands:
(aptitude or apt-get doesn't make any difference.)
What does this package do?
- Jenkins will be launched as a daemon up on start. See
/etc/init.d/jenkinsfor more details.
- The '
jenkins' user is created to run this service.
- Log file will be placed in
/var/log/jenkins/jenkins.log. Check this file if you are troubleshooting Jenkins.
/etc/default/jenkinswill capture configuration parameters for the launch like e.g JENKINS_HOME
- By default, Jenkins listen on port 8080. Access this port with your browser to start configuration.
If your /etc/init.d/jenkins file fails to start jenkins, on line 108 you may change su -l <username> -c <command> with sudo -u <username> <command>. This fixed init.d script for me (icarito, July 2013).
Deploying on Ubuntu in a cloud (EC2, HP Cloud, OpenStack)
The Ubuntu Jenkins maintainer also maintains the Juju charm deployment/management script for deployment in clouds. It's designed to make it easy to deploy a master with multiple slaves:
The default password for the 'admin' account will be auto-generated. You can set it using:
Always change it this way - this account is used by the charm to manage slave configuration. Then feel free to expose your jenkins master:
Setting up an Apache Proxy for port 80 -> 8080
- This configuration will setup Apache2 to proxy port 80 to 8080 so that you can keep Jenkins on 8080.
sudo aptitude install apache2
sudo a2enmod proxy
sudo a2enmod proxy_http
do not do this next command if you already have virtual hosting setup that depends on the default site. See my comment below - danapsimer
sudo a2dissite default
- Create a file called
sudo a2ensite jenkins
sudo apache2ctl restart
Setting up an Nginx Proxy for port 80 -> 8080
- Install Nginx.
- Remove default configuration.
- Create new configuration for Jenkins. This example uses
cat, but you can use your favorite text editor. Make sure to replace 'ci.yourcompany.com' with your domain name.
Note: Sometimes your permissions (umask, etc) might be setup such that this won't work. Create the file somewhere else then copy it into place if you run into that problem.
- Link your configuration from
- Restart Nginx