Sign inSign up

rstudio/rstudio-package-manager

By rstudio

Updated 2 days ago

Default Docker image for RStudio Package Manager

Image
2

100K+

rstudio/rstudio-package-manager repository overview

Quick reference

Important

A new posit/package-manager image is now generally available and replaces this image.
  • Posit will stop publishing this image at the end of 2026. Version updates will continue until then. Please switch to the Posit image linked above.

New image: Docker Hub | GHCR | GitHub | Discussions

What is Posit Package Manager?

Posit Package Manager, formerly RStudio Package Manager, is a repository management server to organize and centralize R packages across your team, department, or entire organization. Get offline access to CRAN, automate CRAN syncs, share local packages, restrict package access, find packages across repositories, and more. Experience reliable and consistent package management, optimized for teams who use R.

Notice for support

  1. This image may introduce BREAKING changes; as such we recommend:
    • Avoid using the {operating-system} tags to avoid unexpected version changes, and
    • Always read through the NEWS to understand the changes before updating.
  2. Outdated images will be removed periodically from DockerHub as product version updates are made. Please make plans to update at times or use your own build of the images.
  3. These images are meant as a starting point for your needs. Consider creating a fork of this repo, where you can continue to merge in changes we make while having your own security scanning, base OS in use, or other custom changes. We provide instructions for building for these cases.
  4. The Package Manager image uses the No Sandbox option documented here by default, if you need a more secure option for configuring Git-related package builds we recommend using a system with sandboxing enabled.
  5. Security Note: These images are provided AS IS based on the build environment at the time their product version was released/updated. They should be reviewed and updated before production use. If your organization has a specific set of security requirements related to CVE/Vulnerability severity levels, you should plan to use the instructions for building to clone this repository, and rebuild these images to your specific internal security standards.

How to use this image

Below is a simple example for running Package Manager locally in Docker using a license file.

Note: Posit recommends license file activation rather than license key activation. You can read more on the Licensing FAQ page.

These steps follow the license file activation commands for Package Manager.

# Run without persistent data and using default configuration
docker run -it \
    -p 4242:4242 \
    --mount type=bind,ro,src=<path to license file>,dst=/var/lib/rstudio-pm/rstudio-pm.lic \
    rstudio/rstudio-package-manager:ubuntu2204

Open http://localhost:4242 to access Posit Package Manager UI.

Overview

Note that running the Posit Package Manager Docker image requires a valid Posit Package Manager license.

This container includes:

  1. Two versions of R
  2. Two versions of Python
  3. Posit Package Manager

NOTE: Package Manager is currently not very particular about R version. Changing the R version is rarely necessary.

Configuration

Posit Package Manager is configured via the/etc/rstudio-pm/rstudio-pm.gcfg file. You should mount this file as a volume from the host machine. Changes will take effect when the container is restarted.

Be sure the config file has the HTTP.Listen field configured. See a complete example of that file at package-manager/rstudio-pm.gcfg.

Persistent Data

In order to persist Package Manager data between container restarts, configure the Server.DataDir option to go to a persistent volume. The included configuration file expects a persistent volume from the host machine or your docker orchestration system to be available at /var/lib/rstudio-pm. Should you wish to move this to a different path, you can change the Server.DataDir option.

[Server]
DataDir = /mnt/rspm/data
Product Licensing

