Skip to content

Shiny Server on Digital Ocean Droplet (RhettRautsaw.app)

Notifications You must be signed in to change notification settings

RhettRautsaw/ShinyServer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Shiny Server

https://RhettRautsaw.app/

This repository contains the html code for my Digital Ocean Droplet welcome page which contains my Shiny applications and my RStudio Server. This repository also contains notes to remind myself how to run the damn thing.

Disclaimer

The code and asthetics of my server is based entirely on the work of Dr. Saskia A. Otto. Including her tutorials on how to setup the server:

Which she built off of the tutorial by Dean Attali:

Personal Notes

Important Server Locations

The shiny apps are located here:: /srv/shiny-server/

  • I prefer to just have my Shiny Apps listed in the hexagons on my welcome page, but you can have a shiny page html located here /srv/shiny-server/index.html for RhettRautsaw.app/shiny

The website html is managed by nginx.

  • The welcome page html is located here: /var/www/html/
  • Once updated, you will need to restart nginx: sudo service nginx restart

Shiny configuration file is located here: /etc/shiny-server/shiny-server.conf

How to change the Droplet/Hostname

  • Got to DigitalOcean.com and rename the Droplet
  • On the server edit /etc/hosts and /etc/hostname

How to change the custom URL:

  • Buy a URL somewhere and then do this
  • Go to your DigitalOcean.com and do this
  • Edit "server_name" in /etc/nginx/sites-enabled/default
    • Note that everything else is probably managed by Certbot
  • Verify nginx syntax sudo nginx -t and correct any errors
  • Reload nginx sudo systemctl reload nginx
  • Obtain an SSL Certificate with Certbot
    • sudo certbot --nginx -d example.com -d www.example.com

In case I need to add a app session timeout: https://stackoverflow.com/questions/33839543/shiny-server-session-time-out-doesnt-work