Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Custom RStudio image specifications

Focus mode
Custom RStudio image specifications - Amazon SageMaker AI

In this guide, you'll learn custom RStudio image specifications to use when you bring your own image. There are two sets of requirements that you must satisfy with your custom RStudio image to use it with Amazon SageMaker AI. These requirements are imposed by RStudio PBC and the Amazon SageMaker Studio Classic platform. If either of these sets of requirements aren't satisfied, then your custom image won't function properly.

RStudio PBC requirements

RStudio PBC requirements are laid out in the Using Docker images with RStudio Workbench / RStudio Server Pro, Launcher, and Kubernetes article. Follow the instructions in this article to create the base of your custom RStudio image.

For instructions about how to install multiple R versions in your custom image, see Installing multiple versions of R on Linux.

Amazon SageMaker Studio Classic requirements

Amazon SageMaker Studio Classic imposes the following set of installation requirements for your RStudio image.

  • You must use an RStudio base image of at least 2023.03.2-454.pro2. For more information, see RStudio Versioning.

  • You must install the following packages:

    yum install -y sudo \ openjdk-11-jdk \ libpng-dev \ && yum clean all \ && /opt/R/${R_VERSION}/bin/R -e "install.packages('reticulate', repos='https://packagemanager.rstudio.com/cran/__linux__/centos7/latest')" \ && /opt/python/${PYTHON_VERSION}/bin/pip install --upgrade \ 'boto3>1.0<2.0' \ 'awscli>1.0<2.0' \ 'sagemaker[local]<3'
  • You must provide default values for the RSTUDIO_CONNECT_URL and RSTUDIO_PACKAGE_MANAGER_URL environment values.

    ENV RSTUDIO_CONNECT_URL "YOUR_CONNECT_URL" ENV RSTUDIO_PACKAGE_MANAGER_URL "YOUR_PACKAGE_MANAGER_URL" ENV RSTUDIO_FORCE_NON_ZERO_EXIT_CODE 1

The following general specifications apply to the image that is represented by an RStudio image version.

Running the image

ENTRYPOINT and CMD instructions are overridden so that the image is run as an RSession application.

Stopping the image

The DeleteApp API issues the equivalent of a docker stop command. Other processes in the container won’t get the SIGKILL/SIGTERM signals.

File system

The /opt/.sagemakerinternal and /opt/ml directories are reserved. Any data in these directories might not be visible at runtime.

User data

Each user in a SageMaker AI domain gets a user directory on a shared Amazon Elastic File System volume in the image. The location of the current user’s directory on the Amazon Elastic File System volume is /home/sagemaker-user.

Metadata

A metadata file is located at /opt/ml/metadata/resource-metadata.json. No additional environment variables are added to the variables defined in the image. For more information, see Get App Metadata.

GPU

On a GPU instance, the image is run with the --gpus option. Only the CUDA toolkit should be included in the image, not the NVIDIA drivers. For more information, see NVIDIA User Guide.

Metrics and logging

Logs from the RSession process are sent to Amazon CloudWatch in the customer’s account. The name of the log group is /aws/sagemaker/studio. The name of the log stream is $domainID/$userProfileName/RSession/$appName.

Image size

Image size is limited to 25 GB. To view the size of your image, run docker image ls.

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.