XWiki Platform » Documentation for the XWiki Platform » Administrator's Guide » Installation » Installation using Debian (.DEB) packages

Installation using Debian (.DEB) packages

Last modified by Thomas Mortagne on 2014/03/19 16:29

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.

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 "http://maven.xwiki.org/public.gpg" -O- | sudo apt-key add -
sudo wget "http://maven.xwiki.org/stable/xwiki-stable.list" -P /etc/apt/sources.list.d/

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:

  • xwiki-enterprise-common - XWiki enterprise common package
  • xwiki-enterprise-mysql-common - XWiki enterprise MySQL common package
  • xwiki-enterprise-pgsql-common - XWiki enterprise PostgreSQL common package
  • xwiki-enterprise-tomcat-common - XWiki enterprise Tomcat common pcakge
  • xwiki-enterprise-tomcat5-mysql - XWiki enterprise Tomcat/MySQL based package
  • xwiki-enterprise-tomcat6-mysql - XWiki enterprise Tomcat/MySQL based package
  • xwiki-enterprise-tomcat7-mysql - XWiki enterprise Tomcat/MySQL based package
  • xwiki-enterprise-tomcat5-pgsql - XWiki enterprise Tomcat/PostgreSQL
  • xwiki-enterprise-tomcat6-pgsql - XWiki enterprise Tomcat/PostgreSQL
  • xwiki-enterprise-tomcat7-pgsql - XWiki enterprise Tomcat/PostgreSQL

Second Step : Complete Installation

Using MySQL

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

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. You have to go to the administration and import the default XAR package (link above the upload form) or you can import a wiki from another instance (XAR export/import).

Using PostgreSQL

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

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.

There is a configuration problem in the 3.1.1 .deb release. Go to /etc/xwiki/hibernate.cfg.xml and replace "com.mysql.jdbc.Driver" with "org.postgresql.Driver" in the uncommented part.

Concluding Step

The final step is to fill your Wiki with initial content.

This job is done by the Distribution Wizard which automatically start when you are browsing to your new XWiki instance.

The wiki comes configured with an "Admin" user (the password is "admin" in lowercase). You'll need that username/password to log in once you've imported the default wiki.

Alternatively you can skip the Distribution Wizard and finish this step by hand:

  • Create new pages by hand
  • Import the default Wiki that we are providing as a XAR file by using the Import feature

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

  • A Blog
  • A "Recent Changes" page
  • The Panels Application
  • Search
  • Administration page (Access rights, Group and users management, etc)
  • ... and much more

Tomcat Usability

The script to command tomcat daemon is /etc/init.d/tomcat7.

/etc/init.d/tomcat7 start
/etc/init.d/tomcat7 stop
/etc/init.d/tomcat7 restart

To customize your Tomcat instance (and thus, XWiki) you have to modify the /etc/default/tomcat7 file. The most important thing to do is to modify the memory value allocated to Tomcat. Indeed, Tomcat is by default configured to use 128Mb of RAM, which is clearly a low value likely to create a memory leak and crash. We advise to uncomment and modify the CATALINA_OPTS line in the tomcat7 file, replacing it by:

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

You should check the Memory settings 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:

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

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            
_ xwiki.properties

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


_ context.xml
_ logging.properties
_ 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

Other useful info

XWiki as root webapp

  • open folder /etc/tomcat7/Catalina/localhost. In this folder exists 2 files: ROOT.xml & xwiki.xml. 
  • delete ROOT.xml 
  • rename xwiki.xml to ROOT.xml 
  • edit ROOT.xml after renaming, change ..path="/xwiki".. to ..path="/".. 
  • save ROOT.xml 
  • restart tomcat 
Created by Guillaume Fenollar on 2012/01/19 10:03

Get Connected