title: | | Instructions on how to deploy ShinyCell apps online author: | | John F. Ouyang date: "Feb 2021" output: pdf_document: default html_document: toc: true toc_depth: 2 toc_float: collapsed: false fontsize: 12pt pagetitle: "4cloud"
The shiny app generated by ShinyCell can be easily deployed in a variety of ways, namely via (i) https://www.shinyapps.io/, (ii) an in-house server using R Shiny Server or (iii) other cloud computing platforms e.g. Amazon Web Services (AWS). The ease and availability of several cloud options is due to the use of R Shiny backend, which is designed to be easily deployed online.
One of the simplest way to deploy the shiny app is via the dedicated online
service https://www.shinyapps.io/. First, one has to register for an account,
which will prompt the user to create an account name ACCOUNT
that will
constitute part of the URL of the eventual shiny app. After registration, one
has to setup the connection between your R / RStudio and shinyapps.io via the
code below. One can then then upload the shiny app by specifying the shiny app
directory shinyApp/
and the app will be available online at
https://[ACCOUNT].shinyapps.io/shinyApp/
. For more details, refer to the
shinyapps user guide.
install.packages('rsconnect') # package to interface shiny apps
library(rsconnect)
rsconnect::setAccountInfo(name="<ACCOUNT>",
token="<TOKEN>",
secret="<SECRET>")
rsconnect::deployApp("shinyApp/")
If you have access to a linux-based server within your institution, you can deploy the shiny app on the server via R Shiny Server. This will require the installation of R and R Shiny Server on the server and the installation details of R Shiny Server can be found here.
After installing R Shiny Server, the shiny app can be deployed by placing the
entire folder shinyApp
into the directory /srv/shiny-server/
. The shiny
app can then accessed via [IP-address-of-server]:3838/shinyApp
. For more
details, refer to the
Administrator’s Guide.
Depending on how the internet network is set up within your institution, it is often that the IP address of the server is only accessible within the institution's local network for security reasons. In that scenario, the shiny app is only accessible to other members in your institution and an internal shiny app can be setup for sharing with wetlab coworkers. If users wish to make the shiny app available for public access, they may have to contact their institution's IT department to lift any network restrictions.
Another way to deploy the shiny app online is to use cloud computing platforms such as Amazon Web Services (AWS). This will ensure that the shiny apps can be accessed publically as these services are independent from the institution's local network. Here, we will briefly outline how to deploy shiny apps on AWS. There are three main steps, namely (i) creating a new Elastic Compute Cloud (EC2) instance, (ii) installing R and R Shiny Server and (iii) deploying the shiny app.
There are several online tutorials that describe these three steps in detail, such as https://towardsdatascience.com/how-to-deploy-your-shiny-app-to-aws-856587cd412c and https://www.charlesbordet.com/en/guide-shiny-aws.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.