AeroGear Unified Push and OpenShift Origin

Posted By Hoyt Summers Pittman


For people who are making mobile applications, managing the various server components and technologies is a challenge.
This post will demonstrate how to use OpenShift Origin to host an instance of Aerogear Unified Push Server and then start development on an Android application on your development machine.
AeroGear Unified Push Server is a project that provides a single service to manage multiple push networks for your mobile applications. OpenShift Origin is a container management platform build on Kubernetes and Docker technologies. Both are Open Source and sponsored by RedHat.

Getting and Starting OpenShift Origin


Before you can use Origin you need to have Docker installed on your computer as well as configure its to use OpenShift’s internal Docker registry. You can do this by passing the following parameter to Docker when the service starts --insecure-registry System specific details can be found here.

You will also need the tool oc. It can be found on the Origin’s GitHub releases page.

Launching OpenShift Origin

oc cluster up.

Yup that is all you need. Now you can browse to and login as developer:developer.

Deploying AeroGear UPS

We will use the Unified Push Server image found on Docker Hub. Reviewing that page we see that it needs two MySQL instances named “unifiedpush” and “keycloak”. We can create those in Origin, deploy UnifiedPush, and then add a route for our Android emulator.

Deploying MySQL containers

oc new-app mysql MYSQL_USER=unifiedpush MYSQL_PASSWORD=unifiedpush MYSQL_DATABASE=keycloak --name=keycloak

oc new-app mysql MYSQL_USER=unifiedpush MYSQL_PASSWORD=unifiedpush MYSQL_DATABASE=unifiedpush --name=unifiedpush

You can watch both systems come online in your console, or view their status with oc status.

Deploying AeroGear UnifiedPush

oc new-app aerogear/unifiedpush-wildfly \
 UNIFIEDPUSH_PORT_3306_TCP_ADDR=unifiedpush \
 KEYCLOAK_PORT_3306_TCP_ADDR=keycloak \

This command will deploy UnifiedPush and connect it to your MySQL containers. If you are work with Docker then the environment variables we use should be familiar; that is because this is a plain Docker container.

Adding Routes to the UnifiedPush application

By default OpenShift applications are not routable. This means that we can not point a web browser to UnifiedPush to configure it nor can an Android device connect to it to receive push messages. We will add two routes to enable both of these behaviors.

oc expose service unifiedpush-wildfly --port=8080-tcp --name=ups-local-unsecured
oc expose service unifiedpush-wildfly --port=8080-tcp --name=ups-android-unsecured

The first route exposes UPS on the local machine’s IP address, and the second exposes on which is the hardcoded IP address for the host of an Android emulator. These hostnames use to fake the DNS lookup.

Fixing Keycloak Linking

UPS uses an embedded Keycloak server to handle its authentication. Right now there is an issue when the UPS pod starts up it can’t route to Keycloak using the public route. To work around this you will need to use the OpenShift web console to navigate to the unifiedpush-wildfly pod and execute “wget http://localhost:8080/ag-push/index.html” in the terminal after the application loads.

Configuring UnifiedPush

You should be able to navigate to now and set up UnifiedPush. The full instructions for configuring this can be found on

Configuring you Android Push Application

You can follow the HelloPush tutorial here. The only change is you will use “” as your push URL.

Apr 4th, 2017

No Comments! Be The First!

Leave a Reply