Thursday, April 28, 2016

Host shiny server in Ubuntu 14.04 LTS

I have installed shiny server on Ubuntu 14.04 LTS running under a VM. This post is a collection of commands that I had used for setup. Note that if you want to use shiny server on LAN than use Bridged Network Adapter.

On VM you can access shiny server via localhost:3838 and on remote machines you can use IP-address:3838 to open it. You can host your shiny app in /srv/shiny-server/ directory. You can go to /etc/shiny-server/shiny-server.conf to change default configurations like you can change port with listen <port number>; in server {} module.

$ sudo sh -c 'echo "deb trusty/" >> /etc/apt/sources.list'

$ sudo gpg --keyserver --recv-key E084DAB9

$ sudo gpg -a --export E084DAB9 | sudo apt-key add -

$ sudo apt-get update

$ sudo apt-get -y install r-base

$ sudo su - -c "R -e \"install.packages(c('shiny','shinyjs','shinydashboard','shinythemes','devtools','rmarkdown'), repos = '')\""

$ sudo apt-get install gdebi-core

$ sudo wget

$ sudo gdebi shiny-server-

$ sudo start shiny-server

$ sudo status shiny-server