Configure Jetty

Last modified by Eleni Cojocariu on 2026/07/13 17:19

Steps

Warning

WIP

To install and configure Jetty as your servlet container for XWiki:

  1. Download a supported version of Jetty from the Jetty download page.
  2. Extract Jetty to a directory of your choice. The directory that directly contains start.jar is referred to as JETTY_HOME.
  3. Create a separate directory for your configuration and web applications, referred to as JETTY_BASE. This must be a different directory from JETTY_HOME - never modify files inside JETTY_HOME.
    mkdir /path/to/jetty-base
  4. Enable the deploy module matching your XWiki version and the http module. Open a terminal, navigate to JETTY_BASE, and run:

    java -jar <JETTY_HOME>/start.jar --add-modules=http,<deploy-module>

    Replace <deploy-module> with the correct module based on your XWiki version:

    • XWiki 17.x and above (jakarta): ee10-deploy
    • XWiki 16.x and below (javax): ee8-deploy

    This command creates JETTY_BASE/webapps/ and the necessary configuration files in JETTY_BASE/start.d/.

  5. Configure URI Compliance. Jetty 10.0.3+ forbids having encoded % characters (encoded as %25%) in URL paths, but XWiki uses them. Open JETTY_BASE/start.d/http.ini and add the line:
    jetty.httpConfig.uriCompliance=RFC3986
  6. Download the XWiki WAR file for the version you need.
  7. Extract or copy the XWiki WAR file into a directory named xwiki inside JETTY_BASE/webapps/.
  8. Create a directory to store XWiki's permanent data (attachments, configurations, extensions), e.g., /var/lib/xwiki/data. Use an absolute path outside of JETTY_BASE/webapps/.
  9. Open JETTY_BASE/webapps/xwiki/WEB-INF/xwiki.properties and set the permanent directory path:
    environment.permanentDirectory=/var/lib/xwiki/data
  10. Start Jetty from the JETTY_BASE directory:
    java -jar <JETTY_HOME>/start.jar
  11. Open a browser and navigate to:
    http://localhost:8080/xwiki/bin/view/Main/

FAQ

What if I want to use Jetty but don't want to configure anything?

You can install the standalone (demo) distribution that contains a zip package with the servlet container Jetty embedded.

Why do I need to enable the ee10-deploy module?

Jetty 12 doesn't include a webapps directory by default. You need to activate the deployment of WAR applications and create the webapps directory with the command.

How do I change the port used by Jetty?

Edit the file JETTY_BASE/start.d/http.ini. Search for 8080 and replace it with the port you want to use. Make sure the jetty.http.port property is uncommented:

jetty.http.port=9090

Do I need a database?

Yes, XWiki requires a database. For quick testing, you can copy the HSQLDB JAR into XWIKI_HOME/WEB-INF/lib. For production, configure an external database (such as PostgreSQL or MySQL).

More

To find more about the current topic, you can search or use the table below and filter the columns to narrow your choices.

Related

Get Connected