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.
    • 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 integrate and use RStudio Server on OpenShift AI

June 6, 2024
Andriana Theodorakopoulou
Related topics:
Data scienceIntegrationIDEsOpen source
Related products:
Red Hat OpenShift AI

    RStudio Server is a powerful open source integrated development environment (IDE) that offers a graphical interface for the R programming language, significantly enhancing data analysis and visualization capabilities. With the rise of data-driven decision-making, having a robust tool like RStudio Server becomes crucial for data scientists and analysts. This guide will walk you through the process of setting up RStudio Server on Red Hat OpenShift AI and getting started with its extensive features.

    Setting Up RStudio Server on OpenShift AI

    The integration of RStudio Server with OpenShift AI provides a scalable and secure environment for data analysis.

    Here’s a step-by-step guide to get you started.

    1. Log in to the cluster. First, access your OpenShift cluster by logging in through the terminal. Ensure that you have installed the OpenShift CLI (oc) if you prefer using the terminal for this procedure; however, all these steps can also be accomplished through the OpenShift UI.

      $ oc login --token=<sha256~token> --server=<cluster API address>
    2. Create a secret for subscription manager credentials. To build the RStudio Server workbench, you must create a secret containing the subscription manager credentials. These are usually your Red Hat Customer Portal username and password. Guidance on acquiring these credentials for the subscription manager is detailed in the following article: How to use Subscription Manager on Red Hat Enterprise Linux. Additionally, you can refer to this Registration Assistant. 

      $ oc create secret generic rhel-subscription-secret --from-literal=USERNAME=<username> --from-literal=PASSWORD=<password> -n redhat-ods-applications

      The secret must be named rhel-subscription-secret, and its USERNAME and PASSWORD keys must be in capital letters.

    3. Build RStudio Server. Ensure your cluster has at least 1 CPU available for the RStudio server and 1.5 CPUs for the CUDA-enabled RStudio server. To start the build process, use the following command:

      a. To start the lightweight RStudio Server BuildConfig:

      $ oc start-build rstudio-server-rhel9 -n redhat-ods-applications --follow

      Alternatively, you can navigate to the Builds menu in the OpenShift UI, locate the rstudio-server-rhel9 flavor under BuildConfigs, and simply initiate the build process by clicking the Start Build button in the Actions drop-down, as shown in Figure 1.

      Figure 1: Illustrates the BuildConfig within the OpenShift console
      Figure 1: Illustrates the BuildConfig within the OpenShift console
      Figure 1: BuildConfig within the OpenShift console.

      b. Accordingly, to start the CUDA-enabled RStudio Server build, trigger the cuda-rhel9 BuildConfig:

      oc start-build cuda-rhel9 -n redhat-ods-applications --follow
     

    Note

    You don't need to manually trigger cuda-rstudio-rhel9 as it will be initiated automatically.

    1. Check the build status with:

      $ oc get builds -n redhat-ods-applications
      Expected output:
      NAME                     TYPE     FROM          STATUS     STARTED          DURATION
      rstudio-server-rhel9-1   Docker   Git@f7976fb   Complete   25 minutes ago   9m1s

      The build process should take approximately 7 minutes for RStudio Server and 25 minutes for the CUDA-enabled version.

    2. Label the ImageStreams. Once the build has been completed, it's necessary to apply opendatahub.io/notebook-image: 'true' label on the ImageStreams to enable the workbench in the OpenShift AI UI. 

      To apply the label, run the following commands on your terminal:

      $oc label imagestream rstudio-rhel9 opendatahub.io/notebook-image='true' -n redhat-ods-applications

      For CUDA-enabled version:

      $ oc label imagestream cuda-rstudio-rhel9 opendatahub.io/notebook-image='true' -n redhat-ods-applications

      Alternatively, you can always do the same through OpenShift UI, you will need to add this label to the labels section. See Figure 2.

    Figure 2: Assigning of opendatahub.io/notebook-image label within ImageStream
    Figure 2: Assigning of opendatahub.io/notebook-image label within ImageStream
    Figure 2: Assigning opendatahub.io/notebook-image label within ImageStream.
    1. Access the RStudio Server workbench. You can now access RStudio Server workbenches on Applications → Enabled menu in the Red Hat OpenShift AI dashboard. 

      Or, in the Data Science Projects → Workbenches → Create workbench → Notebook image → Image selection dropdown list.

    Getting started with RStudio Server

    With RStudio Server successfully set up, it’s time to dive into its features and how to use them effectively.

    Launch RStudio Server

    There are two methods to launch RStudio Server:

    1. Via Workbench Spawner Page: Navigate to Applications → Enabled, click on Launch next to the JupyterHub card, and select RStudio Server Workbench, as shown in Figure 3.
    Figure 3: Workbench Spawner page within OpenShift AI dashboard
    Figure 3: Workbench Spawner page within OpenShift AI dashboard
    Figure 3: Workbench Spawner page within OpenShift AI dashboard.
    1. Via Data Science Projects:Create data science project, select RStudio Server Workbench from the drop-down, and click Create Workbench, as shown in Figure 4. 

      Figure 4: View from Data Science Projects page within OpenShift AI dashboard
      Figure 4: View from Data Science Projects page within OpenShift AI dashboard
      Figure 4: View from Data Science Projects page within OpenShift AI dashboard.

    Figure 5 shows the RStudio Server interface that appears.

    Figure 5: RStudio Server IDE
    Figure 5: RStudio Server IDE
    Figure 5: RStudio Server IDE.

    Explore the RStudio interface

    RStudio Server provides a user-friendly interface that integrates text with code, similar to Jupyter notebooks. Key areas include:

    • Console: Execute R commands, install packages, and perform mathematical operations.
    • Environment: View variables and their values within the workspace.
    • Terminal, History, Files, Plots, Packages: Manage terminal commands, track operation history, navigate files, view plots, and manage packages.

    Perform data analysis

    • Write R scripts: Navigate to File → New File → R Script to create reusable and reproducible scripts.
    • Installing R packages: Use the install.packages("package_name") command in the console for package installation and library() to load them into the R environment.

    By following these instructions, you can effectively integrate and utilize RStudio Server within your OpenShift AI environment, unlocking a world of possibilities for data analysis and visualization. Whether you're conducting basic analyses or developing complex models, RStudio Server on OpenShift AI offers a robust, scalable platform to meet your data science needs! 

    Related Posts

    • Model training in Red Hat OpenShift AI

    • Red Hat OpenShift AI installation and setup

    • How to integrate Quarkus applications with OpenShift AI

    • Why GPUs are essential for AI and high-performance computing

    • Empower conversational AI at scale with KServe

    • Create an OpenShift AI environment with Snorkel

    Recent Posts

    • Confidential virtual machine storage attack scenarios

    • Introducing virtualization platform autopilot

    • Integrate zero trust workload identity manager with Red Hat OpenShift GitOps

    • Best Practice Configuration and Tuning for Linux and Windows VMs

    • Red Hat UBI 8 builders have been promoted to the Paketo Buildpacks organization

    What’s up next?

    Learn how to access a large language model using Node.js and LangChain.js. You’ll also explore LangChain.js APIs that simplify common requirements like retrieval-augmented generation (RAG).

    Start the activity
    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