Red Hat Container Development Kit

Red Hat Container Development Kit

Thank you for downloading

Your download should start automatically. If you have any problems with the download, please use the direct link.

Hello World!

1. Download and Prerequisites

Note: If you are on Windows or macOS the easiest way to install Red Hat Container Development Kit is to use the Red Hat Development Suite installer. The installer lets you choose to install CDK, Red Hat Developer Studio IDE with container tooling, Red Hat JBoss Enterprise Application Platform, Red Hat JBoss Fuse integration, and other developer tools.

Download Red Hat Container Development Kit (CDK) for your OS from the list below.  Please see the prerequisites for running CDK below.

Prerequisites for running CDK

The prerequisites for running CDK are:

  • A Red Hat Developer Program username and password are required to download CDK and to enable the Red Hat Enterprise Linux VM included with the CDK to download container images from Red Hat.  Please make sure to accept the terms and conditions.
  • A virtualization platform (hypervisor) for your OS such as VirtualBox, Hyper-V, Xhyve, or KVM.
  • Docker-machine drivers for your hypervisor.
  • 5+ GB of free disk space.


CDK includes a prebuilt Red Hat Enterprise Linux virtual machine with OpenShift and other container tools pre-installed. To run the VM a hypervisor is required. Please install one of the following hypervisors for your OS.  See the notes below for docker-machine drivers and additional hypervisor specific information.

Hypervisors supported by CDK
OS Default Hypervisor Alternate Hypervisor
Windows Hyper-V VirtualBox
macOS Xhyve VirtualBox
Linux KVM VirtualBox

Hypervisor Notes


CDK supports VirtualBox 5.1.14 and later on all platforms. CDK includes the docker-machine drivers for VirtualBox, so no additional downloads are required.

Since VirtualBox is not the defualt hypervisor, you will either need to pass the command line --vm-driver virtualbox to the minishift start command or make a permanent configuration setting:

$ minishift config set vm-driver virtualbox

Verify the configuration setting with:

$ minishift config get vm-driver

Minishift persistent configuration is stored in .minishift which is located in your home directory. If you delete ~/.minishift you will need to run the command to set the persistent setting again. See Persistent Configuration in the CDK Getting Started Guide for more information.


Hyper-V is the default virtualization on Windows, but must be enabled as a Windows optional feature. No additional docker-machine driver download is required for Hyper-V.

In Hyper-V, you must create an external virtual network switch and attach it to your physical NIC (wired or wireless, which ever is connected) to enable internet access for downloading container images.  You must set an environment variable HYPERV_VIRTUAL_SWITCH with the name of the virtual switch.

For cmd.exe:

c:\> set HYPERV_VIRTUAL_SWITCH=External (Wireless)

Verify the setting:



Note: for cmd.exe don't use quotes as they will become part of the value of the variable.

For PowerShell:

PS C:\> $env:HYPERV_VIRTUAL_SWITCH="External (Wireless)"

Verify the setting:


For additional information see Set up hypervisor on Windows in the CDK Getting Started Guide.  


Xhyve is the default hypervisor on macOS.  You will need to install docker-machine drivers for Xhyve. See Set up hypervisor on macOS in the CDK Getting Started Guide for installation details.


KVM is the default hypervisor on Linux. You will need to install docker-machine-kvm drivers. See Set up hypervisor on Red Hat Enterprise Linux in the CDK Getting Started Guide for installation details.

Notes for Windows users

Windows shells and environment variables

You can run CDK using cmd.exe or PowerShell. Working with CDK and minishift requires setting a number of environment variables. You may encounter CDK information that shows the syntax for the bash shell, as that syntax can be used with Linux or macOS. The syntax for setting environment variables is different for cmd.exe and PowerShell. There are also some differences in the quoting that is required for arguments that include spaces or special characters. If you run into problems, check that you’ve correctly set any required environment variables, Verify that any variables contain the expected valves with set (for cmd.exe) or Get-ChildItem ENV: for PowerShell.

User's home directory

CDK will store state and configuration in the .minishift sub-directory of the user’s home directory. On Windows, the path will be %USERPROFILE%/.minishift, which is typically in C:\user\username\.minishift. You may encounter CDK information that uses the bash shorthand ~/ to refer to the user’s home directory, for example ~/.minishift. The Windows equivalent for ~/ is %USERPROFILE%/.

