The easiest way to get Rstudio Shiny server in an AWS EC2 instance
If you are a data scientist who has an R shiny app running locally and you want to share it with the users in your organization, hosting it on a server that the users can access would be a good choice.
Here we will look at how we can do it in AWS.
The easiest option to spin up an EC2 instance with R is to use the Amazon Machine Image(AMI) for R-studio / Shiny. The first step when we launch an EC2 instance would be to choose an AMI, which is a template with a set of software configurations. Louis Aslett is maintaining AMIs for RStudio server. He has done a great job of developing and maintaining this. Thanks to him. We can choose the AMI based on the AWS region we want to launch the instance from here https://www.louisaslett.com/RStudio_AMI/.
I am not explaining here the steps to launch an instance as there are many tutorials you can find on the internet. Once the EC2 instance is launched successfully, navigating to the IP address of the instance would take us directly to RStudio. You should see the below screen.
You can log in with
- Username: rstudio
- Password: <EC2 Instance ID>
Shiny app
Shiny apps can be accessed at /shiny/username
For example, with the default user rstudio, the Shiny App will be in /shiny/rstudio
We can copy our Shinyapp code to a folder named ShinyApps
in the user’s home directory.
Hope this quick tip was helpful. I find this the easiest way to launch RStudio in AWS for data scientists, who aren’t comfortable with Linux to SSH and install the required software.