Introduction to redhat OpenShift

This is just an introduction to how to to Work with open shift through command line.

First of all, OpenShift is Red Hat’s free, auto-scaling Platform as a Service (PaaS) for applications. As an application platform in the cloud, OpenShift manages the stack so you can focus on your code. The backend of openshift is AWS, the great amazon cloud.

At first create an account at

Then install rhc client on your system. Documentation  is available [here](

For [Redhat Enterprise Linux](

For [Fedora](

For [Mac OS X](

For [Ubuntu, Debian and other Linux systems](

As Ubuntu used by almost all linux geeks around the world, Let me give you the installation steps for ubuntu here.

You  must have a sudo / root access of your ubuntu system.

Open a Terminal, and install the pre-requirement packages via apt.

sudo apt-get install git-core ruby1.9.1 rubygems

Now install the rhc client via gem,

sudo gem install rhc

As redhat says,
*–On Ubuntu and other Debian-based distributions, the OpenShift client tools by default are stored in the /var/lib/gems/1.8/bin directory. You must change to that directory and append ./ to each command when running the client tools.–*

But, You can getride of it by creating simlinks.

cd /usr/local/bin/ sudo ln -nfs /var/lib/gems/1.8/bin/* .

Thats it, Now you can call “rhc” commands from anywhere in the terminal.

**Setup your account**
Setup ssh public key authentcation.:- SSH key is used to provide the git access and SSH server access.

Name space :- Your namespace is unique to your account and is the suffix of the public URLs openshift will assign to your applications. See the User Guide for information about adding your own domain names to an application. You must create a domain/namsapce before you can create an application.  The syntax for the application name is ApplicationName–

So your Application URL will be or

Lets set the namespace as ‘jobnix’.

From Terminal

rhc domain create -n jobnix -l rhlogin Password:

If prompted, create an appropriate SSH key. Ok now your account has been setup, Lets  create an application,

**Create your first application**

mkdir ~/rhcloud cd ~/rhcloud rhc app create -a test1 -t php-5.3 -l rhlogin Password:

This will create a remote git repository for your application, and clone it locally in your current directory.

OpenShift offers many application stacks. Run *rhc app create -h* to see all of your options.

Your application’s domain name will be So, the application created by the example commands would be located at

Here is my Output

Creating application: test1 in jobnix Now your new domain name is being propagated worldwide (this might take a minute)… retry # 4 – Waiting for DNS: Warning: Permanently added ‘,’ (RSA) to the list of known hosts. Confirming application ‘test1’ is available: Success! test1 published: git url: ssh://07a1061d….cc…[email protected]/~/git/test1.git/ Successfully created application: test1

Now my application URL is It will give a openshift blank page since i didnt pushed anything to the repo.

So lets push my code. From terminal,

cd ~/rhcloud/test1 cd php rm *.php echo “JobNix Test1″>index.php git commit -a -m “First commit” git push

Now i can see my web page at and

Cool… Please comment if any doubts ![:)](


0 0 votes
Article Rating
Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x
Scroll to Top