2. Setup and run CDK/Minishift


The CDK download is a single executable which includes a number of bundled components. You will use the minishift command to start, stop, and configure the Red Hat Enterprise Linux VM and the Red Hat OpenShift single-node cluster running inside of the VM. To run minishift commands, you will need to add minishift to a directory that is in your command search path.

The oc command line tool which is used for interacting with OpenShift clusters will be downloaded when you run minishift setup-cdk. To use the oc CLI you will need to copy oc into a directory in your command search path, or add the minishift directory containing oc to your PATH environment variable.

The setup steps are:

  1. Copy minishift into a directory that is in your path
  2. Run minishift setup-cdk. to set up your CDK environment in ~/.minishift
  3. Copy the oc command into a directory that is in your path
  4. Add your Red Hat Developer Program credentials to your environment


Adding minishift to your path

The cdk-minishift file you downloaded in the first step is an executable. To run minishift commands, copy it to a directory in your path.

macOS and Linux

Copy minishift into ~/bin which is conventionally used for executables in your home directory. Open a Terminal session and run the following commands under your regular user ID:

$ mkdir -p ~/bin
$ cp ~/Downloads/cdk-3.3.0-1-minishift* ~/bin/minishift
$ chmod +x ~/bin/minishift

You can check if ~/bin is in your path with one of the following commands:

$ echo $PATH
$ which minishift

On macOS you may need to add ~/bin to your path.  Run the following commands to add it to your current and future login sessions:

$ echo ‘export PATH=$PATH:$HOME/bin’ >> ~/.bash_profile
$ export PATH=$PATH:$HOME/bin


Create the desired directory and copy the downloaded CDK binary to the directory, renaming the binary to minishift.exe. Add the directory path to the Windows PATH variable if it isn’t already there.

Note: the directory must be on your system (C:) drive.


Run setup-cdk

Run minishift setup-cdk to setup the components needed to run CDK on your system. By default, minishift setup-cdk places CDK content in your ~/.minishift directory (%USERPROFILE%/.minishift on Windows).

$ minishift setup-cdk
Setting up CDK 3 on host using '/home/user/.minishift' as Minishift's home directory
Copying minishift-rhel7.iso to '/home/user/.minishift/cache/iso/minishift-rhel7.iso'
Copying oc to '/home/user/.minishift/cache/oc/v3.7.14/linux/oc'
Creating configuration file '/home/user/.minishift/config/config.json'
Creating marker file '/home/user/.minishift/cdk'
Default add-ons anyuid, admin-user, xpaas, registry-route, che installed
Default add-ons anyuid, admin-user, xpaas enabled
CDK 3 setup complete.


Note: If you would like to use a different directory see the Environment Variables section of the CDK Getting Started Guide. 

Add oc to your path

The setup-cdk step downloaded the oc CLI utility into ~/.minishift. Copy the oc command into a directory that is in your path such as ~/bin. The oc command should be the same version as the OpenShift cluster that is running inside of the Red Hat VM, and may be different than shown in this guide. The location of the oc binary was shown when you ran minishift setup-cdk. After the CDK/minishift VM has been started you can also find the oc command’s location with minishift oc-env.

macOS or Linux

Run the following command, changing osname to linux or macos.

$ cp ~/.minishift/cache/oc/v3.7.14/<osname>/oc ~/bin



Copy the oc command from %USERPROFILE%/.minishift/cache/oc/v3.7.14/windows/oc.exe to a directory that is in your command search path. The destination should be the same directory where you copied minishift.exe in the step above.

Set Red Hat Developer Program username and password

The VM will need to register with Red Hat to download container images. Add your Red Hat Developer Program username and password to your environment to avoid the need to enter it each time you start minishift.  Run the following commands for your OS, substituting <RED_HAT_USERNAME>  and for your actual username and password.




$ echo export MINISHIFT_USERNAME=$MINISHIFT_USERNAME >> ~/.bash_profile
$ echo export MINISHIFT_PASSWORD=$MINISHIFT_PASSWORD >> ~/.bash_profile

Windows using cmd.exe


Windows using PowerShell


Note: to make these permanent under Windows, you will need to use the Control Panel to set environment variables for your user account.

