Skip Navigation
Resources Blog Nexus Open Source and Hudson on EC2

Nexus Open Source and Hudson on EC2

If you are interested in running Nexus and Hudson on Amazon's Elastic Computing (EC2) service, there is now a public image that contains Maven, Nexus, Hudson, and the OpenJDK. If you use Amazon's easy-to-use AWS Console, running a state-of-the-art build service with Nexus and Hudson is one click away. Here are the details for those of you interested in running Nexus and Hudson on the cloud:

Launch it. In minutes, you will have a capable build server. Read more to find out about some suggested next steps to secure your new build server.

What's Installed? This instance is simply the latest installation of Hudson 1.309, Nexus 1.3.4 Open Source, OpenJDK 1.6.0, and Maven 2.1.0. Nexus is installed in /usr/local/nexus and Hudson is installed on Tomcat 6.0.20 in /usr/local/hudson. Both Nexus and Hudson are configured to startup in /etc/init.d/nexus and /etc/init.d/hudson.

Post Launch Instructions: Since Nexus and Hudson are both running with the default authentication configuration, it is imperative that you change the default administrative password of Nexus after installation (the default is "admin123"). To change the Nexus password:

  1. Go to http://<host>/nexus
  2. Log in as "admin" using the default password "admin123"
  3. Click on "Change Password" in the Security Menu

Also, it is imperative that you turn on security for your Hudson instance. To do this:

  1. Go to http://<host>/hudson
  2. Click on "Manage Hudson"
  3. Click on "Configure System"
  4. Make sure that "Enable Security" is checked, and configure Hudson security. If you don't have an LDAP server, just use Hudson's on Security Database

While you are at it, you will need to configure Hudson's JDK and Maven installation. To do this:

  1. Go to http://<host>/hudson
  2. Click on "Manage Hudson"
  3. Click on "Configure System"
  4. Click on ADD JDK. At this point, you can download a JDK directly from Sun, or you can point your Hudson instance at the OpenJDK 1.6.0 installed on this EC2 instance. The JAVA_HOME directory for OpenJDK on this box is: /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/
  5. Click on Add Maven to add a Maven installation. At this point, you can install Maven directly from Apache, or you can point Hudson at the Maven 2.1.0 instance installed on this machine. M2_HOME on this machine is /usr/local/maven.

Long-lived Build Machines on EC2 (Get an EBS Volume)

If you are planning on running this instance as a long-running build server, you will likely want to configure the sonatype-work directory to run on an EBS volume. If you do end up running Hudson and Nexus on this instance for a long time, and you are planning on depending on it: invest in an EBS volume and move /usr/local/nexus and /usr/local/hudson to run on that persistent volume. This way, you'll have the peace of mind that your build and repository data will persistent in the event of unforeseen downtime.

Happy Nexusing

Picture of Tim OBrien

Written by Tim OBrien

Tim is a Software Architect with experience in all aspects of software development from project inception to developing scaleable production architectures for large-scale systems during critical, high-risk events such as Black Friday. He has helped many organizations ranging from small startups to Fortune 100 companies take a more strategic approach to adopting and evaluating technology and managing the risks associated with change.