Using the Posit Package Manager docker image requires you to have a valid License. Posit recommends using license file activation rather than license key activation. License files work well in all environments including ephemeral, container-based, or air-gapped environments. See the Licensing FAQ for more details. For full details and information about license key activation, see the Licensing page. You can set the license three different ways:

  1. Mounting a license file at /var/lib/rstudio-pm/*.lic or /home/rstudio-pm/.rstudio-pm/*.lic or a different path specified using RSPM_LICENSE_FILE_PATH that contains a valid license for Posit Package Manager
  2. Setting the RSPM_LICENSE environment variable to a valid license key inside the container
  3. Setting the RSPM_LICENSE_SERVER environment variable to a valid license server / port inside the container

NOTE: Use a license file, floating license server, or custom image with manual intervention for offline installations to successfully activate the instance.

Example usage with a license file

The container will automatically look for a license file at /var/lib/rstudio-pm/*.lic or /home/rstudio-pm/.rstudio-pm/*.lic and will attempt to use it for activation if present.

This example uses a bind mount to provide the license file from the host machine.

docker run -it \
    -p 4242:4242 \
    --mount type=bind,ro,src=<path to license file>,dst=/var/lib/rstudio-pm/rstudio-pm.lic \
    rstudio/rstudio-package-manager:ubuntu2204

Alternatively, the license file's path in the container can be provided using the RSPM_LICENSE_FILE_PATH environment variable. If provided, the container will attempt to find and activate from the file at the given path.

docker run -it \
    -p 4242:4242 \
    -e RSPM_LICENSE_FILE_PATH=/opt/license.lic \
    --mount type=bind,ro,src=<path to license file>,dst=/opt/license.lic \
    rstudio/rstudio-package-manager:ubuntu2204

If the license file does not successfully activate, the container should fail to start under most circumstances. You can still verify the container's licensing status by running the status command against the license-manager binary.

Depending on how the license file was provided, the License-File field may be /var/lib/rstudio-pm/*.lic or /home/rstudio-pm/.rstudio-pm/*.lic. Either path should work so long as the Status field shows Activated.

$ docker exec -it <container name> /opt/rstudio-pm/bin/license-manager status
TTY detected. Printing informational message about logging configuration. Logging configuration loaded from '/etc/rstudio/logging.conf'. Logging to '/var/log/rstudio/rstudio-server/license-manager.log'.
RStudio License Manager 2026.09.0+764.pro1

-- License file status --

Status: Activated
Product-Key: XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX
Has-Key: Yes
Has-Trial: No
Tier: Tier Name
SKU-Year: 2024
Enable-Launcher: 1
Users: 0
User-Activity-Days: 365
Shiny-Users: 0
Allow-APIs: 1
Anonymous-Servers: 0
Unrestricted-Servers: 0
Licensee: Company Name
License-File: /home/rstudio-pm/.rstudio-pm/rstudio-pm.lic
Expiration: YYYY-MM-DD HH:mm:ss
Days-Left: XXX
License-Engine: 1.0.0.0
License-Scope: System

-- Local license status --

Trial-Type: Verified
Status: Expired
Has-Key: No
Has-Trial: Yes
License-Scope: System
License-Engine: 4.4.3.0

-- Floating license status --

License server not in use.
Example usage with a license key

The container can also be activated using a license key by setting the RSPM_LICENSE environment variable. However, Posit recommends using license file activation rather than license key activation. License key activation should be avoided in production environments in favor of using a license file due to the risk of leaking license activations when the container is not gracefully stopped. See the caveats of product licensing in containers section below for more details.

# Replace with valid license
export RSPM_LICENSE=XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX

# Run without persistent data and using an external configuration
docker run -it --privileged \
    -p 4242:4242 \
    -e RSPM_LICENSE=$RSPM_LICENSE \
    rstudio/rstudio-package-manager:ubuntu2204
Environment variables
VariableDescriptionDefault
RSPM_LICENSELicense key for Posit Package Manager, format should be: XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXXNone
RSPM_LICENSE_SERVERFloating license server, format should be: my.url.com:portNone
Ports
VariableDescription
4242Default HTTP Port for Posit Package Manager
Example usage
# Replace with valid license
export RSPM_LICENSE=XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX

# Run without persistent data and using an external configuration
docker run -it \
    -p 4242:4242 \
    -v $PWD/package-manager/rstudio-pm.gcfg:/etc/rstudio-pm/rstudio-pm.gcfg \
    -e RSPM_LICENSE=$RSPM_LICENSE \
    rstudio/rstudio-package-manager:ubuntu2204

# Run with persistent data and using an external configuration
docker run -it \
    -p 4242:4242 \
    -v $PWD/data/rspm:/data \
    -v $PWD/package-manager/rstudio-pm.gcfg:/etc/rstudio-pm/rstudio-pm.gcfg \
    -e RSPM_LICENSE=$RSPM_LICENSE \
    rstudio/rstudio-package-manager:ubuntu2204

Open http://localhost:4242 to access Posit Package Manager UI.

To create repositories you need to access the container directly and execute some commands. To do this find the container ID for RSPM (using docker ps) and run:

docker exec -it {container-id} /bin/bash

Then please refer to the Package Manager documentation on how to create and manage your repositories.

Example for adding a Workbench-built tarball

For this example, a package, demo1 was created with version 0.1.0 and a tarball was created using the build pane in pwb. This will write out the tarball on the host system at data/pwb/rstudio/demo1_0.1.0.tar.gz

Copy the tarball into the /tmp dir using docker cp:

Find the container id for the running package-manager container via docker ps:

❯ docker ps
CONTAINER ID   IMAGE ...
b8ae944b7f2d   rstudio/rstudio-package-manager:2026.09.0-3 ...
# replace b8ae944b7f2d with your container ID
docker cp data/pwb/rstudio/demo1_0.1.0.tar.gz b8ae944b7f2d:/tmp

now you can create the repo in rspm

root@1b6f4f5fc669:/# rspm create source --name=demopkgs
Source 'demopkgs':
  Type:  Local
root@1b6f4f5fc669:/# rspm add --source=demopkgs --path='/tmp/demo1_0.1.0.tar.gz'
Added package '/tmp/demo1_0.1.0.tar.gz'.
root@1b6f4f5fc669:/# rspm create repo --name=demopkgs --description="demo package repo"
Repository: demopkgs - demo package repo - R
root@1b6f4f5fc669:/# rspm subscribe --repo=demopkgs --source=demopkgs
Repository: demopkgs
Sources:
--demopkgs (Local)

It can then be installed from R on the local machine:

> install.packages("demo1", repos = "http://rstudio-package-manager:4242/demopkgs/latest")
Installing package into ‘/home/rstudio/R/x86_64-pc-linux-gnu-library/3.6’
(as ‘lib’ is unspecified)
trying URL 'http://rstudio-package-manager:4242/demopkgs/latest/src/contrib/demo1_0.1.0.tar.gz'
Content type 'application/x-gzip' length 859 bytes
==================================================
downloaded 859 bytes

* installing *source* package ‘demo1’ ...
** using staged installation
** R
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (demo1)

The downloaded source packages are in
  ‘/tmp/RtmpRVTKFG/downloaded_packages’

Caveats of product licensing in containers

Note: This section does not apply to activations using license files.

There is currently a known licensing bug when using our products in containers. If the container is not stopped gracefully, the license deactivation step may fail or be skipped. Failing to deactivate the license can result in a "license leak" where a product activation is used up and cannot be deactivated using traditional methods as the activation state on the container has been lost.

To avoid "leaking" licenses, we encourage users not to force kill containers and to use --stop-timeout 120 and --time 120 for docker run and docker stop commands respectively. This helps ensure the deactivation script has ample time to run properly.

In some situations, it can be difficult or impossible to avoid a hard termination (e.g. power failure, critical error on host). Unfortunately, any of these cases can still cause a license to leak an activation. To help prevent a license leak in these situations, users can mount the following directories to persistent storage to preserve the license state data across restarts of the container. These directories differ between products.

  • License Key
    • /home/rstudio-pm/.local
    • /home/rstudio-pm/.prof
    • /home/rstudio-pm/.rstudio-pm
  • Floating License
    • /home/rstudio-pm/.TurboFloat

Please note that the files created in these directories are hardware locked and non-transferable between hosts. Due to the nature of the hardware fingerprinting algorithm, any low-level changes to the host or container can cause existing license state files to invalidate. To avoid this problem, we advise that product containers are gracefully shutdown and allowed to deactivate prior to changing any hardware or firmware on the host (e.g. upgrading a network card or updating BIOS) or the container (e.g. changing the network driver used or the allocated number of CPU cores).

While preserving license state data can help avoid license leaks across restarts, it's not a guarantee. If you run into issues with your license, please do not hesitate to contact Posit support.

While neither of these solutions will eliminate the problem, they should help mitigate it. We are still investigating a long-term solution.

License

The license associated with the Posit Docker Products repository is located in LICENSE.md.

As is the case with all container images, the images themselves also contain other software which may be under other licenses (i.e. bash, linux, system libraries, etc., along with any other direct or indirect dependencies of the primary software being contained).

It is an image user's responsibility to ensure that use of this image (and any of its dependent layers) complies with all relevant licenses for the software contained in the image.

Tag summary

Content type

Image

Digest

sha256:b6c7d37b8

Size

1.2 GB

Last updated

2 days ago

docker pull rstudio/rstudio-package-manager:ubuntu2204