Start CDK/Minishift

You are now ready to start CDK. The minishift start command will start a Red Hat Enterprise Linux VM with an OpenShift cluster running inside.

Note: By this point you should have your hypervisor configured as per the hypervisor prerequisites in step 1:

  • If you are using Xhyve or KVM, make sure you’ve installed the necessary docker machine drivers.
  • If you are using Hyper-V make sure you've created a virtual switch and set the HYPERV_VIRTUAL_SWITCH environment variable.
  • If you are using VirtualBox instead of the default hypervisor for your platform, configure minishift to use VirtualBox with minishift config set vm-driver virtualbox

Run minishift start

$ minishift start
-- Starting profile 'minishift'
-- Minishift VM will be configured with ...
   Memory:    4 GB
   vCPUs :    2
   Disk size: 20 GB
-- Starting Minishift VM .......................... OK
-- Registering machine using subscription-manager
   Registration in progress ..................... OK [42s]
Image pull complete
OpenShift server started.

The server is accessible via web console at:

You are logged in as:
    User:     developer

To login as administrator:
    oc login -u system:admin


After minishift start completes, make a note of:

  • The URL for the OpenShift cluder. Note: the IP address may change when you restart CDK.
  • The developer username.
  • The admin username and default password.

To check that everything is working and view the OpenShift console use the commend:

$ minishift console

Note: This will launch the URL listed above (example: with your default browser.  Note: you will likely get a security warning from the browser about the certificate being from an unknown certificate authority. This is expected. You will need to temporarily accept the certificate to proceed.  

Login to OpenShift using developer as the username.  Enter any text for the developer password.

Stopping CDK/minishift and the CDK life-cycle

You can stop the CDK/minishift VM with the command:

$ minishift stop

You can restart it again with:

$ minishift start

If necessary, you can delete the VM in order to get a fresh start with a clean VM using:

$ minishift delete
You won't need to run minishift setup-cdk again unless you delete the contents of ~/.minishift.


You can learn more in the CDK life-cycle section of the CDK Getting Started Guide. 


3. Build your first app


The following steps will guide you through creating your first project on your OpenShift cluster. The project is a sample Node.js application that will serve a welcome page and the current hit count which is started in a MongoDB database. Two pods will be created, one for the Node.js application and another for the database.

The source code for the project is available on GitHub: openshift/nodejs-ex.  The OpenShift catalog in CDK has a number of project templates available including this sample Node.js application. For this guide, we will use the template from the OpenShift catalog.  You will use the OpenShift web console to build and manage your application.

Note: This guide uses the OpenShift web console to build and manage your application.  Alternatively you could use the oc CLI to accomplish the same steps.   The following command would create the application pulling the source from GitHub:

$ oc new-app

For more information see Creating an Application using the CLI, in the Developer Guide section of the OpenShift documentation.

If you haven’t already started the CDK/minishift VM, run:

$ minishift start

Once the VM is up and running, launch the URL in the browser:

$ minishift console

Log into the OpenShift console with developer as the username and password.  A default empty project called My Project has been created for you.  Alternatively, you can use the create project button to create a new empty project at any time.

Create the application

Follow these steps to create, build, and deploy the application:

  1. After logging in you will see a page with the OpenShift catalog of application templates that have been preloaded into CDK.  
    CDK 3.3 OpenShift Catalog
  2. Click on the icon labeled Node.js + MongoDB.  Then, click Next to view the project configuration information.
  3. None of the defaults need to be changed, so click Create to create the application.  This will create the application and kick off a build. Click Close to dismiss the create dialog box.
  4. Go to your project overview page by clicking My Project from the list of projects on the right.
  5. The application will be automatically built and deployed. You might need to wait for the build to finish.

  6. When the application is finish building and deploying you should see two running pods.  Select Applications from the menu on the left. Then select Routes.
  7. The application template created a route to allow HTTP traffic to the Node.js application pod running inside the OpenShift cluster. Click on the URL in the Hostname column to view your application.

At this point, you’ve successfully built and deployed a Node.js and MongoDB application in containers running on OpenShift on your personal OpenShift cluster. Explore the menus to see the components that were created, view logs, and explore OpenShift.

Where to go next?



Build Something Today

Let's walk through everything you need to build your first application.

Download Get Started