Deploy

Release your app to the world 🌎 πŸŽ‰

Before deploying, ensure that a single-file app is called app.R and with multiple file apps, make sure that ui.R and server.R are present. A Shiny server will rely on these standardized file names in order to deploy properly.

PSRC Shiny Server

PSRC related apps can be hosted in-house on our very own Shiny server. Apps currently deployed from the PSRC Shiny server can be found here (VPN required):

http://aws-linux:3838/.

Before the Shiny server deploys your app:

  1. Your app files must be on GitHub. Ideally your app project should be in its own GitHub repo, e.g.:

  2. Learn some Bash commands to access and navigate the linux server. Hana, Craig, or Christy can help setup your app in the server, but it’s always good to know where your app lives and how to restart your app inside the Shiny server:

Shinyapps.io

For personal, non-PSRC related projects, there is the option of shinyapps.io. RStudio can host your Shiny app. You can publish for free but there are limits to the number of apps that can be deployed, hours used, and resources.

After you first login, shinyapps.io provides instructions to deploy your first app. It will look similar to the code below:

In the console of the RStudio IDE:

  1. Have the rsconnect package installed and loaded.
  1. Set the account information.
setAccountInfo(name=' ',
               token=' ',
               secret=' ')

You can find your account information on the front page of your shinyapps.io account before your first app is published or under Account > Tokens

  1. Deploy your app
deployApp(account = 'your_account_name', 'path/to/your/app')

Multiple Accounts

If you have more than one account with shinyapps.io:

Other Notes

If you removed an app from your shinyapps.io account and are attempting to re-publish again, double check your local project folder and remove the rsconnect sub-folder if it exists.


  1. https://stackoverflow.com/questions/26222052/have-more-than-one-shiny-accounts/26222254β†©οΈŽ