Installation using Debian (.DEB) packages

Version 87.1 by Thomas Mortagne on 2016/09/23

Starting with XWiki 3.3, it's possible to download and install automatically XWiki and every component needed for a production instance in a one shot, with the help of our new .deb packages, into our repository.

This method should work on every Debian-based linux distribution. Feel free to use the user Mailing List to report an issue, or discuss about it.

Before you start make sure you've checked the System Requirements. Main of them - you should have java (jdk) installed.

First Step : APT Configuration

First, you have to configure your package manager in order to use xwiki's repository. This can be done simply, using this command:

wget -q "" -O- | sudo apt-key add -
sudo wget "" -P /etc/apt/sources.list.d/

Note that there is several repositories you can choose (as alternatives to the stable one you have in the previous example):

Now you can update the packages database to read the data from this repository.

sudo apt-get update

I'll assume you're using APT tools. You can use Aptitude as well.

Now you can make a little search to see what this repo offers.

apt-cache search xwiki

It shows the following packages (the exact list depends on the version the repository contains):

  • xwiki-enterprise-common - XWiki enterprise, you can install this if you want to take care yourself of the database and application server
  • xwiki-enterprise-mysql-common - XWiki enterprise MySQL common package, you can install this if you want to take care yourself of the application server
  • xwiki-enterprise-pgsql-common - XWiki enterprise PostgreSQL common package, you can install this if you want to take care yourself of the application server
  • xwiki-enterprise-tomcat-common - XWiki enterprise Tomcat common package, you can install this if you want to take care yourself of the version of tomcat to install and the database
  • xwiki-enterprise-tomcat5-mysql - XWiki enterprise Tomcat5/MySQL based package
  • xwiki-enterprise-tomcat6-mysql - XWiki enterprise Tomcat6/MySQL based package
  • xwiki-enterprise-tomcat7-mysql - XWiki enterprise Tomcat7/MySQL based package
  • xwiki-enterprise-tomcat8-mysql - XWiki enterprise Tomcat8/MySQL based package
  • xwiki-enterprise-tomcat5-pgsql - XWiki enterprise Tomcat5/PostgreSQL
  • xwiki-enterprise-tomcat6-pgsql - XWiki enterprise Tomcat6/PostgreSQL
  • xwiki-enterprise-tomcat7-pgsql - XWiki enterprise Tomcat7/PostgreSQL
  • xwiki-enterprise-tomcat8-pgsql - XWiki enterprise Tomcat8/PostgreSQL
  • xwiki-solr-data - A pre configured Solr core to be used to setup a standalone instance of Solr for XWiki

According to selection, package manager will install all necessary dependencies (application server, database, Java runtime). If you haven't installed these packages before, package manager can ask additional info from you.

Java 8

XWiki require Java 8 since 8.1, it will be automatically installed as dependency on recent distributions. Problem is that Ubuntu and Debian did not bothered put OpenJDK on older but still supported distributions default repositories (for example Ubuntu 14.04 or Debian Wheezy/Jessie). For those you will have to either install Java 8 yourself or make sure there is some repository with it so that openjdk is installed automatically with XWiki.

Also if you have several versions of Java installed you might need to explicitly tell Tomcat which one to use after the install. See Tomcat section.

Here is a few helpers:

Ubuntu 14.04

Debian Wheezy or Jessie

Second Step : Complete Installation

Most Debian distributions provide a Tomcat package with a pretty low Memory setting (128MB) and this need to be increased for XWiki to fully work. See Tomcat Usability section for more details.

Using MySQL

As you may now, you only have to run this command to install all the interesting components.

sudo apt-get install xwiki-enterprise-tomcat7-mysql

This virtual package depends on xwiki-enterprise-common, xwiki-enterprise-tomcat-common, xwiki-enterprise-mysql-common, mysql-server, tomcat7 and libmysql-java.

During the installation, you may have some questions from dbconfig, in charge of the configuration of the database. Don't confuse it with the MySQL root password prompt, which beg you to put a password for the superuser.
DBconfig prompt is about the configuration of xwiki and mysql. If you haven't any mysql already installed and you aren't familiar with it, you should let dbconfig handle this.

DBconfig is then asking you for the mysql root password (you may have entered before). Then, you can choose the password for the "xwiki" mysql user. This user will be used to connect from XWiki application, choose is wisely, but you don't have to pay a lot of attention to it, because after that, dbconfig is configuring XWiki automatically with these credentials.

The installation now ends, with the automatic start of tomcat daemon ("Starting Tomcat servlet engine tomcat7      [OK]").

You can now point your favorite browser to the following URL to use your wiki: http://localhost:8080/xwiki

Note that your wiki is absolutely empty, like a WAR installation. Distribution Wizard will take care of the rest.

Using PostgreSQL

It's as simple as the MySQL installation, you only need to choose the right virtual package.

sudo apt-get install xwiki-enterprise-tomcat7-pgsql

You can now point your favorite browser to the following URL to use your wiki: http://localhost:8080/xwiki

PostgreSQL is slightly different than MySQL in the handling of databases and in the manual configuration, but everything should work on the first try.

