Getting Started with OpenShift Online

Java Developers Studio
JBoss DevStudio

From a web browser

OpenShift's web console gives you the power to create and manage your apps without installing anything or going to the command line. The console guides you through each application creation and suggests additional capabilities to complement it. Examples include, MongoDB, MySQL, or Jenkins continuous integration builds.

  1. 1Sign up for an account

    Every OpenShift account lets you create up to three applications for free and see the benefits of running those apps in the cloud. Try it out today.

  2. 2Open the Console and Create an Application

    The console makes it easy to create an application to code to while also creating applications that are up and running instantly. Deploy a powerful content management system like Drupal or the industry standard blogging platform, WordPress, at the click of a button. See all of our QuickStarts.

    Create your first application

    screenshot
  3. 3Install Git and start coding (optional)

    When you're ready to start making changes to source code, you can use the Git version control program to check in and publish your code directly to OpenShift. The client tools installation page has detailed information about installing Git on different platforms, and many popular development environments like Eclipse and Visual Studio have deep integration with Git.

    To download and upload source code, you must provide OpenShift with your public SSH key. After setting that key in the console (just a copy and paste) your application's Git URL appears. Pass that URL to the Git clone command which creates a local copy of the source code repo for you.

    git clone ssh://...rhcloud.com/~/git/myapp.git/
    
  4. 4Upload your changes to OpenShift

    Now that you've got the code, make a change and push those changes back to OpenShift

    Check your application URL - your changes are now live.

    Learn more about deploying changes to your application

    $ cd myapp
    $ vim php/index.php
    (Make a change...  :wq)
    $ git commit -a -m "My first change"
    $ git push
    

From the command line

Try out our powerful command line client by following the simple steps below.

The OpenShift client tools are packaged as a Ruby Gem. To run the tools on your platform, you'll need Ruby 1.8.7 or newer, the ability to install a gem (on Linux this requires root access), and the Git version control tool. Detailed help installing the client tools is available in the Developer Center.

  1. 1Sign up for an account

    Every OpenShift accounts lets you create up to three applications for free and see the benefits of running those apps in the cloud. Try it out today.

  2. 2Install the client tools on:

    Fedora and Red Hat Enterprise Linux

    Install the OpenShift prerequisites via YUM

    $ sudo yum install rubygems git
    

    (RHEL 6.2 only) If you are using RHN Classic, you may need to add the RHEL 6.2 Optional Channel in order to install the 'rubygems' package.

    $ sudo rhn-channel --add --channel=rhel-x86_64-server-optional-6
    

    Install the gem:

    $ sudo gem install rhc
    

    Other Linuxes

    Install the required packages: Ruby 1.8.7 or newer, rubygems, and git

    Install the gem:

    $ sudo gem install rhc
    

    Windows

    Download and install RubyInstaller 1.9 for Windows. Important! Make sure to check the option "Add Ruby executables to your PATH".

    Download and install Git for Windows. Important! Make sure to check the option "Run Git from the Windows Command Prompt".

    From the Windows Command Prompt install the gem:

    $ gem install rhc
    

    Mac

    On OS X, you'll need to install either the Full Xcode Suite – or – git for OS X. These packages ensure that Ruby and Git are installed and configured.

    Install the gem:

    $ sudo gem install rhc
    

    To update to the latest version of the client tools, use the gem update command:

    $ gem update rhc
    

    Read the client installation guide for more help

  3. 3Setup your environment

    Using your OpenShift login and password, run rhc setup to connect to OpenShift and create a unique namespace for your applications.

    The wizard will help you upload your SSH keys so you can communicate with Git, check to see if you are missing any required configuration, and then help you create a domain name. On OpenShift, domain names make up part of your app's url. They are also unique across all OpenShift users so choose wisely and be creative!

    When the wizard runs it creates a configuration file in <your home directory>/.openshift/express.conf which includes your login id. If you ever need to set your machine up a second time, just run rhc setup again.

    $ rhc setup
    
    Starting Interactive Setup for OpenShift's command line interface
    
    We'll help get you setup with just a couple of questions.
    
    To connect to openshift.redhat.com enter your OpenShift login (email or Red Hat login id):
    
  4. 4Create your first application

    Now you can create an application.

    This creates a remote git repository for your application and clones it locally to your current directory.

    OpenShift offers many application stacks. Run rhc cartridge list to see all of your options.

    Your application's domain name will be <your app name>-<your namespace>.rhcloud.com. So, the application created by the example commands would be located at myapp-mydomain.rhcloud.com

    $ rhc app create myapp php-5.3
    Password: (Enter your account password)
    
  5. 5Make a change, publish

    Getting an application running is only the first step. Now you are on the road to making it your own. Here's an example for the php framework.

    Use whichever IDE or editor works best for you. Chances are, it'll have git support. Even if it doesn't, you're just two simple commands away from glory!

    Now, check your URL - your change will be live.

    Check out our QuickStarts for deploying popular frameworks

    $ cd myapp
    $ vim php/index.php
    (Make a change...  :wq)
    $ git commit -a -m "My first change"
    $ git push
    
  6. 6Next steps

    Now that we have you started, there's lots of different things you can do with OpenShift. Check out the following pages for videos, blogs, and tutorials:

JBoss Developer Studio IDE

JBoss Developer Studio, with its Eclipse Based integrated development environment, gives developers everything they need to build rich web applications and transactional enterprise applications. It integrates with the OpenShift platform to put the ability to create, edit, and deploy applications right at your fingertips.

  1. 1Sign up for an account

    Every OpenShift accounts lets you create up to three applications for free and see the benefits of running those apps in the cloud. Try it out today.

  2. 2Download JBoss Developer Studio (sign-in required)

Documents

Videos