Package Persistence for Workspaces

Package persistence helps you save time by keeping installed packages across workspace sessions. Whether you’re working in Python or R, you no longer need to reinstall your packages every time you start or restart a workspace, as long as the environment and workspace are configured to support it.

In addition to speeding up workspace launches, package persistence contributes to easier troubleshooting and iteration, as new environment revisions can be built from any existing base.

This guide explains how to enable and use package persistence, both from the environment settings and from within an active workspace.

Enable package persistence

Enable package persistence in an environment

To use package persistence, it must first be enabled in an environment.

  1. Go to the Revisions tab of your compute environment.

  2. Create a new revision or edit an existing one.

  3. Check the box for Enable Package Persistence.

The Package Persistence checkbox in the workspace UI only appears if the environment supports it.

Use package persistence in an environment

Once package persistence is enabled in the environment, you can use it directly in your workspace.

Install packages

Any packages you install manually will persist across workspace sessions:

LanguageInstall Command

Python

pip install <package-name>

R

install.packages("<package-name>")

You can also use the Posit Package Manager to install R packages.

What happens to requirements.txt

  • Domino automatically runs requirements.txt at startup.

  • Before package persistence, this reinstalled packages every time.

  • With persistence enabled, already-installed packages are skipped, speeding up workspace launch.

Control persistence on restart

When you restart a workspace that uses an environment with persistence enabled, you’ll see a Package Persistence checkbox:

  • Turn it on to keep your installed packages across sessions.

  • Turn it off to start clean.

Enabling package persistence for external environments

If you’re using a custom (external) environment, you’ll need to install the appropriate tools to support package persistence.

LanguageToolInstallation Details

Python

uv

Follow the uv installation guide to add it to your base or environment image.

R

renv

Add this line to your Dockerfile:
RUN R -e "install.packages('renv')"

Once installed, Domino will be able to track and persist packages installed within workspaces using these tools.

Home directory persistence

Domino also supports persistence of the $HOME directory, allowing you to retain user-specific files across workspace sessions. This is useful for preserving IDE settings, environment configs, or files related to tools like remote Ray clusters.

Enable $HOME directory persistence

  • When launching a workspace, toggle Home Directory Persistence to retain the contents of the $HOME directory between sessions.

  • This setting ensures that any config files stored in $HOME, such as IDE preferences, .ssh keys, or cluster configs, are preserved.

By enabling home directory persistence, you can keep essential configuration files and tools available across sessions. This reduces setup time and helps maintain a consistent workspace environment. This is especially useful for advanced workflows that depend on personalized settings or external integrations.

Next Steps