Security settings

  1. Open /etc/xwiki/xwiki.cfg file and change lines:

    #-# Cookie encryption keys. You SHOULD replace these values with any random string,
    #-# as long as the length is the same.
  2. If you need, add password to the built-in superadmin account, by changing line:

    #-# Enable to allow superadmin. It is disabled by default as this could be a
    #-# security breach if it were set and you forgot about it. Should only be enabled
    #-# for recovering the Wiki when the rights are completely messed.

Tomcat Usability

Java Version

Make sure Tomcat is executed with the right Java version.

This is usually indicated in /etc/default/tomcat<version> configuration file.


The default Tomcat memory setup is way too low for XWiki.

You can change it in the file /etc/default/tomcat7 (or /etc/default/tomcat8 for Tomcat 8, etc).

Modify the property JAVA_OPTS. For example:

JAVA_OPTS="-Djava.awt.headless=true -Xmx512m -XX:MaxPermSize=192m"

You should check the Memory settings we recommend.

Concluding Step


If you want to remove XWiki from your system, you only have to uninstall the package you've installed at the beginning of this documentation. For example:

apt-get --purge remove xwiki-enterprise-common

Attention, these commands do not remove MySQL nor tomcat from your system. To do so, if you don't use these applications for another purpose, you can make some cleaning with

apt-get --purge autoremove



See Tomcat Installation for generic Tomcat related issues.


See MySQL Installation for generic MySQL related issues.


See PostgreSQL Installation for generic PostgreSQL related issues.

Bad version of PostgreSQL driver on Debian

The version of the PostgreSQL driver on Debian Wheezy and Jessie is the 9.1 (at least when writing those lines) which does not work well with XWiki. You will have to upgrade it.

The latest JDBC postgres driver is available at , at the time of this writing, the latest version is postgresql-9.4-1201.jdbc41.jar (which works fine with xwiki), you need to download the driver to your server, a good place is where the other drivers are: /usr/share/java, then remove the symlink postgresql-jdbc4.jar and replace it by one to the new driver:

wget -O /usr/share/java/postgresql-9.4-1201.jdbc41.jar
rm /usr/share/java/postgresql-jdbc4.jar
ln -s /usr/share/java/postgresql-9.4-1201.jdbc41.jar /usr/share/java/postgresql-jdbc4.jar

Restart tomcat and you will not have any issue with the JDBC driver.

Other useful info

XWiki as root webapp

When doing it make sure to check after upgrade if all is OK in /etc/tomcat7/Catalina/localhost folder (xwiki.xml might be restored).

  • Rename file /etc/tomcat7/Catalina/localhost/xwiki.xml into /etc/tomcat7/Catalina/localhost/ROOT.xml
  • Edit file /etc/xwiki/xwiki-tomcat7.xml (or /etc/xwiki/xwiki-tomcat8.xml depending on your tomcat version) and modify Context XML element path from /xwiki to / as in moving from
    <Context path="/xwiki" docBase="/usr/lib/xwiki" privileged="true" allowLinking="true" crossContext="true">
     <!-- make symlinks work in Tomcat -->
     <Resources className="org.apache.naming.resources.FileDirContext" allowLinking="true" />


    <Context path="/" docBase="/usr/lib/xwiki" privileged="true" allowLinking="true" crossContext="true">
     <!-- make symlinks work in Tomcat -->
     <Resources className="org.apache.naming.resources.FileDirContext" allowLinking="true" />
  • Edit file /etc/xwiki/xwiki.cfg and uncomment xwiki.webapppath=

Integrate with LibreOffice

Install libreoffice with apt-get install libreoffice.

And setup XWiki to automatically start and access libreoffice in /etc/xwiki/


See Office Importer Application for more details.

Overview of the important files

Here is a list of a different tree. The point is to help you find useful files easily. This list is showing a few files and directories, to keep it simple and clear. The '->' is used to show a link to another file/directory.


_ hibernate.cfg.xml        Hibernate configuration, helping to configure the database resources
_ xwiki.cfg            

_ resources
_ skins
_ templates
    _ hibernate.cfg.xml -> /etc/xwiki/hibernate.cfg.xml
    _ xwiki.cfg -> /etc/xwiki/xwiki.cfg
    _ -> /etc/xwiki/


_ context.xml
_ server.xml
_ tomcat-users.xml
_ web.xml

_ tomcat7                 This file helps configuring the Tomcat daemon. Every change needs a restart to be effective

_ tomcat7                 Daemon start/stop script

_ common
_ conf -> /etc/tomcat7
_ logs -> ../../log/tomcat7
_ server
_ shared
_ webapps

_ catalina.out            First logging file. Check this one if you're experiencing troubles with Tomcat/XWiki.


_ debian.cnf
_ my.cnf                  Database configuration. Max_allowed_packet is the parameter you  need to change to improve upload data size. permitted.

_ mysql
_ xwiki                   This is the xwiki database. You may want to backup this directory from time to time.

_ syslog
_ mysql
    _ error.log


_ <version>
    _ main
        _ postgresql.conf
        _ pg_hba.conf

_ base


Get Connected