Skip to content

Configuration File

Package Manager reads /etc/rstudio-pm/rstudio-pm.gcfg, an INI style file.1 Every default is listed in /etc/rstudio-pm/rstudio-pm.gcfg.defaults, which is a reference to read, not a file to edit. A restart applies changes, and settings that support SIGHUP can be refreshed with rspm hup; both commands are on Sudo Commands.

Single node example

The example below runs Package Manager on its own host, with TLS on the service and PostgreSQL for the database.

/etc/rstudio-pm/rstudio-pm.gcfg (single node, TLS on Package Manager, PostgreSQL)
[Server]
Address = https://packagemanager.example.com
RVersion = /opt/R/4.5.2
PythonVersion = /opt/python/3.12.11/bin/python3
DataDir = /var/lib/rstudio-pm
TempDir = /var/tmp/rstudio-pm

[HTTP]
Listen =

[HTTPS]
Listen = :443
Certificate = /etc/rstudio-pm/packagemanager.example.com.crt
Key = /etc/rstudio-pm/packagemanager.example.com.key
MinimumTLS = 1.2
Permanent = true

[HTTPRedirect]
Listen = :80

[Binaries]
Distributions = "rhel9, manylinux_2_28, windows, macos"

[Git]
PollInterval = 5m
BuildRetries = 3

[Database]
Provider = postgres

[Postgres]
URL = "postgres://ppm@postgres.example.com/rstudio_pm?sslmode=require"
Password = "<ENCRYPTED_PASSWORD>"
UsageDataURL = "postgres://ppm@postgres.example.com/rstudio_pm_usage?sslmode=require"
UsageDataPassword = "<ENCRYPTED_PASSWORD>"

Settings that bite

Most settings are safe to leave at their defaults. The ones below cause trouble when they are wrong.1

Setting Gotcha
Server.RVersion, Server.PythonVersion Used only to build Git and local packages. They do not change which binaries are served.
Server.TempDir Cannot sit inside Server.DataDir.
HTTP.Listen, HTTPS.Listen Set the unused protocol's Listen to empty, as with [HTTP] Listen = above, or a second port stays open.
HTTPS.MinimumTLS Defaults to 1.1; set 1.2 or 1.3.
HTTPS.Permanent true turns on HSTS. Use it only if the server will always have a valid certificate.
[CRAN] SyncSchedule and similar Left over from older releases; see Legacy sync schedules.

Ports and privileges

The service runs as the unprivileged rstudio-pm account.4 This differs from Connect, which runs as root by default,5 and from Workbench, which starts as root and drops privileges after binding.6 The difference catches people during migrations in two places: low ports and the TLS key.

Binding to port 443 or 80 needs a Linux capability on the binary:3

sudo setcap 'cap_net_bind_service=+ep' /opt/rstudio-pm/bin/rstudio-pm
getcap /opt/rstudio-pm/bin/rstudio-pm

Upgrades replace the binary and can drop the capability. Check getcap again after every upgrade.

The TLS key must be readable by rstudio-pm and must not have a passphrase.3 The owner and mode to use are on Directories and Files.

Alternatively, terminate TLS at a proxy and run Package Manager on HTTP :4242 (the default HTTP.Listen port) with HTTP.ForceSecure = true and HTTP.NoWarning = true.1

Secrets

Never commit real passwords to a repository of config files. Encrypt each value on the server with rspm encrypt, and paste the output into the file.2 The encrypted value only works with that server's encryption key; where the key lives is on Directories and Files.