Skip to content

Create a Custom RStudio Lab

Intermediate 15 minutes Auto-generated screenshots

Overview

In this tutorial, you'll create a custom RStudio Lab on the RosettaHub Supercloud platform. RStudio Labs are Docker-based formations (Docker Labs) that provide a browser-accessible RStudio environment. You'll learn how to create an object storage for your data, configure working and reference volumes, launch and customize the lab, snapshot it, and share it with others.

RStudio Labs use two types of volumes: a Working Volume (the default scratch directory) and a Reference Volume (for read-access to uploaded datasets and files). Understanding this distinction is important for organizing your data effectively.

Prerequisites

  • [ ] RosettaHub account with active subscription
  • [ ] At least one cloud account connected (see Cloud Keys)
  • [ ] Access to the RStudio public Docker Lab formation
  • [ ] R scripts or datasets to upload (optional)

Steps

Step 1: Open the Container Apps Perspective

From the RosettaHub dashboard, select the Container Apps perspective. This displays the Docker Labs view where container-based formations are listed.


Step 2: Create an Object Storage

In the Object Storages view, create a new storage to hold your reference data.

  1. Right-click in the Object Storages panel
  2. Select Create
  3. Name the storage My-New-Storage
  4. Click OK

See Object Storages Guide for more details on storage management.


Step 3: Upload Files to Your Storage

Click on the newly created My-New-Storage entry. The Amazon console opens, showing your S3 bucket.

  1. Click Upload in the S3 console
  2. Drag and drop your R scripts, datasets (CSV, RDS, etc.), or other files
  3. Click Upload to confirm

Note

The console-based upload is available for S3 (AWS) storage. For Azure Blob or GCP Storage, use the respective cloud provider consoles or CLI tools.


Step 4: Clone the RStudio Formation

In the Docker Labs view, locate the RStudio formation.

  1. Right-click RStudio
  2. Select Clone
  3. Name the new formation My-RStudio

Step 5: Configure Volumes

Attach your object storage to the formation. RStudio uses two volume types:

  1. Right-click the My-RStudio formation
  2. Select Configure
  3. Navigate to the Volumes tab
  4. Set Working Volume to Default (RStudio's scratch/output directory)
  5. Set Reference Volume to My-New-Storage (your uploaded data files)
  6. Click Save
Volume Type Purpose Contents
Working Volume Default working directory for RStudio Output files, generated plots, intermediate results
Reference Volume Read-access data directory Uploaded datasets, scripts, shared reference files

Tip

The Reference Volume is where your uploaded files appear. The Working Volume is the default directory where RStudio saves new files. Both persist independently of the machine image.


Step 6: Launch Your RStudio Lab

Click on My-RStudio to launch it. Click Yes in the confirmation dialog.

Your session appears under the Sessions panel. Wait 2-3 minutes for the session to show a green tick, indicating it is ready.

Click the session to connect. RStudio opens in a new browser tab.

To navigate to your uploaded files in RStudio:

  1. In the Files pane (bottom-right), click More
  2. Select Go to Working Directory
  3. Your uploaded files from the Reference Volume are accessible from here

Step 6.1: Install R Packages

Install any additional R packages you need. For example, install the data.table package:

In the RStudio console, run:

install.packages("data.table")

You can also install packages from the Packages pane or use devtools::install_github() for packages from GitHub.

Note

Packages installed in RStudio are stored in the container filesystem. To preserve them across sessions, you must create a machine image (Step 7).


Step 7: Create a Machine Image

After installing packages or making other environment customizations, snapshot your session to preserve them.

  1. Return to the RosettaHub dashboard
  2. Right-click your running session in the Sessions panel
  3. Select Create Machine Image
  4. Keep Update Originator Formation On Success checked

RosettaHub will:

  • Snapshot the session with all newly installed R packages into a new machine image
  • The image appears under the Images panel (see Images Guide)
  • Automatically update the My-RStudio formation to use the new image

Tip

Data files in the working and reference volumes are automatically persisted to their respective object storages. You only need to snapshot when you install new packages or change system-level configuration.


Step 8: Share Your Lab

Share your customized RStudio Lab with others:

  1. Right-click the My-RStudio formation
  2. Select Share
  3. Choose to share with a specific user, your organization, or a group

When recipients launch the shared formation, they get an identical RStudio environment with all your installed R packages.


Key Concepts

Concept Description
Docker Lab A container-based formation running a web application (Jupyter, RStudio, etc.)
Working Volume Object storage mounted as the default working directory
Reference Volume Object storage mounted as a read-access data directory
Machine Image A snapshot of the container with installed packages and system changes
  • Volume files persist in object storage -- they survive machine deletion and image updates
  • Machine image changes (installed packages, system configuration) require a snapshot to persist
  • RStudio Labs use two volumes (Working + Reference), unlike Jupyter Labs which use a single Working Volume

Next Steps

Troubleshooting

Cannot find uploaded files in RStudio

Ensure that:

  • You configured My-New-Storage as the Reference Volume (not the Working Volume) in Step 5
  • You uploaded files to the correct S3 bucket in Step 3
  • The session was launched after configuring the volumes
  • In RStudio, click More > Go to Working Directory to navigate to the correct location

If you changed volume configuration after launching, shut down and relaunch the session.

Installed R packages are missing after relaunch

R packages installed in the console are stored in the container filesystem, not the volumes. To preserve them:

  1. Install all needed packages
  2. Use Create Machine Image (Step 7) to snapshot the session
  3. Ensure Update Originator Formation On Success is checked

Future launches will include the installed packages.

Session takes too long to start

Docker Lab sessions typically start within 2-3 minutes. If it takes longer:

  • Check your cloud account status and quotas
  • Verify your budget allocation has not been exceeded
  • Try a different cloud region
RStudio shows an error on startup

If RStudio fails to load properly:

  • Wait a moment and refresh the browser tab
  • Check that the session status is green (fully ready)
  • Clear your browser cache if the interface appears broken
  • If the issue persists, shut down the session and relaunch