Getting started with OpenShift and WildFly

This tutorial will show how to deploy an application on Openshift Platform-as-a-Service (PaaS) cloud hosting using WildFly 8.1.0 cartridge.  

OpenShift Express enables you to create, deploy, and manage applications within the cloud. It provides disk space, CPU resources, memory, network connectivity, and an Apache or JBoss server. Depending on the type of application you are building, you also have access to a template filesystem layout for that type (for example, PHP, WSGI, and Rack/Rails). OpenShift Express also generates a limited DNS for you.

The first thing needed to get started with OpenShift Express is an account, which can be obtained with a very simple registration procedure at:

Once you've registered and confirmed your e-mail, the next step will be installing on your Linux distribution the client tools needed to deploy and manage your applications in the cloud.  

Installing OpenShift client tools

For this purpose, we suggest you use either Fedora 14 (or higher) or Red Hat Enterprise 6 (or higher).

Then you need to grab a copy of the openshift.repo file, which contains the base URL of rpm files and keys necessary to validate them. This file should be available at: . Now, copy this file into the /etc/yum.repos.d/ filesystem using either sudo or root access privileges:

$ sudo mv openshift.repo /etc/yum.repos.d/

And then install the client tools:

$ sudo yum install rhc

Creating a Domain of applications

Once that you have registered, you need to create a domain which is a namespace where your applications will be deployed. This can be done from the Openshift console settings ( so move there and choose a domain name for your applications. In the following picture we have chosen “wildflyapps” as domain name:

openshift tutorial jboss wildfly

Once created the domain, we will create an application. Move to the “applications” menu ( and choose to add a new application. Pickup an application which is based on WildFly 8 cartridge. For example we will be adding an application named "primedemo" where we are going to deploy our HelloWorld Primefaces demo.

openshift tutorial wildfly

In a couple of minutes your application will be created and listed in the Applications panel. Once created your app, a management username and password have been created for you. You can use them to log into the management tools and deploy your application within our primedemo cartridge.

openshift tutorial jboss wildfly openshift

For example, if you want to access the Web console type as suggested in your shell:

$ rhc port-forward primedemo
Checking available ports ... done
Forwarding ports ...

To connect to a service running on OpenShift, use the Local address

Service Local OpenShift
------- -------------- ---- ----------------
java =>
java =>

Press CTRL-C to terminate port forwarding

So, as suggested log with your browser to
Enter the username/password that have been provided to you and here is your Openshift remote console:
openshift tutorial jboss wildfly
select the Runtime upper tab and from there choose Manage Deployments. Add your application and, when finished, enable them:
openshift tutorial wildfly
Now test your Primefaces application on the cloud:

openshift tutorial wildfly

Et voilà! a Primefaces application running on your cloud space! Enjoy it!

Follow us on Twitter