Ubuntu/Debian

Install tools and dependencies

Set up Maven (3.0.4):

$ apt-get install maven

Set up Tomcat:

Tomcat 6.0.35 has some known issue with CloudStack, please use Tomcat 6.0.33 from http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.33/bin

$ cd ~  # or any path
$ wget http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.33/bin/apache-tomcat-6.0.33.tar.gz
$ tar xzf apache-tomcat-6.0.33.tar.gz
$ export CATALINA_HOME=~/apache-tomcat-6.0.33
$ export CATALINA_BASE=~/apache-tomcat-6.0.33

Configure MySQL

Start the MySQL service:

$ service mysql start

Configure Java

Verify that OpenJDK is fully installed. E.g. Debian 7.1 does net install does not have it, and Maven does not add it either.

$ apt-get install openjdk-6-jdk

NB: at time of writing, version 6 was in use

Maven finds the Java compiler via JAVA_HOME. Find compiler location:

$ find / | grep bin/javac

Set JAVA_HOME to root of JDK containing this javac. e.g.

$ export JAVA_HOME=/usr/lib/jvm/java-6-openjdk-amd64

NB: If the next step works, add sure JAVA_HOME to your shell's .rc file.

Install Sudo

Used by management server to elevate privileges when mounting NFS shares.

$ apt-get install sudo

Build CloudStack

Go to your repository:

$ mvn clean
$ mvn install
$ mvn -P developer -pl developer -Ddeploydb     # Set up database (Note: If there is a password set for db then please make sure to update the password in utils/conf/db.properties)
$ mvn -pl :cloud-client-ui jetty:run            # Run the management server on port 8080

CentOS/RHEL/Fedora

Install tools and dependencies

$ yum install git ant ant-devel java-1.6.0-openjdk java-1.6.0-openjdk-devel mysql mysql-server tomcat6 mkisofs gcc python MySQL-python openssh-clients wget

Set up Maven (3.0.4):

$ wget http://www.us.apache.org/dist/maven/maven-3/3.0.4/binaries/apache-maven-3.0.4-bin.tar.gz
$ cd /usr/local/ # or any path
$ tar -zxvf apache-maven-3.0.4-bin.tar.gz
$ echo export M2_HOME=/usr/local/apache-maven-3.0.4 >> ~/.bashrc # or .zshrc or .profile
$ echo export PATH=${M2_HOME}/bin:${PATH} >> ~/.bashrc # or .zshrc or .profile

Note: Tomcat 6.0.35 has some known issue with CloudStack, please use Tomcat
6.0.33 from http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.33/bin

Configure Environment

Set CATALINA_HOME to path where you extract/install tomcat, put them in your
.bashrc or .zshrc or .profile:

$ echo export CATALINA_HOME=/usr/share/tomcat6/ >> ~/.bashrc

Fix permissions on CATALINA_HOME:

$ chown -R <you>:<your-group> $CATALINA_HOME

Generate you ssh keys, useful for ssh-ing to your hosts and vm etc.:

$ ssh-keygen -t rsa -q

Configure MySQL

Start the MySQL service:

$ service mysqld start

What next?

After you've successfully set up your development environment, get started on how to build CloudStack:

https://cwiki.apache.org/confluence/display/CLOUDSTACK/How+to+build+on+master+branch