From your console or terminal
Deploy content to Connect Cloud from your R console or terminal using the rsconnect package or the Quarto CLI. This is useful for scripting deployments and for running them from non-interactive environments such as CI/CD pipelines.
rsconnect Package
Deploy R content programmatically from any R session
You can deploy R content programmatically to Connect Cloud using the rsconnect package.
Deployment Process
1. Install the package
install.packages("rsconnect")2. Sync with Connect Cloud
Interactively
rsconnect::connectCloudUser()This will open your browser to authorize access, and prompt you to choose an account if you have multiple. You can confirm that the account was successfully added by running rsconnect::accounts().
Noninteractively
First, add a credential for use with Connect Cloud. Then add it, specifying the name of the your account, which can be found here:
rsconnect::connectCloudClientCredentials(
clientId="62d4586a-cc34-40a4-a8c6-3863da5e7244",
clientSecret="xxx",
account="<YOUR_ACCOUNT_HERE>"
)3. Deploy the content
Imagine you have a Shiny application named app.R stored in a directory named Dashboard.
/MyProject/
├── Dashboard/
│ └── app.R
└── other_code.R
To start the deployment, run the following code.
rsconnect::deployApp(appDir='Dashboard')Please note:
- You do not need to provide the
appDirargument if your application is stored in the root directory. - If you have multiple accounts configured, you will be asked which account you would like to use for the deployment.
4. Access the content
A successful deployment will open your browser and bring you to your content’s administration page.
If your deployment fails, please review the logs and error messages provided in the R session console.
Additional Resources
Other useful rsconnect functions include accounts(), remove_account(), deployDoc(), and deploySite(). For a complete list of packages and their functionality, please visit the official rsconnect documentation.
Quarto CLI
Publish Quarto documents and websites from the command line. Requires Quarto version 1.9 or higher.
You can publish Quarto documents, websites, books, and dashboards to Connect Cloud directly using the Quarto CLI. From your project directory, run:
quarto publish
Select Posit Connect Cloud from the list of available providers.
The first time you publish, Quarto will open your browser to authenticate with your Posit account. After authorization, your content is rendered and deployed automatically, and a _publish.yml file is created in your project to record the content ID and URL for future updates. This file does not store credentials and is safe to check into version control.
For more information, see the Quarto publishing documentation.