Posit Connect
Posit Connect is a publishing platform for the work your teams create in R and Python. Share Shiny applications, R Markdown reports, Plumber APIs, dashboards, plots, Jupyter Notebooks, and more in one convenient place. To learn more, visit the Posit Connect Product Page and contact your Posit Customer Success Representative.
For the latest information on integrating Package Manager with Connect, see the Integration with Posit Package Manager section of the Connect admin guide.
If you want to configure Connect to install packages from an authenticated repository, see Authenticated Repositories below.
Authenticated repositories
Getting a token
You can create a token to use for repository authentication using the rspm create token
CLI command. See Creating API Tokens for details.
Configure Connect for authenticated R repositories
If any of your R repositories require authentication, you can configure credentials for Connect by creating a netrc
file. This method is widely supported and provides a secure way to access authenticated repositories in R.
Create a
netrc
file in a location that is accessible to theRunAs
user (typicallyrstudio-connect
), such as/etc/netrc
.Add the following content, replacing
[packagemanager.example.com]
with your Package Manager server address and[your-token]
with your actual token./etc/netrc
machine [packagemanager.example.com] login __token__ password [your-token]
The machine field should not contain a protocol, port, or repository path. If your repository URL is https://packagemanager.example.com/cran/linux/noble/latest, use packagemanager.example.com for the machine field.
Create a
.curlrc
file in the home directory of the defaultRunAs
user, typically at/home/rstudio-connect/.curlrc
. Add the following content:/home/rstudio-connect/.curlrc
--netrc-file /etc/netrc
Users should also configure credentials when deploying content by following the instructions in the Authenticated R Repositories section of the User Guide.
All deployed content can access the credentials stored in /etc/netrc
. To mitigate this security risk, ensure that your API token restricts scopes to repos:read
for the necessary repositories.
Configure Connect for authenticated Python repositories
If any of your Python repositories require authentication, you can configure credentials for Connect by creating a netrc
file. This method is widely supported and provides a secure way to access authenticated repositories in Python.
Create a
netrc
file in a location that is accessible to all users, such as/etc/netrc
.Add the following content, replacing
[packagemanager.example.com]
with your Package Manager server address and[your-token]
with your actual token./etc/netrc
machine [packagemanager.example.com] login __token__ password [your-token]
The machine field should not contain a protocol, port, or repository path. If your repository URL is https://packagemanager.example.com/pypi/latest, use packagemanager.example.com for the machine field.
Set the
NETRC=/etc/netrc
environment variable for the Connect server process. If the Connect service is managed by systemd, you can simply add the environment variable to/etc/default/rstudio-connect
. If the file does not exist, create it./etc/default/rstudio-connect
NETRC=/etc/netrc
Add the following lines to
/etc/pip.conf
, replacingpackagemanager.example.com
with your Package Manager server address./etc/pip.conf
[global] timeout = 60 index-url = https://packagemanager.example.com/pypi/latest/simple trusted-host = packagemanager.example.com
Users should also configure credentials when deploying content by following the instructions in the Authenticated Python Repositories section of the User Guide.
All deployed content can access the credentials stored in /etc/netrc
. To mitigate this security risk, ensure that your API token restricts scopes to repos:read
for the necessary repositories.