Configuration File¶
Connect reads /etc/rstudio-connect/rstudio-connect.gcfg (INI style).1 A restart applies every change; settings marked reloadable in the configuration reference can be applied with a reload instead. Check the file first with --check-config. Both commands are on Sudo Commands, and the file's owner and mode are on Directories and Files.
Internal production server¶
Single node, TLS on Connect, OIDC, PostgreSQL
[Server]
Address = https://connect.example.com
SenderEmail = posit-connect@example.com
EmailProvider = "SMTP"
DataDir = /var/lib/rstudio-connect
TempDir = /var/tmp/rstudio-connect
[HTTPS]
Listen = :443
Certificate = /etc/rstudio-connect/connect.example.com.crt
Key = /etc/rstudio-connect/connect.example.com.key
MinimumTLS = "1.2"
[HTTPRedirect]
Listen = :80
[Authentication]
Provider = "oauth2"
[OAuth2]
ClientId = "<CLIENT_ID>"
ClientSecret = "<ENCRYPTED_CLIENT_SECRET>"
OpenIDConnectIssuer = "https://login.microsoftonline.com/<TENANT_ID>/v2.0"
RequireUsernameClaim = true
UsernameClaim = "preferred_username"
UniqueIdClaim = "oid"
GroupsClaim = "groups"
GroupsAutoProvision = true
RegisterOnFirstLogin = true
[Authorization]
DefaultUserRole = "viewer"
[Database]
Provider = "postgres"
[Postgres]
URL = "postgres://connect@postgres.example.com/connect?sslmode=require"
Password = "<ENCRYPTED_PASSWORD>"
[SMTP]
Host = smtp.example.com
Port = 587
StartTLS = "detect"
[R]
ExecutableScanning = false
Executable = /opt/R/4.5.2/bin/R
Executable = /opt/R/4.4.3/bin/R
PositPackageManagerURLRewriting = "force-binary"
[RPackageRepository "CRAN"]
URL = "https://packagemanager.example.com/cran/latest"
[RPackageRepository "Internal"]
URL = "https://packagemanager.example.com/internal/latest"
[Python]
Enabled = true
Executable = /opt/python/3.12.11/bin/python3
[Quarto]
Enabled = true
Executable = /opt/quarto/1.8.25/bin/quarto
[Applications]
BundleRetentionLimit = 10
[Logging]
AuditLog = "/var/log/rstudio/rstudio-connect/audit.json"
AuditLogFormat = "JSON"
External node behind a load balancer¶
TLS terminated at the load balancer, SAML, shared DataDir
[Server]
Address = https://connect-public.example.com
DataDir = /shared/connect/var/lib/rstudio-connect
LandingDir = /shared/connect/landing
[HTTP]
Listen = :3939
ForceSecure = true
[Authentication]
Provider = "saml"
[SAML]
IdPMetaDataPath = /etc/rstudio-connect/idp/idp-metadata.xml
IdPAttributeProfile = "microsoft-entra-id"
SSOInitiated = "IdPAndSP"
[CORS]
EnforceWebsocketOrigin = true
[Database]
Provider = "postgres"
[Postgres]
URL = "postgres://connect@postgres-dmz.example.com/connect?sslmode=require"
Password = "<ENCRYPTED_PASSWORD>"
[RPackageRepository "CRAN"]
URL = "https://packagemanager-dmz.example.com/cran/latest"
HTTP.ForceSecure = true marks cookies Secure even though Connect itself speaks plain HTTP to the proxy.1 Without it, browsers may drop session cookies. The connection between proxy and Connect should be on a trusted network segment.
Whether Connect listens on :80, :3939 (the default HTTP port), or something else behind the proxy does not matter to users.2 Pick one, open it only to the load balancer, and keep it consistent across nodes.
Settings that bite¶
| Setting | Gotcha |
|---|---|
Server.Address |
Must be the URL users type. Wrong value breaks OAuth redirects, email links, and the content URLs shown to publishers1 |
Server.TempDir |
Must not be mounted noexec; package builds run from it1 |
R.External |
Every listed package must exist in every R version, or Connect will not start (unless ExternalsCheckIsFatal = false)1 |
RPackageRepository URLs |
With PositPackageManagerURLRewriting = auto or force-binary, Connect rewrites Package Manager URLs, so a distro path you typed may not be what is used. This is expected1 |
Applications.BundleRetentionLimit |
Default 0 keeps every bundle forever1 |
UniqueIdClaim |
Changing it after users exist creates duplicate accounts3 |
Secrets¶
Never commit real secrets to a repository of config files. Encrypt each value on the server with rscadmin encrypt-config-value (see Sudo Commands).4
The output is tied to that server's encryption key (see Directories and Files). HA nodes share one key through the shared data directory. Standalone servers each have their own, so an encrypted value copied to another server will not decrypt.5