Skip navigation

The Viking Developer

June 2013 Previous month Next month

At the time of writing this post, a WildFly cartridge is not available on OpenShift. However, it's relatively simple to get it running using the DIY cartridge.

If you don't already have an OpenShift account go to and create one now.

Create a new application

First step to doing this is to create a new application on OpenShift using the DIY cartridge. This can either be done through the web console or using the rhc command line tool.

To create the application using the web interface open and select add application. Select the Do-It-Yourself cartridge. Insert a name for the application and click on Create Application. On the next page follow the instructions to clone the Git repository for the application.

Install WildFly

Download WildFly from and extract it into the directory where you cloned the applications Git repository.

To make WildFly run on OpenShift you'll need to do a few minor configuration changes. Open the wildfly-8.0.0.Alpha1/standalone/configuration/standalone.xml in your favourite text editor.

First thing to do is to set the interfaces to use loopback addresses. Search for <interfaces> and replace inet-address with loopback-address. The result should be:


   <interface name="management">  
     <loopback-address value="${}"></loopback-address>  
   <interface name="public">  
     <loopback-address value="${jboss.bind.address:}"></loopback-address>  
   <interface name="unsecure">  
     <loopback-address value="${jboss.bind.address.unsecure:}">  


Next, if your application is using the example datasource you may want to configure this to be persisted. Search for <datasources> for the ExampleDS datasource entry replace the value of the connection-url with:




Finally, the timeout for a deployment is set to 60 seconds by default, and if you're using the free gear this may cause deployments to fail. To increase the deployment timeout search for deployment-scanner and set the deployment-timeout attribute. For 300 seconds timeout it would be:


<deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000" deployment-timeout="300"/>


Edit start and stop scripts

Open .openshift/action_hooks/start in a text editor and replace the contents with:



ln -s $OPENSHIFT_DATA_DIR $OPENSHIFT_REPO_DIR/wildfly-8.0.0.Alpha1/standalone/data

cd $OPENSHIFT_REPO_DIR/wildfly-8.0.0.Alpha1
nohup bin/ -b $OPENSHIFT_DIY_IP -bmanagement=$OPENSHIFT_DIY_IP > $OPENSHIFT_DIY_DIR/logs/server.log 2>&1 &


Then open .openshift/action_hooks/stop and replace the contents with:



jps | grep jboss-modules.jar | cut -d ' ' -f 1 | xargs kill

exit 0


Push changes to Openshift

Now it's time to commit and push the changes to OpenShift. Run:


git commit -m "Added WildFly" -a
git push


Once the data has been sent to OpenShift the application will be restarted and you should have a running instance of WildFly on OpenShift. To deploy your applications to the WildFly instance simply copy them to standalone/deployments and use git commit/push to upload to OpenShift.