Install Alfresco on Ubuntu 8 04 from source

The following tutorial was adapted from various sources and tested in August of 2008 using Alfresco revision 2661 on Xubuntu. You may wish to create a launcher on the desktop that issues the command gksudo thunar to get root access to the file system. If you are using the Gnome desktop the command would be gksudo nautilus. Also, in case you don't know, you can obtain root status in Ubuntu by issuing the following command:

sudo su

Install and configure packages

Use the apt-get command to install the needed packages. Enter the following as root in a terminal:

apt-get install sun-java5-jdk ant subversion imagemagick mysql-server swftools

Add a symbolic link for ImageMagick. Again, as root:

ln -s /usr/bin/convert /usr/bin/imconvert

Install Tomcat 5.5.23

You will need to install two separate installations, one for Alfresco and one for virtualization. Create the Tomcat direcotories in /usr/local as root.

cd /usr/local/
mkdir tomcat
mkdir virtual-tomcat

Download the Tomcat 5.5.23 core binary.

Extract a copy of tomcat into each folder. The bin folder should now be just inside the folders that you've created.

Configure Tomcat

The default heap size allocated by tomcat for java is less than Alfresco requires. Increase the heap size by editing the file in the tomcat/bin and virtual-tomcat/bin folder and adding the following line:

JAVA_OPTS="-Xms256m -Xmx512m"

Set up the environment variables

The environment variables may be different for the normal user and root. As you will be running the ant build as root, those variables need to be set for the root user. Add the variables at the terminal as root, using the export command.

export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun-
export TOMCAT_HOME=/usr/local/tomcat/
export APP_TOMCAT_HOME=/usr/local/tomcat/
export VIRTUAL_TOMCAT_HOME=/usr/local/virtual-tomcat/

You may check that your variables are properly set by using the echo command like so:


You should see:


Create the Alfresco database

Connect to MySQL as the MySQL root user:

mysql -u root -p

Enter your MySQL password and at the mysql prompt enter:

create database alfresco;
grant all on alfresco.* to alfresco@localhost identified by 'alfresco';
grant all on alfresco.* to alfresco@localhost.localdomain identified by 'alfresco';

Check out the source with Subversion

Create a new directory for the Alfresco source code somewhere. I use /home/greg/workspace/alfresco.

cd /home/greg/workspace
mkdir alfresco

Use svn co to download the Alfresco source to the new directory.

cd alfresco
svn co svn://

You may optionally use the -r flag followed by the revision number. If you wanted revision 929, also known as version 2.1, you would use:

svn co svn:// -r 929

Build with Ant

Navigate to the root folder:

cd HEAD/root

All targets for building Alfresco are within the build.xml file. You can use ant -projecthelp to see all the available options. Here are a few of the common commands:

ant build-tomcat
builds and deploys Alfresco for Tomcat
ant incremental-tomcat
incrementally builds and deploys Alfresco for Tomcat
ant start-tomcat
executes the Tomcat start up script
ant build-jboss
builds and deploys Alfresco for JBoss
ant incremental-jboss
incrementally builds and deploys Alfresco for JBoss
ant start-jboss
executes the JBoss start up script
ant test
runs unit tests for the entire project

Let's build for Tomcat:

ant build-tomcat

This will, among other things, create an alfresco.war file and copy it to the /usr/local/tomcat/webapps/ directory

Start Tomcat

In a terminal, navigate to the tomcat bin folder and issue the following command as root: run

Log in to your Alfresco




Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License