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-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.
installation
upgrade
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/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 like e.g jenkins_home
by default, jenkins listen on port 8080. access this port with your browser to start configuration.
<col>

if your /etc/init.d/jenkins file fails to start jenkins, edit the /etc/default/jenkins to replace the line
by
here, 8081 was chosen but you can put another port available.
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:
using linux iptables for port 80 -> 8080
this enables port forwarding of traffic between ports 80 and 8080. you can keep jenkins on the default port 8080 and access it with a normal url without installing anything extra.
sudo nano /etc/rc.local
then add the following just before the exit 0
now reboot or run sudo /etc/rc.local to enable port forwarding. additional info: https://gist.github.com/m5m1th/6870a54717c0387468c3
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
if you get error: site default does not exist! then try this instead:
sudo a2dissite 000-default
and if all else fails just have a look if there is a default site set up at all:
ls /etc/apache2/sites-enabled/
create a file called jenkins.conf in /etc/apache2/sites-available
sudo a2ensite jenkins
sudo apache2ctl restart
setting up an nginx proxy for port 80 -> 8080
this configuration will setup nginx to proxy port 80 to 8080 so that you can keep jenkins on 8080. instructions originally found in a github gist from rdegges: https://gist.github.com/913102
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 sites-available to sites-enabled:
restart nginx
where to go from here?
you might want to make jenkins visible through apache, to make it available on port 80 (for example, http://myserver/jenkins/ instead of http://myserver:8080/). see this blog for more details
you might want to see latest releases of jenkins debian packages. see http://pkg.jenkins-ci.org/debian-stable/