How to Install XWiki on Ubuntu

XWiki is a wiki software that enables anyone to create, organize and share information from any device with internet access using their web browser, desktop, or mobile phone.

It’s a fully-fledged community wiki-hosting service with user permissions, roles, and groups. It has both public and private wikis. A database such as MySQL is used to store information. Servlet containers (e.g., Tomcat, Jetty) are used to run it; it supports XHTML, WYSIWYM , XSL-FO, MathML, SVG, and RSS.

XWiki is the next generation of Wiki, the only wiki on the market to offer so many features in a single package.

XWiki offers an Advanced mode that can be enabled on any wiki, allowing for more granular control over content rendering using XSLT-based transformation rules. It comes with a set of default stylesheets pre-configured to work out of the box. Still, this behavior can easily be customized through the use of custom XSLT files allowing for complete freedom in designing your wiki look & feel without having to write any code at all.

In this guide, you will learn how to install XWiki on Ubuntu 20.04 and get your users, permissions, and essential functions up and running. While this guide will be based on Ubuntu 20.04, the instructions can be applied to any Debian-based distribution.


  • A server running Ubuntu 20.04 with minimum 1024 MB of RAM and a minimum 20 GB of hard drive.
  • A domain name to access the wiki from the internet (optional).
  • Basic knowledge of Linux and web servers in general.
  • Root access to the server or sudo user privileges for installing applications and managing files & directories on your server.

Update the System

To ensure that the system requirements are met, you will have to update it first. Update your distribution’s package list by running:

sudo apt-get update

You should receive the following output:

Update packages

After updating the available packages lists, run the command below to install all updates on Ubuntu 20.04:

sudo apt-get upgrade -y


sudo apt-get dist-upgrade -y

You should receive the following output:

Upgrade Ubuntu

It is recommended to reboot your server to applying any kernel upgrades in order for them to take effect properly and avoid problems later down the road when using certain modules of XWiki such as document conversion services which depend heavily on a working Linux Kernel version.

sudo reboot now

After this, log back in using the same sudo user and proceed to the next step.

Install Java

XWiki is written in Java, so you will have to install Java on Ubuntu 20.04 before proceeding any further.

To install Java on Ubuntu 20.04, run the command below:

sudo apt install default-jdk -y

You should get the following output:

Install JAVA

You can check the version of Java with the following command after you’ve installed it:

java --version

You should get the following output:

Check JAVA installation

Now that Java is properly installed, you can proceed with the next step.

Install XWiki on Ubuntu 20.04

By default, XWiki is not available in Ubuntu 20.04 repositories so you will have to download the package from XWiki’s own website and install it manually on your server.

First of all, ensure that both wget and curl are installed with:

sudo apt-get -y install wget curl

Add the GPG key to apt with the following command:

wget -q "" -O- | apt-key add -

You should see OK output that confirm the key was added properly.

Add XWiki repo key

Add the XWiki repository to your system with the following command:

sudo wget "" -P /etc/apt/sources.list.d/

The command above will add the XWiki stable repository to your server.

You should get the following output:

Add XWiki repository

In order for apt to use the newly added repositories, it is necessary to update its cache with:

sudo apt-get update -y

At this stage Xwiki is available in your Ubuntu 20.04 repositories, you can find the available packages with the following command:

sudo apt-cache search xwiki

A list of packages will appear, allowing you to select which package you would like to install.

Install Xwiki

XWiki requires an external servlet container such as Apache Tomcat to run on Ubuntu 20.04. In this guide we will install xwiki-platform package with tomcat 9 and MariaDB as a database server:

sudo apt install xwiki-tomcat9-common xwiki-tomcat9-mariadb -y

As a part of the installation process, you will be required to set up a XWiki database, as shown below. Select yes and hit Enter to start the database creation process.

Install Tomcat

Set your desired password, select Ok and press Enter when prompted to finish setting the password for the XWiki database as shown below. Be sure to confirm it afterward.

Install MariaDB

When the installation is complete, you can verify the Tomcat service by using the following command:

sudo systemctl status tomcat9.service

You should see the following output:

Check Tomcat service state

As you can see, the tomcat service is active and running.

Typically, Tomcat listens on port 8080. You can check if it’s listening on port 8080 by using the following command:

ss -antpl | grep 8080

You should see the following output:

Tomcat listens on port 8080

Configure Nginx for XWiki

This part will show you how to configure Nginx for XWiki. Nginx is a very popular and powerful web server. It can be used to serve static content, and proxy requests and handle authentication easily, among other things.

For Nginx to communicate with the XWiki tomcat application, you will need to configure it accordingly.

To install the Nginx web server, type the following command at a terminal prompt:

sudo apt-get install nginx -y

Install Nginx

After installing the web server, create a new Nginx configuration file with the following command called xwiki.conf. xwiki.conf is a configuration file that must be updated with your own settings, and it will be saved in the etc folder.

sudo nano /etc/nginx/sites-available/xwiki.conf

You should see an empty file open up in front of your screen, ready for editing.

Populate the file with the following content:

server {
  listen 80;
  access_log /var/log/nginx/xwiki-access.log;
  error_log /var/log/nginx/xwiki-error.log;

  location / {
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header Host $host;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection ‘upgrade’;
    proxy_cache_bypass $http_upgrade;

Save the file once you are done then activate the new Nginx configuration by using the following command:

sudo ln -s /etc/nginx/sites-available/xwiki.conf /etc/nginx/sites-enabled/

Restart Nginx for your changes to take effect with the following command: \

sudo systemctl restart nginx

Access XWiki Web UI

Now that you have XWiki installed and configured, it’s time to access the web interface. To do so , type in your server IP address or domain name followed by /xwiki. For example:

  • http://server-ip-address/xwiki

You should see a welcome screen as shown.


Click the Continue button. You should see the admin user creation page.

Now you will need to create your first XWiki user account by filling out all of the relevant information as shown below:

Create admin user

Provide your username and password and email then click the Register and Login button. You will be taken to the page below:

Next step

Click on the Continue button. You should see the following page. Choose the flavor you would like to use and click the Install this flavor button as shown.

Choose install flavor

After the installation is complete, you should see the following page:

Standard Flavor

To apply the settings, click on the Continue button. After you’ve completed installation, you’ll see the following page that shows the default XWiki folders. Continue to finalize installation by clicking Continue.

Installation finished successfully

Finally, you should see the XWiki default dashboard as shown:

XWiki dashboard


In this guide, you have learned how to install Xwiki on Ubuntu 20.04 and configure Nginx for it as well. We hope that this guide was helpful to you.

For more information on XWiki, please visit the official website