install.packages('rsconnect')
Deploying Your Survey
Preparing to deploy
Before deploying your survey, make sure everything is working locally. You should have done the following:
- You have locally previewed your
app.R
file by clicking the “Run App” button in RStudio or in your R console running the codeshiny::runApp('app.R')
. - You have set up a database connection to store survey responses (e.g. using Supabase) and have already added the database parameters in the
sd_database()
function in yourapp.R
file (see the Store Data page). - You have set the password for your survey using
surveydown::sd_set_password("my_password")
using the password you set in the Supabase project (see the Password page).
With these steps completed, you are ready to deploy your survey online.
Deploying to shinyapps.io
Deploying your survey is pretty much the same as deploying any other Shiny app. We recommend using shinyapps.io to host your survey as it is designed to work with Shiny Apps, but you can also use other hosting services.
You may have deployed other Quarto documents on Quarto Pub before, but this site is only for static websites, so you SHOULD NOT use Quarto Pub for your survey deployment.
To start using shinyapps.io, you’ll need to create an account and follow the basic instructions to set up your sub-domain and authorize your IDE. See more information here.
Once you have your account and sub-domain ready, make sure you have the rsconnect package installed. You should have done this while authorizing your IDE, but in case you didn’t, you can install it with:
Then to deploy your survey, run:
# Define your app name with the appName parameter
rsconnect::deployApp(appName = "My Survey")
That’s it! Now you should have your survey site deployed on shinyapps.io. Congratulations! 🎉
Deploying to Other Hosting Services
You can deploy shiny apps to other hosting services. Here are some guides for several other alternatives:
You can also install Posit Connect on your own server, which is the recommended approach for remaining compliant with any security protocols your organization requires.