Sign inSign up

rstudio/rstudio-connect

By rstudio

•Updated 4 days ago

Default Docker image for RStudio Connect

Image
7

1M+

rstudio/rstudio-connect repository overview

⁠Quick reference

Important

A new posit/connect⁠ 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 Connect?

Posit Connect is a platform for fast, secure, and sharable data products.

  • Deploy Shiny, Streamlit, Dash, Gradio, and other app frameworks
  • Serve APIs and MCP servers to power apps and agents
  • Host reports, notebooks, and scripts and run them on a schedule
  • Seamlessly integrate with data sources and manage authorization
  • Monitor performance, track usage, and maintain an audit trail

For more information on running Posit Connect in your organization please visit https://posit.co/products/enterprise/connect/⁠.

⁠Notice for support

  1. This image may introduce BREAKING changes; as such we recommend:
    • Avoid using the {operating-system} tags to avoid unexpected version upgrades, 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. 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 Connect 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 Connect.

# Replace `<path to license file>` with the path to your license file locally.
sudo chown root:root <path to license file>
sudo chmod 0600 <path to license file>

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

Once running, open http://localhost:3939⁠ to access Posit Connect.

⁠Overview

This Docker container is built following the Posit Connect admin guide⁠, please see Server Guide/Docker⁠ for more details on the requirements and how to extend this image.

This container includes:

  1. Two versions of R
  2. Two versions of Python
  3. Quarto
  4. Posit Professional Drivers
  5. Posit Connect

Note that running the Posit Connect Docker image requires the container to run using the --privileged flag and a valid Posit Connect license.

IMPORTANT: to use Posit Connect with more than one user, you will need to define Server.Address in the rstudio-connect.gcfg file. To do so, update your configuration file with the URL that users will use to visit Connect. Then start or restart the container.

⁠Configuration

The configuration of Posit Connect is made on the /etc/rstudio-connect/rstudio-connect.gcfg file, mount this file as volume with an external file on the host machine to change the configuration and restart the container for changes to take effect.

Be sure the config file has these fields:

  • Server.Address set to the exact URL that users will use to visit Connect. A placeholder http://localhost:3939 is in use by default
  • Server.DataDir set to /data/
  • HTTP.Listen (or equivalent HTTP, HTTPS, or HTTPRedirect settings. This could change how you should configure the container ports)
  • Python.Enabled and Python.Executable

See a complete example of that file at connect/rstudio-connect.gcfg.

⁠Persistent Data

In order to persist Connect metadata and app data between container restarts configure the Connect 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 /data. Should you wish to move this to a different path, you can change the Server.DataDir option.

Below is an example of running the Posit Connect container with a bind mount attached to the /data directory.

docker run -it --privileged \
    -p 3939:3939 \
    --mount type=bind,ro,src=<path to license file>,dst=/var/lib/rstudio-connect/rstudio-connect.lic \
    --mount type=bind,src=/path/to/local/directory,dst=/data \
    rstudio/rstudio-connect:ubuntu2204
⁠Product Licensing

Using the Posit Connect 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 /var/lib/rstudio-connect/*.lic single file that contains a valid license for Posit Connect
  2. Setting the RSC_LICENSE environment variable to a valid license key inside the container
  3. Setting the RSC_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-connect/*.lic and will attempt to use it for activation if present.

To ensure that the license file is set to the correct permissions in the container, you can set them before you start the container with:

sudo chown root:root <path to license file>
sudo chmod 0600 <path to license file>

Note: If you run Connect as an unprivileged user such as rstudio-connect, the license file needs to be owned by that user. This can be done by setting the user id matching that user in the container. For example:

sudo chown 999:999 <path to license file>
sudo chmod 0600 <path to license file>

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

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

Alternatively, the license file's path in the container can be provided using the RSC_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 --privileged \
    -p 3939:3939 \
    -e RSC_LICENSE_FILE_PATH=/opt/license.lic \
    --mount type=bind,ro,src=<path to license file>,dst=/opt/license.lic \
    rstudio/rstudio-connect: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.

$ docker exec -it <container name> /opt/rstudio-connect/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: /var/lib/rstudio-connect/rstudio-connect.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 RSC_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 RSC_LICENSE=XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX

# Run without persistent data and using an external configuration
docker run -it --privileged \
    -p 3939:3939 \
    -e RSC_LICENSE=$RSC_LICENSE \
    rstudio/rstudio-connect:ubuntu2204

details on license key issues.

⁠Environment variables
VariableDescriptionDefault
RSC_LICENSELicense key for Posit Connect, format should be: XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXXNone
RSC_LICENSE_SERVERFloating license server, format should be: my.url.com:portNone
⁠Ports
VariableDescription
3939Default HTTP Port for Posit Connect

⁠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
    • /var/lib/.local
    • /var/lib/.prof
    • /var/lib/rstudio-connect
  • Floating License
    • /var/lib/.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:7898812f3…

Size

2.2 GB

Last updated

4 days ago

docker pull rstudio/rstudio-connect:ubuntu2204