Below we’ll cover deploying your Shiny app-package in RStudio and Positron . The Positron IDE was still in the early stages of development when this section was written, so some of these steps may change in future versions.
19.1.1 In RStudio
To deploy the app, I can click on the Publish icon:
Make sure all the files in the package are selected, then click Publish
The Deploy pane will open and you’ll see a deployment log as your application is sent to the server:
show/hide deployment log
── Preparing for deployment ────────────────────────────────────────────────────✔ Deploying "movie-reviews" using "server: shinyapps.io / username: yourusername"ℹ Creating application on server...✔ Created application with id 12692760ℹ Bundling 27 files: .Rbuildignore, app.R, data/movies.rda, data/movies.RData, DESCRIPTION, inst/extdata/movies.fst, NAMESPACE, README.md, www/shiny.png,man/display_type.Rd, man/launch_app.Rd, man/mod_scatter_display_server.Rd,man/mod_scatter_display_ui.Rd, man/mod_var_input_server.Rd, man/mod_var_input_ui.Rd, man/movies_server.Rd, man/movies_ui.Rd, man/movies.Rd,…, R/movies_ui.R, and R/scatter_plot.Rℹ Capturing R dependencies with renv✔ Found 61 dependencies✔ Created 389,882b bundleℹ Uploading bundle...✔ Uploaded bundle with id 9093617── Deploying to server ─────────────────────────────────────────────────────────Waiting for task: 1456625417building: Building image: 11062313building: Fetching packagesbuilding: Installing packagesbuilding: Installing filesbuilding: Pushing image: 11062313deploying: Starting instancesrollforward: Activating new instancessuccess: Stopping old instances── Deployment complete ─────────────────────────────────────────────────────────✔ Successfully deployed to <https://yourusername.shinyapps.io/app-name/>Deployment completed: https://yourusername.shinyapps.io/app-name//
19.1.1.1 Deploy logs
On shinyapps.io, the deployment log shows the loadSupport() warning persists (but the application still deploys. The server-side warning is a known issue.1
shinyapps[12692760]: Running as user: uid=10001(shiny) gid=10001(shiny) groups=10001(shiny)shinyapps[12692760]: Connect version: 2024.05.0shinyapps[12692760]: LANG: C.UTF-8shinyapps[12692760]: Working directory: /srv/connect/apps/movie-reviewsshinyapps[12692760]: Using R 4.4.0shinyapps[12692760]: R.home(): /opt/R/4.4.0/lib/Rshinyapps[12692760]: Content will use current R environmentshinyapps[12692760]: R_LIBS: (unset)shinyapps[12692760]: .libPaths(): /usr/lib/R, /opt/R/4.4.0/lib/R/libraryshinyapps[12692760]: shiny version: 1.9.1shinyapps[12692760]: httpuv version: 1.6.15shinyapps[12692760]: rmarkdown version: (none)shinyapps[12692760]: knitr version: (none)shinyapps[12692760]: jsonlite version: 1.8.8shinyapps[12692760]: RJSONIO version: (none)shinyapps[12692760]: htmltools version: 0.5.8.1shinyapps[12692760]: reticulate version: (none)shinyapps[12692760]: Using pandoc: /opt/connect/ext/pandoc/2.16shinyapps[12692760]: shinyapps[12692760]: Starting R with process ID: '31'shinyapps[12692760]: Shiny application starting ...shinyapps[12692760]: Warning in warn_if_app_dir_is_package(appDir) :shinyapps[12692760]: Loading R/ subdirectory for Shiny application, but this directory appears to contain an R package. Sourcing files in R/ may cause unexpected behavior. See `?loadSupport` for more details.shinyapps[12692760]: ℹ Loading sapshinyapps[12692760]: shinyapps[12692760]: Listening on http://127.0.0.1:123456
19.1.2 In Positron
After loading, documenting, and installing our app-package, we can deploy it in Positron using the rsconnect::deployApp() function.
As we can see, Positron doesn’t open a Deploy window or separate Terminal task for launching the application (it’s printed directly to the Console).
19.2 The rsconnect folder
When deploying a Shiny app, the rsconnect/ folder is automatically created to store configuration settings and deployment metadata for the app. Below are a few points to consider with regard to this folder: