Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
cloud-config script to setup Rstudio server and Shiny server on Ubuntu 14.04 on Digital Ocean
# In order to access RStudio server via the web interface, you must log on with
# a user account that allows password access. This script does not add that user
# by default. You may either ssh as root into the server and `adduser` as
# normal, or script a user addition here:
# users:
# - name: # username #
# lock-passwd: false # allow login with password
# passwd: # hashed password #
# Add apt mirror to get the latest version of R necessary for Shiny
- source: deb trusty/
keyid: E084DAB9
package_upgrade: true
- nginx
- libxml2-dev
- libcurl4-gnutls-dev
- libssl-dev
- r-base-dev
- libapparmor1
- gdebi-core
- git-core
# Forward ports for Rstudio and Shiny
- path: /etc/nginx/sites-enabled/default
content: |
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /usr/share/nginx/html;
index index.html index.htm;
# Make site accessible from http://localhost/
server_name localhost;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
location /shiny/ {
location /rstudio/ {
# Install "shiny" package for R
- R -e 'install.packages(c("shiny", "rmarkdown"), repos="")'
# Download and install rstudio-server
- wget
- gdebi -n rstudio-server-0.99.892-amd64.deb
# Download and install Shiny
- wget
- gdebi -n shiny-server-
# Clean package files
- rm *.deb
- service nginx restart

This comment has been minimized.

Copy link
Owner Author

commented Sep 1, 2015

This is totally indebted to Dean Attali's tutorial on how to manually set up RStudio server and Shiny on DO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.