Revision 15 as of 2010-02-22 15:23:17

Clear message

Install packages

Install pre-requisite packages for getting and building Etherpad.

sudo apt-get install sun-java6-jdk scala mysql-server mysql-client libmysql-java mercurial

Etherpad will not build or run with openjdk-6-jdk or openjdk-6-jre. It also is best to use Sun's jar since fastjar seems to have some issues.

If you get this error:

Package sun-java6-jdk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package sun-java6-jdk has no installation candidate

Checkout /etc/apt/sources.list and add this line if missing:

deb hardy multiverse


apt-get update

and try again.

Get Etherpad code

There are no releases of Etherpad at the moment, so we grab directly from mercurial.

hg clone etherpad

If you are running this command from behind an office firewall, you might run into a bug in Python for HTTPS from behind a proxy ( Clone from the http URL instead.

hg clone etherpad

You will need to patch the etherpad code to build on Ubuntu: The description below shows the difference between the original file and changes, leading + shows where lines are added or changed. This example show two changes to trunk/infrastructure/bin/, both removing /lib from a path.

diff -r 81287c8af1ac trunk/infrastructure/bin/
--- a/trunk/infrastructure/bin/       Fri Dec 18 18:44:23 2009 +1100
+++ b/trunk/infrastructure/bin/       Sat Dec 19 09:50:05 2009 -0500
@@ -32,11 +32,11 @@
 TMPSTORE=/tmp/ajbuild-tmpstore-`date +%s`
-JARFILES=`echo $SCALA_HOME/lib/scala-library.jar lib/*.jar lib/manifest`
+JARFILES=`echo $SCALA_HOME/scala-library.jar lib/*.jar lib/manifest`
 function genjar {
     echo "unzipping JARs..."
     pushd $1 >> /dev/null
-    $JAR xf $SCALA_HOME/lib/scala-library.jar
+    $JAR xf $SCALA_HOME/scala-library.jar
     rm -rf META-INF
     for a in ../../lib/*.jar; do
        $JAR xf $a

(As of Dec. 23, 2009 the patching instructions above are either incomplete or do not provide any explanation on what to do. Typing the first command directly into the command line produces a "not found" error. Please revise these instructions to be more clear in a step-by-step fashion rather than assuming a user should know what to do.) Yes and Update would be nice Smile :)

If your mysql was updated you may need to restart mysql now.

Be sure to add you domain to the list of SUPERDOMAINs:

diff -r 81287c8af1ac trunk/etherpad/src/etherpad/globals.js
--- a/trunk/etherpad/src/etherpad/globals.js    Fri Dec 18 18:44:23 2009 +1100
+++ b/trunk/etherpad/src/etherpad/globals.js    Sat Dec 19 09:50:05 2009 -0500
@@ -29,6 +29,8 @@
   '': true,
   'localhost': true,
+  '': true,
+  '': true,
   '': true

Configure Environment

$ export JAVA_HOME=/usr/lib/jvm/java-6-sun/
$ export SCALA_HOME=/usr/share/java
$ export MYSQL_CONNECTOR_JAR=/usr/share/java/mysql-connector-java.jar
$ export JAVA="$JAVA_HOME/bin/java"
$ export SCALA="$SCALA_HOME/bin/scala"
$ export PATH="$JAVA_HOME/bin:$SCALA_HOME/bin:$PATH"

Configure MySQL

Set the variable "mysql" in the db setup script, to the name of your mysql client executable.

diff -r 81287c8af1ac -r 5ea3ba9d10f7 trunk/etherpad/bin/
--- a/trunk/etherpad/bin/      Fri Dec 18 18:44:23 2009 +1100
+++ b/trunk/etherpad/bin/      Sun Dec 20 15:53:08 2009 +0530
@@ -19,6 +19,7 @@
   exit 1
 echo "Creating etherpad ${db}..."

Run the db setup script.

$ cd trunk/etherpad
$ sudo bin/

Note if you had setup a password for the root account on the mysql server, then this won't work directly. You can edit the as needed to fix this. For example (there are two instances of this in the file)

- echo "create database ${db};" | ${mysql} -u root
+ echo "create database ${db};" | ${mysql} --user=root --password=secret
#and same for the other instances of ${mysql}

Compiling Etherpad

From trunk/etherpad:

$ bin/

Running Etherpad

$ bin/