Chapter 9. R for your Organization – Managing the RStudio Server

This chapter covers the following topics:

RStudio was originally designed as a web application that was to be run on a Linux-based server. Many RStudio users encounter the desktop version initially, but the server version is essential for easy administration of R and RStudio in organizations allowing users to perform expensive computations on big data, and thus, escaping the limitations of personal computers.

In this chapter, you will learn how to manage the server version of RStudio and Shiny. It may not teach you everything you need to know in order to administer the server for your organization, but it should enable you to help your systems administrator install and manage an R system that effectively serves the needs of your organization.

Head over to https://aws.amazon.com and click on the Create an AWS Account button. Every new AWS account includes a bunch of free-of-charge services. In the so-called Free Tier, you get Amazon EC2 for 750hrs/month, 5GB of storage on Amazon S3, and more free of charge services for the first 12 months.

Creating an AWS account

After entering your login credentials, you need to fill out your contact details and enter your payment information. Next, you need to process the identity verification in three steps. Finally, choose a customer support plan and you are ready to go.

After launching the management console, you get the total overview of all AWS services. This may look kind of overwhelming at first glance.

Creating an AWS account

I chose Frankfurt as my server location. Of course, you can select any of the given regions. The different web services are sorted by their possibility of usage and purpose.

As of today, there are the following fields of use, which in turn include various services and tools:

So, there is a service for pretty much any purpose. First, we dedicate ourselves to the scalable cloud storage in the cloud, which is called S3. Then, we need the Compute section, which includes the EC2. This service can be seen as a remote server, host, computer, and machine; its specifications are flexible and can be changed easily. In the following sections, you will learn, step by step, how to store your analysis data on an S3 cloud storage system, and how to install and configure the RStudio Server on a virtual cloud server by using EC2.

Creating an AWS account

The Amazon S3 represents our desired way to store big data for our analyses since it is particularly user-friendly. Furthermore, five gigabytes of storage is free. Setting up a so-called S3 bucket is a quick and easy process.

Click on EC2 to get to your EC2 Dashboard. Here, you need to click on the blue Launch Instance button. Now, you need to follow a seven-step wizard to launch your instance.

The third step of the launching process focuses on configuration options. If you need help, every configuration option offers a question mark icon with explanations and further information. In this step, we first add a new, so-called IAM role and second user data, which installs the R, RStudio, and Shiny server on your micro instance.

Configuring instance details

The reason and purpose of AWS' Identity and Access Management (IAM) is stated in the following paragraph:

We need to create an IAM role to allow the software we want to install, which are R, RStudio, and the Shiny server, to access the AWS services and make secure API requests. Furthermore, we need this IAM role to read data from the S3 bucket that can store our data and more. As a reminder, in our free account, we also got five gigabytes of free storage for Amazon's cloud storage service called S3.

Our instance is now launched and running. The next step is to establish a connection with the server in order to complete the desired setup by installing R, RStudio, and the Shiny server.