Environments¶
Most organizations run Posit in more than one environment. A common layout is three tiers:
| Tier | Purpose | Audience |
|---|---|---|
| Development (DEV) | Test upgrades, new R/Python versions, config changes | Admins, a few pilot users |
| Production (PRD) | Day to day analysis and internal publishing | All internal users |
| External (DMZ) | Public or partner facing content | Anonymous or external users |
Regulated organizations may add a separate validated tier. See Regulated Environments.
Example architectures¶
Generic Architectures
Review the Posit documentation on architectures for Workbench, Connect, and Package Manager.
Development on one server¶
The development environment should be an exact mirror of the production environment, but that is not always possible. The first diagram below shows all three services on one Linux server for illustration only. Posit's documentation states that each product requires its own dedicated server, so give each service its own server in DEV where you can.123
graph LR
subgraph DEV["Development Environment"]
subgraph DevLinux["Linux Server"]
direction LR
DevWB("Workbench<br/><code>dev-wb.com</code>")
DevCon("Connect<br/><code>dev-con.com</code>")
DevPM("Package Manager<br/><code>dev-pm.com</code>")
end
subgraph DevPostgres["Development PostgreSQL Server"]
direction LR
DevWBDB[("<code>rstudio<code><br>Database")]
DevConDB[("<code>connect<code><br>Database")]
DevPMDB[("<code>rstudio_pm<code><br>Database")]
end
end
DevWB -->|"publish"| DevCon
DevWB -->|"install"| DevPM
DevCon -->|"restore"| DevPM
DevWB <-->|"serves"| DevWBDB
DevCon <-->|"serves"| DevConDB
DevPM <-->|"serves"| DevPMDB
style DevWB fill:#e8f1f8,stroke:#447099,stroke-width:2px,color:#1a1a1a
style DevCon fill:#fdf1e3,stroke:#c9822b,stroke-width:2px,color:#1a1a1a
style DevPM fill:#e8f5ec,stroke:#3f8f5a,stroke-width:2px,color:#1a1a1a
style DevWBDB fill:#f1eaf6,stroke:#7a4f9a,stroke-width:2px,color:#1a1a1a
style DevConDB fill:#f1eaf6,stroke:#7a4f9a,stroke-width:2px,color:#1a1a1a
style DevPMDB fill:#f1eaf6,stroke:#7a4f9a,stroke-width:2px,color:#1a1a1a
Note that each service has it's own database (either SQLite or PostgreSQL).456 Read more about this in the Database section.
Posit - Dedicated server required" Posit requires Workbench to run on its own server:1 "Run Workbench on its own server, separate from Posit Connect and Posit Package Manager. The server can be physical, virtual, or a container. “Dedicated” means it is not shared with those products, not that it must be bare-metal hardware. Co-locating these products causes them to compete for CPU, RAM, and disk, which can lead to instability and degraded performance.
Production on separate servers¶
Your production environment should run each service on its own Linux server, which Posit's documentation requires for each product (Workbench).23
graph LR
subgraph PRD["Production (internal)"]
subgraph PrdWBLinux["Workbench Server"]
PrdWB("Workbench<br/>prod-wb.com")
end
subgraph PrdConLinux["Connect Server"]
PrdCon("Connect<br/>prod-con.com")
end
subgraph PrdPMLinux["Package Manager Server"]
PrdPM("Package Manager<br/>prod-pm.com")
end
subgraph PrdPostgres["Production PostgreSQL Server"]
PrdWBDB[("<code>rstudio<code><br>Database")]
PrdConDB[("<code>connect<code><br>Database")]
PrdPMDB[("<code>rstudio_pm<code><br>Database")]
end
end
PrdWB -->|"publish"| PrdCon
PrdWB -->|"install"| PrdPM
PrdCon -->|"restore"| PrdPM
PrdWB <-->|"serves"| PrdWBDB
PrdCon <-->|"serves"| PrdConDB
PrdPM <-->|"serves"| PrdPMDB
style PrdWB fill:#e8f1f8,stroke:#447099,stroke-width:2px,color:#1a1a1a
style PrdCon fill:#fdf1e3,stroke:#c9822b,stroke-width:2px,color:#1a1a1a
style PrdPM fill:#e8f5ec,stroke:#3f8f5a,stroke-width:2px,color:#1a1a1a
style PrdWBDB fill:#f1eaf6,stroke:#7a4f9a,stroke-width:2px,color:#1a1a1a
style PrdConDB fill:#f1eaf6,stroke:#7a4f9a,stroke-width:2px,color:#1a1a1a
style PrdPMDB fill:#f1eaf6,stroke:#7a4f9a,stroke-width:2px,color:#1a1a1a
External Connect cluster¶
Below is an example I used for an externally facing Posit Connect server. Connect nodes in a load balanced cluster must keep application data on external shared storage (typically NFS) and use one external PostgreSQL database. The load balancer needs sticky sessions and websocket support.7 The diagram does not show the shared storage.
graph TB
subgraph DMZ["External (public facing)"]
DmzLB(["Load balancer / reverse proxy<br/>connect-public.example.com"])
DmzCon1("Connect node 1")
DmzCon2("Connect node 2")
DmzPM("Package Manager")
DmzDB[("PostgreSQL")]
end
DmzLB --> DmzCon1
DmzLB --> DmzCon2
DmzCon1 -->|"restore"| DmzPM
DmzCon2 -->|"restore"| DmzPM
DmzCon1 --- DmzDB
DmzCon2 --- DmzDB
style DmzCon1 fill:#fdf1e3,stroke:#c9822b,stroke-width:2px,color:#1a1a1a
style DmzCon2 fill:#fdf1e3,stroke:#c9822b,stroke-width:2px,color:#1a1a1a
style DmzPM fill:#e8f5ec,stroke:#3f8f5a,stroke-width:2px,color:#1a1a1a
style DmzDB fill:#f1eaf6,stroke:#7a4f9a,stroke-width:2px,color:#1a1a1a
Design decisions by tier¶
| Aspect | Development | Production | External (DMZ) |
|---|---|---|---|
| Workbench | Yes | Yes | Usually none (publish only target) |
| Connect | Dedicated VM | Dedicated VM | Two or more nodes behind a load balancer |
| Package Manager | Dedicated VM | Dedicated VM | Dedicated VM, or reuse production through a firewall rule |
| TLS | On the product | On the product or a proxy | Terminated at the load balancer |
| Authentication | Same IdP as production (separate app registration) | OIDC or SAML for Connect, PAM or SSO for Workbench | SAML or OIDC, often a different tenant or guest access |
| Repository editing | Users may add repositories | Locked to Package Manager | Locked to Package Manager |
Lessons from running three tiers¶
Keep DEV representative of PRD¶
Differences between DEV and PRD can hide problems until production. Use the same ports, paths, and service accounts in both, and give each service its own server.2
Point the external tier at your own Package Manager¶
A DMZ Connect that resolves packages straight from cran.rstudio.com or the public Posit Package Manager will:
- Depend on external services for packages not already in Connect's package cache8
- Have no access to packages served only by your own Package Manager
- Break when outbound internet access is restricted
- Resolve package versions that may differ from those validated internally
Fix it by pointing the DMZ Connect [RPackageRepository "CRAN"] URL at a Package Manager reachable from the DMZ.8
Track configuration drift between nodes¶
Posit notes that most users will want load balanced Connect nodes to use identical configuration files, although it is not strictly required.7 Small differences (one node missing the SAML signing certificate, one node with CORS.EnforceWebsocketOrigin = false) mean behavior depends on which node a user hits.10 Keep config files in version control and diff them. The posit-workbench, posit-connect, and posit-pm scripts print each product's configuration without comments and with secrets masked, so you can diff the reports from two nodes.
Keep R, Python, and Quarto versions aligned¶
Publishing clients record R version information in manifest.json. When content has no R version constraint, Connect matches the authoring R version to an installed version. R.VersionMatching (default nearest) decides the match, which may not be the version the author tested against.910 A version matrix per environment is worth maintaining:
| Version | DEV | PRD | DMZ |
|---|---|---|---|
| R 4.4.x | yes | yes | yes |
| R 4.5.x | yes | yes | yes |
| R 4.6.x | yes | pilot | no |
| Python 3.11 | yes | yes | yes |
| Python 3.12 | yes | yes | yes |
| Quarto 1.8 | yes | yes | yes |
Set an update schedule for each service¶
Keeping the services up to date will ensure the integrations and features function properly. Workbench, Connect, and Package Manager are versioned and supported separately.11
They work together, though. Workbench publishes to Connect, and both pull packages from Package Manager, so upgrading one service can change how it works with the other two. Read the release notes for each product before upgrading, and confirm the connections between them still work afterward:
| Service | Works with | Check after upgrading |
|---|---|---|
| Workbench | Connect (publish), Package Manager (install) | Publishing to Connect, package installs from Package Manager |
| Connect | Package Manager (restore) | Content restores, R and Python version matching |
| Package Manager | Used as a package source by Workbench and Connect | Repository URLs and installs from Workbench and Connect |
Roll every update through the tiers in the same order: DEV first, then PRD, then DMZ. Leave the update in DEV long enough for pilot users to exercise real workloads before promoting it. In regulated environments, pick a regular cadence (quarterly, for example) and route each upgrade through your change control process. The testing evidence, approvals, and rollback plan are then documented before production changes.
The posit-host script generates this inventory per host.