Installation using Debian (.DEB) packages

Last modified by Thomas Mortagne on 2018/03/09

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 Forum 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.

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-common - XWiki, you can install this if you want to take care yourself of the database and application server
  • xwiki-mysql-common - XWiki MySQL common package, you can install this if you want to take care yourself of the application server
  • xwiki-pgsql-common - XWiki PostgreSQL common package, you can install this if you want to take care yourself of the application server
  • xwiki-tomcat7-common - XWiki Tomcat 7 common package, you can install this if you want to take care yourself of the database link
  • xwiki-tomcat8-common - XWiki Tomcat 8 common package, you can install this if you want to take care yourself of the database link
  • xwiki-tomcat7-mysql - XWiki Tomcat 7/MySQL based package
  • xwiki-tomcat8-mysql - XWiki Tomcat 8/MySQL based package
  • xwiki-tomcat7-pgsql - XWiki Tomcat 7/PostgreSQL
  • xwiki-tomcat8-pgsql - XWiki Tomcat 8/PostgreSQL
  • xwiki-solr-data - A pre configured Solr core to be used to setup a standalone instance of Solr for XWiki

Plus legacy packages from older versions of XWiki like xwiki-enterprise-* packages.

xwiki-enterprise-* packages were deprecated as of 9.4. Installations requiring those packages will appear to have stopped updating at version 9.4. Install the corresponding xwiki-* package to update to the latest version. (For example, if you were relying on the xwiki-enterprise-tomcat8-mysql package, you will now need to install the xwiki-tomcat8-mysql package.)
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 XWiki 8.1, OpenJDK 8 will be automatically installed as dependency on recent distributions.

You can also use Web Upd8 repository if you want Oracle Java version. See documentation for Ubuntu or Debian.

For some older distributions the problem is that Ubuntu and Debian did not bothered put OpenJDK 8 on older but still supported distributions default repositories (for example Ubuntu 14.04 or Debian Wheezy/Jessie). For those you will have to make sure there is some repository with it so that Java 8 is installed as a package so that XWiki find it as dependency.

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 Usability section.

Here is a few helpers for specific distributions:

Ubuntu 14.04 (Trusty Tahr)

Debian 7 (Wheezy) or 8 (Jessie)

Complete Installation

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

Using MySQL

You only have to run this command to install all the interesting components.

sudo apt-get install xwiki-tomcat8-mysql

This package depends on xwiki-common, xwiki-tomcat8-common, xwiki-mysql-common, mysql-server, tomcat8 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 it 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]").

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-tomcat8-pgsql

After you've made sure to update the memory settings (see below), 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 the file /etc/default/tomcat8 (or /etc/default/tomcat7 for Tomcat 7, etc).


The default Tomcat memory setup is too low for XWiki's needs.

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

Modify the property JAVA_OPTS. For example:

JAVA_OPTS="-Djava.awt.headless=true -Xmx1024m"

You should check the Memory settings we recommend.

Concluding Step

At this point your wiki is empty, i.e it doesn't contain any wiki page. Since applications in XWiki are done in wiki pages you also don't any application available (e.g. Blog, User Directory, User Profiles, etc). In addition, you wiki doesn't contain any user.  

Thus the final step is to fill your Wiki with some initial content (i.e. wiki pages).

This is the job of the Distribution Wizard which automatically starts when you are browsing your new XWiki instance for the first time.

Before XWiki 8.0, the Distribution Wizard was automatically creating an "Admin" user (with a password of admin - in lowercase), which you can then use to log in your wiki. Starting with XWiki 8.0, the Distribution Wizard has a wizard step to let you create an admin user of your choice.

The default distribution is a fully configured wiki that you can use as a starting point for creating your own wiki content. It provides the following:

Installing without internet connection

XIP package

Since 9.5 a XIP package is provided for the Standard flavor.

