How to deploy a Web application on the Root Context on WildFly?

WildFly users

To deploy an application on the ROOT Web context, firstly you have to remove the default Welcome application from undertow’s server:

    "outcome" => "success",
    "response-headers" => {
        "operation-requires-reload" => true,
        "process-state" => "reload-required"

Reload the server:


Next, if you can either set the ROOT Web context in your application’s jboss-web.xml:


As an alternative, you can set the default-web-module of your undertow host as follows:

/subsystem=undertow/server=default-server/host=default-host:write-attribute(name=default-web-module, value=helloworld.war)

You can also specify as default web module a Web application that is packaged as module in an EAR file:

<host name="default-host" alias="localhost" default-web-module="App.ear.demoroot.war">
    <location name="/" handler="welcome-content"/>
    <filter-ref name="server-header"/>
    <filter-ref name="x-powered-by-header"/>

JBoss AS 7 / EAP 6 Users

At first you need to set in your standalone/domain configuration file the enable-welcome-root parameter to false (by default it’s true) for the web subsystem. The enable-welcome-root controls whether or not to deploy JBoss’ welcome-content application at root context.

<subsystem xmlns="urn:jboss:domain:web:1.0" default-virtual-server="default-host">
    <connector name="http" protocol="HTTP/1.1" socket-binding="http" scheme="http"/>
    <virtual-server name="default-host" enable-welcome-root="false">


Next, you need telling to the Web server to deploy your application on the Root context. For Web applications the standard Web context can be overriden using the jboss-web.xml file descriptor:

<?xml version="1.0" encoding="UTF-8"?>
<jboss-web xmlns=""

If you are using an Enterprise Application Archive then you can set the Web application context in your application.xml using the <context-root>element of the <web> module as follows:

<application version="5" xmlns=""