Hosting an R Shiny app on your VM

This guide assumes you have spun up an Ubuntu 20.04 LTS VM on CloudCIX with the appropriate compute resources (RAM/storage) for your Shiny app and tools for working on a VM (see Installing Basics)

For simple apps, 1 CPU, 2 GB RAM and 10 GB storage should be sufficient.

The following firewall rules should be added to your VM to allow the appropiate traffic:

Action

Source

Destination

Protocol

Port

Explanation of firewall rule

Allow

your_public_IP

10.0.0.0/24

Any

-

Grants your IP access to all VMs in CloudCIX project

Allow

*

private_IP_of_VM/32

TCP

80

Required later for certbot access

Allow

*

private_IP_of_VM/32

TCP

443

Allows encrypted web traffic access to Shiny app once reverse proxy server is set up

Install Shiny server by following the instructions for Ubuntu.

Note

Installing R with sudo apt-get (as specified in the Install Shiny Server instructions above) installs R version 3.6.3. If you require a more recent version, you can install R on Ubuntu from CRAN repository by following method 2 here: https://phoenixnap.com/kb/install-r-ubuntu

Your Shiny app should now be accessible at the following address: VM_public_IP:3838/your_shiny_app_name