Eric Guo's

Hoping writing JS, Ruby & Rails and Go article, but fallback to DevOps note

Install Shiny Server in Ubuntu 12.04


R package Shiny originally not support R Studio Server, so shiny.R need change before install

install shiny package for R Studio
cd ~
tar xvfz shiny_0.13.2.tar.gz
vi shiny/R/server.R
# search 'Listening on http://' and replace 'startServer(host, port' to 'startServer("", port'
# search 'Test port to see if we can use it' and replace 'try(startServer(host, port' to 'try(startServer("", port'
# search 'QtWebKit' and replace 'paste("http://", browseHost,' to 'paste("http://", "",'
tar cvfz shiny_0.13.2-server.tar.gz shiny
R CMD INSTALL shiny_0.13.2-server.tar.gz # (may need install htmltools before this line)
service rstudio-server restart # if you previous install shiny from CRAN

Before install shiny server, make sure you install node.js version 0.8.17 or higher and meet prerequisites.

install shiny-server
npm install -g shiny-server # install shiny-server

or use the offline install mode:

git clone
cd shiny-server/
node tools/bundle-offline-installer.js
mv shiny-server-0.3.0.tgz ..
cd ..
npm install --no-registry -g shiny-server-0.3.0.tgz

The sample shiny server config file.

run_as shiny;
log_dir /var/log/shiny-server/;
server {
listen 3838;
location /first {
app_dir /var/shiny-server/first;
location /diamonds {
app_dir /var/shiny-server/diamonds;