spacer Installing Jenkins on Ubuntu

{0}."> {0}-{1} of {2} pages containing {3}.">
Skip to end of metadata
  • Page restrictions apply
  • Added by Kohsuke Kawaguchi, last edited by Jorge Castro on Dec 13, 2012  (view change)
  • show comment hide comment
Go to start of metadata
Jenkins
  • Home
  • Mailing lists
  • Source code
  • Bugtracker
  • Security Advisories
  • Donation
  • Commercial Support
  • Wiki Site Map
Documents
  • Meet Jenkins
  • Use Jenkins
  • Extend Jenkins
  • Plugins
  • Servlet Container Notes

On Debian-based distributions, such as Ubuntu, you can install Jenkins through apt-get.

Recent versions are available in an apt repository. Older but stable LTS versions are in this apt repository.

You need to have a JDK and JRE installed. openjdk-6-jre and openjdk-6-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.

Installation

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

Upgrade

Once installed like this, you can update to the later version of Jenkins (when it comes out) by running the following commands:

sudo apt-get update
sudo apt-get install jenkins

(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/jenkins for 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/jenkins will capture configuration parameters for the launch.
  • By default, Jenkins listen on port 8080. Access this port with your browser to start configuration.

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:

juju deploy jenkins 
juju deploy -n 5 jenkins-slave 
juju add-relation jenkins jenkins-slave

The default password for the 'admin' account will be auto-generated. You can set it using:

juju set jenkins password=mypassword

Always change it this way - this account is used by the charm to manage slave configuration. Then feel free to expose your jenkins master:

juju expose jenkins

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
  • sudo a2enmod vhost_alias
    spacer 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 jenkins in /etc/apache2/sites-available
<VirtualHost *:80>
	ServerAdmin webmaster@localhost
	ServerName ci.company.com
	


gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.