How To Install XWiki on Ubuntu 20.04 LTS

Install XWiki on Ubuntu 20.04

In this tutorial, we will show you how to install XWiki on Ubuntu 20.04 LTS. For those of you who didn’t know, XWiki is a free and open-source, Java-based advanced wiki software platform. It runs on servlet containers like JBoss, Tomcat, Jetty, etc. It also uses a database such as MySQL or PostgreSQL to store its information.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you through the step-by-step installation of the XWiki on Ubuntu 20.04 (Focal Fossa). You can follow the same instructions for Ubuntu 18.04, 16.04, and any other Debian-based distribution like Linux Mint.

Install XWiki on Ubuntu 20.04 LTS Focal Fossa

Step 1. First, make sure that all your system packages are up-to-date by running the following apt commands in the terminal.

sudo apt update
sudo apt upgrade

Step 2. Installing XWiki on Ubuntu 20.04.

Now we import the GPG key with the command below:

wget -q "https://maven.xwiki.org/public.gpg" -O- | apt-key add -

Next, add the official XWiki repository:

sudo wget "https://maven.xwiki.org/stable/xwiki-stable.list" -P /etc/apt/sources.list.d/

Once done, check all available packages in this repository using the following command:

sudo apt update
sudo apt-cache search xwiki

In this guide, we will install XWiki with tomcat 9 and MariaDB as a database server:

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

After installing XWiki, you can verify the Tomcat service using the following command:

sudo systemctl status tomcat9.service

Step 3. Configure Nginx for XWiki.

You will need to install and configure Nginx as a reverse proxy to access the XWiki. First, install the Nginx webserver with the following command:

sudo apt install nginx

Once installed, create a new Nginx virtual host configuration file using the following command:

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

Add the following lines:

server {
 listen 80;

 server_name xwiki.idroot.us;

 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;
 proxy_pass         http://127.0.0.1:8080;
 }
 }

Save and close the configuration file. Next, activate the Nginx virtual host by running:

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

Next, edit the Nginx main configuration file and increase the hash_bucket size:

sudo nano /etc/nginx/nginx.conf

Add the following line below the HTTP section as shown:

server_names_hash_bucket_size 64;

Save and close the file then restart the Nginx service to apply the changes:

sudo systemctl restart nginx

Step 4. Accessing XWiki Web Interface.

XWiki will be available on HTTP port 8080 by default. Open your favorite browser and navigate to http://xwiki.domain.com:8080/xwiki or http://server-ip-address:8080/xwiki and complete the required steps to finish the installation.

Congratulations! You have successfully installed XWiki. Thanks for using this tutorial for installing the XWiki on Ubuntu 20.04 LTS Focal Fossa system. For additional help or useful information, we recommend you check the official XWiki website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!