Install Alfresco Community 4.2 on Ubuntu 12.04 (Fixed)

Posted on Thursday, January 31, 2013

This document shows how to install Alfresco 4.2 on an Ubuntu 12.10 system.  (This is an update to my prior document that had a few issues that prevented some parts of alfresco from working correctly...  Mainly renditions and thumbnails)

I am creating a virtual server for this that has 3.75 GiB of Memory

Installing Java 7

Here are the commands to install Java 7 from Ubuntu 12.04 server.

>  sudo apt-get purge openjdk*
>  sudo apt-get install python-software-properties
>  sudo add-apt-repository ppa:webupd8team/java
>  sudo apt-get update
>  sudo apt-get install oracle-java7-installer
>  java -version


Install Tomcat 7

·         Download tomcat 7 to the local directory  (this address could change see [2])

>  wget

Extract the file

>  tar xvzf apache-tomcat-7.0.35.tar.gz

Move the tomcat over

>  sudo mv apache-tomcat-7.0.35 /opt/tomcat

Now set up the tomcat users.

>  sudo vi /opt/tomcat/conf/tomcat-users.xml

Add the following lines within the <tomcat-users> element  (of course change the password to your own password)

  <role rolename="manager-gui"/>
  <role rolename="admin-gui"/>
  <user name="admin"   password="password"
                              roles="admin-gui, manager-gui,
                              manager-script, admin-script" />

Fix the connector,

 >  sudo vi +70 /opt/tomcat/conf/server.xml

And add this to the connector

Set up start up script

>  sudo vi /etc/init.d/tomcat

Then place the following in it.  (adjust the jvm to the directory you have it in)

# Tomcat auto-start
# description: Auto-starts tomcat
# processname: tomcat
# pidfile: /var/run/

export JAVA_HOME=/usr/lib/jvm/java-7-oracle

case $1 in
sh /opt/tomcat/bin/
sh /opt/tomcat/bin/
sh /opt/tomcat/bin/
sh /opt/tomcat/bin/
exit 0

Make it executable

>  sudo chmod 755 /etc/init.d/tomcat

Add it to autostart

>  sudo update-rc.d tomcat defaults

Reboot to test auto start of tomcat

>  sudo reboot now

Now open up a web browser  (of course use your IP address, domain name)

You Should see…

Change memory settings for tomcat

>  sudo vi /opt/tomcat/bin/

Add the following line

This gives it 2GiB to use, you may need to change it to your system

JAVA_OPTS="-XX:MaxPermSize=160m -XX:NewSize=256m -Xms512m "
JAVA_OPTS="$JAVA_OPTS -Xmx2048m -Xss512K  "

Restart tomcat

> sudo /etc/init.d/tomcat restart

Open up to check the memory settings

Here you can see here that it does have 2GiB of max memory (roughly)

Install/Setup MySQL

Install mysql on this server

>  sudo apt-get install mysql-server

For the root password set it to “mysqlpassword”

Log into mysql

>  mysql -u root -p -h localhost

Run this command in mysql to create alfresco user and to give it alfresco access

>  CREATE USER 'alfresco'@'localhost' IDENTIFIED BY 'passalfresco';
>  CREATE USER 'alfresco'@'%' IDENTIFIED BY 'passalfresco';
>  grant all on alfresco.* to 'alfresco'@'%' identified by 'passalfresco' with grant option;
create database alfresco default character set utf8 collate utf8_bin;
>  exit

Restart mysql

>  sudo /etc/init.d/mysql restart

Create Alfresco Folder

Make a alfresco folder

>  sudo mkdir /alfresco

Download Install Alfresco

Some of the notes I used for this are at

Download the installer (this address will change over time) but you can probably be safe going to [4]

>  cd
>  mkdir alfresco
>  cd alfresco
>  wget

If you do not have unzip install it.

>  sudo apt-get install unzip

unzip file

>  unzip

Install alfresco.war and share.war on tomcat
Open up the tomcat web page

Then enter
Context Path
War Directory

Click Deploy
It will deploy but fail to start (which is fine)

Now do the same for share.war
Then enter
Context Path
War Directory

Click Deploy

Download and install mysql connector, it can be found at [5]

>  cd
>  wget
>  unzip
>  cd mysql-connector-java-5.1.22/
>  cp mysql-connector-java-5.1.22-bin.jar /opt/tomcat/lib/

Set up the shared directory

>  cd
>  cd alfresco/web-server
>  sudo cp -r shared /opt/tomcat/

Set Global Properties