This is actually a zip file containing the required XWiki extensions for both the main wiki and subwikis, in the same format than the local extensions repository.

  • download it
  • Unzip it (rename it to .zip if your zip tool does not recognize it) in the folder <permanentdirectory>/extension/repository (if you get complains about already existing files don't overwrite them)
  • Restart XWiki if it was running
  • Resume standard installation, this time it will find the flavor locally

Other methods

Several options:

Extension Repositories

XWiki performs some checks at startup and even at runtime and tries to connects to remote Extension repositories. This will not cause any problem if you're offline but you'll get some error logs. You may want to disable Extension repositories by editing your config file and adding the following empty property (make sure that this is the only property defined with the name):


Deprecated methods

Manually Import Wiki Pages

This is not supported anymore since 9.5

You can also skip the Distribution Wizard import the default Wiki that we are providing as a XAR file by using the Import feature. Since there's no Admin user created at this point, you'll need to log in as superadmin to be able to perform this import. 

If you're upgrading an existing wiki using the manual Import feature, be careful that the XAR import operation will replace the content of the existing pages of your wiki with the content of the XAR (New pages that you have created will not be modified). As a consequence it's critical that you perform a backup first and read the upgrade nodes bellow carefully.

On the other hand, if you use the Distribution Wizard, it'll automatically perform a merge and prompt you for action in case there's a conflict it cannot resolve automatically. Thus using the Distribution Wizard is what we recommend.


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:

sudo apt-get --purge remove xwiki-common

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

sudo apt-get --purge autoremove



See Tomcat Installation for generic Tomcat related issues.

Ubuntu 16.04 (Xenial Xerus)

At time of writing the version of Tomcat provide by Ubuntu 16.04 repository has a serious classloader related bug which makes impossible to use code macro or write Python scripts in XWiki. See and for some more detailed explanations and workarounds.

sudo add-apt-repository ppa:nacc/tomcat8v2
sudo apt-get update
sudo apt-get install tomcat8=8.0.32-1ubuntu1.3~ppa2
sudo apt-get install tomcat8-common=8.0.32-1ubuntu1.3~ppa2
sudo apt-get install libtomcat8-java=8.0.32-1ubuntu1.3~ppa2
sudo service tomcat8 restart

Don't hesitate to click on "This bug affects me" on launchpad page if it's still not fixed, might help speeding up things...


See MySQL Installation for generic MySQL related issues.


See PostgreSQL Installation for generic PostgreSQL related issues.

Bad version of PostgreSQL driver on Debian Wheezy

The version of the PostgreSQL driver on Debian Wheezy 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.

XWiki won't start and I get Solr related error(s) in the log

There is no automatic migration of Solr schema and it changes it from time to time. The simplest fix such case is usually to stop, Tomcat, delete the folder /var/lib/xwiki/data/solr and restart Tomcat. XWiki will automatically create a new one and start indexing the wiki.

sudo /etc/init.d/tomcat8 stop
rm -rf /var/lib/xwiki/data/solr
sudo /etc/init.d/tomcat8 start

Other useful info

XWiki as root webapp (short URLs)

When doing it make sure to check after upgrade if all is OK in /etc/tomcat8/Catalina/localhost folder (xwiki.xml might be restored).
  • Rename file /etc/tomcat7/Catalina/localhost/xwiki.xml into /etc/tomcat8/Catalina/localhost/ROOT.xml
  • Edit file /etc/xwiki/xwiki-tomcat8.xml (or /etc/xwiki/xwiki-tomcat7.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 sudo 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


  • tomcat<version>                 This file helps configuring the Tomcat daemon. Every change needs a restart to be effective


  • tomcat<version>                 Daemon start/stop script


  • common
  • conf -> /etc/tomcat<version>
  • logs -> ../../log/tomcat<version>
  • server
  • shared
  • webapps


  • catalina.out            First logging file. Check this one if you're experiencing troubles with Tomcat/XWiki.
  • localhost.<date>.log     "Container Log file": Start of each filter and failures thereof are listed.



  • 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
Created by Vincent Massol on 2017/09/06

Get Connected