OpenShift is a platform similar to Heroku that allows developers to easily create application hosting environments with a few clicks or commands. In this post I’ll be running through setting up a basic WordPress site on a free OpenShift application “gear”.
Create a free OpenShift account, verify your email and accept the terms. You’ll now be on the OpenShift Web Console’s welcome page.
Click “Create your first application now” and choose WordPress from the OpenShift-maintained starter applications.
In the “Public URL” section choose your application name (e.g.
staging) and namespace (e.g.
- Note that the “Source Code” section includes a URL to OpenShift’s WordPress starter application. This will be the base code for your application and is ready to deploy to OpenShift.
Leave the remaining options as their defaults and click “Create Application”. This will create your hosting environment “gear” and deploy the starter application code to it. Your application should now be accessible at
Managing the Code
Your application’s code is managed in a git repository on OpenShift’s servers. To gain access to push and pull changes you’ll need to add your computer’s public SSH key to your OpenShift account. A good way to achieve this is by setting up the OpenShift Client Tools, and then we can clone the application to your computer.
- Follow the instructions to install the OpenShift Client Tools for your operating system.
- Follow the instructions to sign in to OpenShift from the client tools for the first time. This process will add your computer’s public key to your OpenShift account, creating one if necessary.
You now have access to pull a copy of your application’s git repository to your local machine. On the application’s overview page in your OpenShift Web Console you should now see the URL to your application’s repository. Something like:
- Clone this repository to your local machine using git or add it as a remote if you’ve already got a repository (hosted on GitHub for e.g.) for your site’s code. Note that if you take this second approach you’ll need to merge in the code from your new OpenShift repository and update your existing site’s structure to match the WordPress starter application for it to deploy successfully to your OpenShift gear.
- You can now work on your website locally however you wish, a common approach is using MAMP to run WordPress on your machine which works well with a development workflow like WordPress Gulp. When you want to deploy changes simply push to your OpenShift repository and your changes will be deployed to the gear.