Alfresco requires some additional installs to work.  Alfresco out of the box uses a few other tools like OpenOffice and ImageMagick.

First update your repository information

>  sudo apt-add-repository ppa:guilhem-fr/swftools
>  sudo add-apt-repository ppa:upubuntu-com/office
>  sudo apt-get update

Install these via apt-get

>  sudo apt-get install imagemagick swftools libjodconverter-java ffmpeg ttf-mscorefonts-installer

Copy these sample files to .xml files (it will allow the creation of thumbnails for videos)

>  cd /opt/tomcat/shared/classes/alfresco/extension/
>  sudo cp video-thumbnail-context.xml.sample video-thumbnail-context.xml
>  sudo cp video-transformation-context.xml.sample video-transformation-context.xml

Edit the /opt/tomcat/conf/ file

> sudo vi +74 /opt/tomcat/conf/

Updated shared.loader to the following


In the /opt/tomcat/shared/classes directory there is an folder.  Rename it

>  cd /opt/tomcat/shared/classes
>   sudo cp

Now edit this file

>  sudo vi

Here is the file I made,  Make sure to edit the mail.* portion to an email account you have.  (new in ubuntu 12.04 open office is now libreoffice)

## Common Alfresco Properties #

# Sample custom content and index data location

# Sample database connection properties

#Disabled the guest login

# External locations

# Property to control whether schema updates are performed automatically.
# Updates must be enabled during upgrades as, apart from the static upgrade scripts,
# there are also auto-generated update scripts that will need to be executed.  After
# upgrading to a new version, this can be disabled.

# MySQL connection

# Oracle connection

# PostgreSQL connection (requires postgresql-8.2-504.jdbc3.jar or equivalent)

# DB2 connection
# Index Recovery Mode

# Outbound Email Configuration
# New Properties

# Alfresco Email Service and Email Server

# Enable/Disable the inbound email service.  The service could be used by processes other than
# the Email Server (e.g. direct RMI access) so this flag is independent of the Email Service.

# Email Server properties

# A comma separated list of email REGEX patterns of allowed senders.
# If there are any values in the list then all sender email addresses
# must match. For example:
#   .*\@alfresco\.com, .*\@alfresco\.org
# Allow anyone:

# The default authentication chain
# To configure external authentication subsystems see:

# URL Generation Parameters (The ${localname} token is replaced by the local server name)


# Default value of is which means 'listen on all adapters'.
# This allows connections to JMX both remotely and locally.

# RMI service ports for the individual services.
# These seven services are available remotely.
# Assign individual ports for each service for best performance
# or run several services on the same port. You can even run everything on 50500 if needed.
# Select 0 to use a random unused port.

Reboot the server

>  sudo reboot now

It may take a while for alfresco to come up and set up the database the first time.  What I do is log back into the system them tail the tomcat log to see if alfresco is starting correctly, and for when it is done  (in my case it took 2 ½ minutes)

>  sudo tail -f /opt/tomcat/logs/catalina.out

See the server startup message.

Logged in as admin and added new users

Open up

The default login is

User               = admin
Password     = admin

I always first change the admin password from the default just to make sure. To do this…

Click on User Profile

Click on Change password

Enter new password and click Finish

Click on  Manage System Users

Click Create New User

In my case I created a user called patman

Click next

Enter a password and Click Finish

Now add the user to the admin group.

Click on Administration Console

Click on manage User Groups

Click on Show all then click add user in the Alfresco_Adminstrators

Search for user, select user then click add.

Finally click on OK

Now this user is an admin.

Log out and log back in as the user you just made and gave admin rights to.

Make sure this user can log into the Share site as well. 
Open up

There you have it.   An installed 4.2 Alfresco/Share site on Ubuntu 12.04.

[1]  Installing Tomcat 7 on Ubuntu 9.10
       Visited 1/2013
[2]  Tomcat download page
       Visited 1/2013
[3]  Download and install Alfresco in Linux
       Visited 1/2013
[4]  Download and Install Alfresco
       Visited 1/2013
[5]  Download Connector/J
       Visited 1/2013
