Skip to content

Instantly share code, notes, and snippets.

Last active August 9, 2022 11:46
  • Star 13 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mdlincoln/1f40f4e88ce32c55b5f3 to your computer and use it in GitHub Desktop.
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
Copy link

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

Copy link

tiwo commented Aug 28, 2019

line 16: Using only the short form to identify the key seems to be ambiguous and renders whole package signing useless:

# gpg --receive-keys E084DAB9
gpg: key 4359ED62E084DAB9: public key "Totally Legit Signing Key <>" imported
gpg: key 51716619E084DAB9: public key "Michael Rutter <>" imported
gpg: Total number processed: 2
gpg:               imported: 2

Use the full fingerprint instead, E298A3A825C0D65DFD57CBB651716619E084DAB9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment