Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

How to use odo the developer-centric CLI with OpenShift 4

<p>&nbsp;</p> <quillbot-extension-portal></quillbot-extension-portal>

October 16, 2019
Daniel Helfand
Related topics:
Developer toolsKubernetes
Related products:
Red Hat OpenShift

    https://youtu.be/9QKTKjxgYsw 

    Working in a fast, iterative manner isn’t a practice exclusive to software developers: It’s the way people like to work. Being able to make a series of small changes and testing each change along the way to addressing a larger problem helps assure that the right choices are being made toward the end result.

    For developers working with OpenShift, the experience described above shouldn’t be any different. odo is a developer-centric CLI that helps developers implement, design and test source code with OpenShift faster. It’s one of a series of tools being released for general availability with the launch of OpenShift 4.2.

    With odo, the ability to work on local source code, make changes, and just as quickly push changes up to an OpenShift cluster is possible with this easy-to-use tool. If you’re familiar with git, the flow of using odo should be very familiar.

    By running a few CLI commands, you can push up local source code you are working on to OpenShift and have that source running on a container. Whenever you are ready to deploy code out to an OpenShift project, you can view several programming language options available with odo by running the command below:

    $ odo catalog list components
    
    odo Supported OpenShift Components:
    NAME       PROJECT     TAGS
    java       openshift   11,8,latest
    nodejs     openshift   10,8,8-RHOAR,latest
    
    
    
    OpenShift Components:
    
    NAME              PROJECT  TAGS
    dotnet            openshift 2.1,2.2,latest
    golang            openshift 1.11.5,latest
    httpd             openshift 2.4,latest
    modern-webapp     openshift 10.x,latest
    nginx             openshift 1.10,1.12,latest
    perl              openshift 5.24,5.26,latest
    php               openshift 7.0,7.1,7.2,latest
    python            openshift 2.7,3.6,latest
    ruby              openshift 2.4,2.5,latest

    These language options correspond to what are called builder images, which are container image definitions that can be used to support application source code developed in a particular language. In addition to selecting a language itself, you will be able to choose a particular version of a language as well.

    To select a language, in the root of the source code directory you are working in locally, you can run the following command

    $ odo create <language> app

    The odo create command specifies that you are creating a local configuration that will be used to track how you want your code to be deployed out to OpenShift. <language> in the above command corresponds to the programming language your application is written in.app corresponds to the name of the application that will be deployed. While you can give the application a specific name, it is not mandatory and you can deploy your code without specifying a name.

    If you were deploying a Node.js application using odo, the odo command you would run would be similar to what is shown below:

    $ odo create nodejs app

    After running odo create, all that is needed to deploy your code out to OpenShift is to run the following command:

    $ odo push

    odo create is similar to the idea of a git init where you are initializing that a local directory has source code written in a particular language. Editing the source code locally after running odo create is similar to a git commit. When you are committing to a change, you haven’t actually pushed that change remotely to be available in a git repository yet. odo follows this same flow that gives you control of when source code is actually deployed out to OpenShift.

    When odo push completes, your source code will be running on a container out in your OpenShift project. After an initial deployment via odo push, odo has the ability to quickly change and redeploy source code to your OpenShift cluster.

    To alter an application component after a first odo push, you can simply change your source code locally and run odo push again. Upon completion of the command, your changes should be running on OpenShift.

    While running an additional odo push is easy enough to push code changes, you can further simplify your redeployment using odo watch. By running odo watch in the directory you are working in, your code changes will automatically pushed up to OpenShift each time you make a local change without running
    odo push again.

    Another exciting feature that is currently in tech preview as part of the odo GA release is the ability to debug source code that is deployed on OpenShift. odo has a command called odo debug that allows you to remotely debug your code. The benefits of using a debugger locally are great, but odo allows you to have those same capabilities for code that is running in the environment it will eventually be hosted in. Keep an eye out for developments around odo debug as it reaches a more mature state in future releases.

    In addition to working with source code changes, odo allows you to manage other aspects of your deployed source code, such as creating a url for the application, linking your deployed application component to other application components deployed on OpenShift, viewing logs of deployed applications, and many other features. odo helps you focus on the source code you are writing for applications rather than all the details of hosting that application component on OpenShift.

    odo is one of the many tools being built at Red Hat that reflects the way developers like to work. Developing directly against a development environment and knowing that the code you are working on runs on OpenShift from the start of your work to the end is what odo was created for.

    In addition to this blog post, I have put together a video that walks through the capabilities of odo and shows how to deploy an application out to OpenShift. You can find out how to install, get started, and submit feedback on odo in the odo GitHub repository. We have an interactive tutorial available that allows users to learn more about odo and use it to deploy and iterate on a sample application with OpenShift. You can also view some of our past blog posts and videos on adding support for a programming language with odo (blog, video) and using interactive mode with odo.

    We are excited to see all the creative ways that developers use odo, and, more importantly, see all the things you create with it.

    Learn more about application development with OpenShift at developers.redhat.com/openshift.

    Last updated: June 27, 2023

    Recent Posts

    • SQL Server HA on RHEL: Meet Pacemaker HA Agent v2 (tech preview)

    • Deploy with confidence: Continuous integration and continuous delivery for agentic AI

    • Every layer counts: Defense in depth for AI agents with Red Hat AI

    • Fun in the RUN instruction: Why container builds with distroless images can surprise you

    • Trusted software factory: Building trust in the agentic AI era

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Chat Support

    Please log in with your Red Hat account to access chat support.