[6]  How To Install Alfresco Community 3.3 On Ubuntu Server 10.04 (Lucid Lynx)
       Visited 1/2013


  1. went flawlessly! Thanks for this awesome tut

  2. is the sharepoint module present in that installation?

    1. This guide does not cover sharepoint. I have not had an opportunity to use alfresco with sharepoint, maybe someday I will.

  3. Thank you for this detailed and flawless tutorial! I have saved a lot of time and headaches.
    1000 Thank's

    1. Not a problem glad I could help. I recently have been stuck doing alot of .Net programming but I plan to get back to some Alfresco stuff this summer and start writing up some more guides then. I hope to get a guide up on integrating Alfresco with Google Docs before summer gets into full swing

  4. Thank you for the tutorial. For some reason when I go to deploy the war files I get "FAIL - Failed to deploy application at context path /alfresco" instead of the fail that is expected. I cut and copied the 2 lines of code, BUT I changed username to my username on the system. Is there something I am missing?

    1. Sorry for the late reply. It's been a busy week.

      My first guess is maybe the war file is not located where you think it is. Make sure the path you entered in for the war file is the exact location on the system. My other guess may be permissions, though I do not think that would be a problem.

      If you can't get it to work you can always look at the log files at /opt/tomcat/logs/catalina.out to see what the exact errors are occuring.

  5. Patrick, i see on the top of the post (which looks great btw) you mentioned you were thinking about creating a virtual appliance or vm, i was wondering if you ever did create that vm so i could possibly download? Just thought i would check since i am feeling lazy at the moment.


    1. I would make a generic one to give away but VMs can get kind of big and I do not have a good place to put it where I could afford the bandwidth :) I imagined it would a few GBytes in size and that is a little prohibitive. But maybe I will change my mind. I will put it on my backburner list as a possible in the future.

  6. I'm getting a 404 when I try to open http://(local_ip):8080/alfresco. I've changed the, rebooted the server, and run sudo tail -f /opt/tomcat/logs/catalina.out and got the same basic info. But when I go to view alfresco, I get a 404. I've gone through the tutorial twice from scratch now and it's happened both times. Any ideas? Also, I can see all the other tomcat web ages.

    One potential clue: after the first time I tried to open alfresco, the catalina.out log added this:

    NFO: Server startup in 85776 ms
    Jun 06, 2013 12:55:00 AM org.apache.catalina.loader.WebappClassLoader loadClass
    INFO: Illegal access: this web application instance has been stopped already. C
    ould not load org.quartz.StatefulJob. The eventual following stack trace is cau
    sed by an error thrown for debugging purposes as well as to attempt to terminate
    the thread which caused the illegal access, and has no functional impact.
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
    at org.quartz.JobDetail.isStateful(
    at org.quartz.simpl.RAMJobStore.triggerFired(

    Exception in thread "SolrWatcherScheduler_QuartzSchedulerThread" java.lang.NoCla
    ssDefFoundError: org/quartz/StatefulJob
    at org.quartz.JobDetail.isStateful(
    at org.quartz.simpl.RAMJobStore.triggerFired(
    Caused by: java.lang.ClassNotFoundException: org.quartz.StatefulJob
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa

    1. I am not exactly sure why you are getting this error. Poking around It sounds like an issue in your environment. I found this post that has a few suggestions on how to possibly fix it

    2. Patrick:

      You are a gentleman and a scholar. The link you gave me was just what I needed. Turns out I had previously screwed up my hostname setting, and it was affecting Tomcat. I apologize for taking up your time.


    3. Not a problem. Taking a little time to help someone out only pays it forward. I have had plenty of questions answered by other folks so I owe the internet a few answered questions every so often :)

  7. This comment has been removed by the author.

  8. HI
    any experience with SSO between alfresco and a windows domain (windows server 2003) so that users dont have to remember another password?

    1. By the way great blog!
      1. I want to give my smb users versioning in the file share so i am thinking about installing an ubuntu server with alfresco and they will use it with CIFS,
      So in the beginning they do not even know they are using alfresco (just explain check in/check out)..
      We use winXP/win 7, users have windows accounts and also google mail accounts. is there a way to sync the alfresco accounts with google accounts or windows accounts so they dont need to remember another set of passwords?

    2. Lots of good questions...

      First I have not set up an SSO with alfresco. I did find this page looking around real quickly

      Alfresco is meant for enterprise so there should be an easy SSO solution... I just never had need of one so far

      I have plans to do a write up at some point on how to sync alfresco with your google docs. I just have not had the time watch this video for this feature But your question is about passwords not docs...

      I am not aware of a way to do what you are asking off the top of my head.

  9. Hi Sir,

    Your articel very helpful. Could you help me to config alfresco authentication with zimbra ldap. My zimbra version is 7.2.2.

    Thank you

    1. Setting up Alfresco to talk to an LDAP system has been something I have wanted to do, but have not yet done.

      I have added it to my TODO list, not promising anything but if I am lucky I will have an article in the next month or so on the Subject.

  10. Hi Patrick,

    your article is far best than any other i found online. I just installed alfresco with postgresql, it works, but im getting catalina.out full of these exceptions:
    Authentication failed for Web Script org/alfresco/repository/admin/restrictions.get

    do you have any idea how to fix this?

  11. Simply awesome.
    Thank you so much for this post.

    The only thing i did different is that a moved the jars directly to /opt/tomcat/webapps instead of deploying it via tomcat manager app

  12. Thank you so much ! Worked like a charm, better than anything else I found in the web !

  13. Great post, which leads a question: why doing it all manually, as Alfresco provides some kind of all-in-one setup script ?

    Is there real benefit over the alfresco bundle ?
    thank you very much

    1. They do provide an all-in-one install. However its meant for testing. It could be used for day to day usage, but it would need a few tweaks. Such as removing the guest login and updating the admin users default password.

      This installation guide, although a valid install, is really just a good starting point for configuring your own set up. As an example you may want to use a postgres database on a different server, this guide does not do that but it does give you a leg up on how to do that (I hope).

      So why would you want to use this vs the provided all-in-one setup.
      1. This is a more production ready set up
      2. Easily allows you to connect to databases running on another server
      3. Because we are geeks and like to tinker!

  14. Hi Patrick
    I successfully installed and configured tomcat7, mysql, and alfresco 4.2.c using your great tutorial. Now I wanted to install an add-on (auditShare: and found that some dirs mentioned in the installation guide for audit are missing. Also, the paths in (or apply_amps.bat), which I'm asked to run, are not right set. is completely missing, but I assume that starting and stopping alfresco via the tomcat manager does the same job. My question now: is there a standard way of installing add-ons after manual install with your tutorial ? Or do I just have to adjust scripts and dirs manually and hope everything runs fine ?
    Thank you very much!

    1. I have the same issue. Have you found any solution for this case?


  15. Thanks for the excellent manual¡¡¡¡
    Can you help me with a script to stop and start services alfresco?
    Please help in this issue¡¡¡
    Thank you¡¡¡

  16. What a great How to....

    I did exactly as you put it but I get the following error. Is t something I missed? I checked the settings and it's identical because I copied and pasted the "# External locations" parameters

    Errors below:
    2014-05-29 09:15:39,216 WARN [alfresco.util.OpenOfficeConnectionTester] [localhost-startStop-1] An initial OpenOffice connection could not be established.

    2014-05-29 09:15:47,676 WARN [org.alfresco.fileserver] [localhost-startStop-1] CIFS, Unable to get local domain/workgroup name, using default of WORKGROUP. This may be due to firewall settings or incorrect setting)

    2014-05-29 09:16:00,221 WARN [alfresco.util.OpenOfficeConnectionTester] [DefaultScheduler_Worker-3] Error trying to query Open Office version information.'s ConfigurationRegistry not implemented in this version of OOo. Thi
    s should not affect the operation of OOo.

    2014-05-29 09:16:36,626 ERROR [content.transform.TransformerConfigDynamicTransformers] [SearchScheduler_Worker-6] Cannot create dynamic transformer transformer.complex.JodConverter.Image as sub transformers could not be found or created (

    2014-05-29 09:16:36,626 ERROR [content.transform.TransformerConfigDynamicTransformers] [SearchScheduler_Worker-6] Cannot create dynamic transformer transformer.complex.JodConverter.Pdf2swf as sub transformers could not be found or created

    2014-05-29 09:16:36,626 ERROR [content.transform.TransformerConfigDynamicTransformers] [SearchScheduler_Worker-6] Cannot create dynamic transformer transformer.JodConverter.Html2Pdf as sub transformers could not be found or created ("JodC

    2014-05-29 09:16:36,626 ERROR [content.transform.TransformerConfigDynamicTransformers] [SearchScheduler_Worker-6] Cannot create dynamic transformer transformer.JodConverter.2Pdf as sub transformers could not be found or created ("JodConve

    2014-05-29 09:16:36,631 ERROR [content.transform.TransformerConfigDynamicTransformers] [SearchScheduler_Worker-6] Cannot create dynamic transformer transformer.complex.JodConverter.PdfBox as sub transformers could not be found or created

  17. very nice and helpfull article.The translation service is really very helpful to me.
    access Mp3Raid in UK

  18. Hi,

    I can login in the affresco website, but not in the share website ...

    Could you share your share-config-custom.xml file ?