Standardizing a custom RStudio or Jupyter environment

Allie Cliffe
  • Updated

To make sure everyone in your group is using the same software in your Jupyter or RStudio analysis, you can use a custom Docker Image or a startup script to standardize a custom environment. This article goes through two ways to standardize a custom environment: with a custom Docker image or a startup script.


You want to ensure all colleagues are using the exact same software and computational environment, even if If you can't use one of the pre-configured application environments. You can do this - and make sure everyone gets the same analysis results - by using the same Docker image or startup script.

Why use pre-installed software and dependencies?If your analysis requires software packages that are not part of the default or pre-configured configurations, you could start your interactive application by installing the ones you need on the Persistent Disk. However, this approach can turn into a maintenance headache if you have multiple notebooks that require the same configuration commands. Here are three reasons to move some of those software installation steps into the application configuration proper.

You don't have to spend time (and $$) running setup code to install what's needed for your analysis every time you create a new Jupyter Cloud Environment.

Simplified setup
Customizing the application configuration simplifies and standardizes the setup needed to run an application.

Custom Docker containers and startup scripts put you in control of exactly what version of programming languages and packages to include. Recording the image URL within the notebook you wish to share is a quick and easy way to spin up and share an identical environment, ensuring that colleagues get the same results.

To learn more about developing and using custom Docker images in Terra, see these articles on working with containers/Docker. Note that you can also use a custom environment to revert to a previous version of the pre-configured environments. 

Standardizing a custom environment: Step-by-step instructions

  • Set a custom environment with a Custom Docker Image

    1. Select Custom Environment from the Application Configuration drop-down menu.

    2. Input the container image, using the format <image name>:<tag>.

    Note that custom environments must be based on one of the Terra Jupyter Notebook base images or a Project-Specific image.

  • Set a custom environment with a startup script

    1. Scroll down to the Cloud compute profile box in the Jupyter Cloud Environment customization pane. This is where to modify the VM resource allocations.

    2. Input the path to the startup script in the field where it says URI (for Uniform Resource Identifier, a close cousin of URL, the Uniform Resource Locator).

    For more detail, check out this tutorial, Using a startup script to launch a pre-configured Cloud Environment. There, you can learn about creating your own startup script, uploading it to a Google bucket, and using it to launch a custom cloud environment.

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request



Please sign in to leave a comment.