Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can i host a shiny app on a windows machine?

Tags:

r

shiny

I've registered for the beta hosting. I've tried to follow the directions for creating the shinyapps/myapp folder on my widnows machine. I can run shiny apps locally. I've installed the node.js program shiny requires but I can get the config file? I think my error message requires python? Is there an easier way to host the shiny app on a windows machine? Thanks

like image 214
ngwells Avatar asked Apr 17 '13 05:04

ngwells


People also ask

Can Shiny server run on Windows?

The shiny package and the shiny-setver service are two separate things. You can install the R package, develop and test shiny apps in Windows but you can't deploy them (in a native way) in a Windows server, although, you could use virtual machines or containers running Linux.

Can you run Shiny app locally?

You might be eager to deploy your Shiny app to a remote server. But the simplest way to run a Shiny app is to run it locally. You only need the shiny R package installed, and you can run the app in your browser.


3 Answers

a bit of a late answer: it is possible to host a shiny app on Windows.

use the following run.R script below, start it as a job on the windows machine. Do make sure that the port (below 1234) is open in the local firewall.

Enjoy!

require(shiny)
folder_address = 'H:/path to app'

x <- system("ipconfig", intern=TRUE)
z <- x[grep("IPv4", x)]
ip <- gsub(".*? ([[:digit:]])", "\\1", z)
print(paste0("the Shiny Web application runs on: http://", ip, ":1234/"))

runApp(folder_address, launch.browser=FALSE, port = 1234, host = ip)
like image 77
user1693885 Avatar answered Oct 21 '22 12:10

user1693885


From the Shiny website:

You'll need a Linux server, with the following prerequisites installed:

Node.js 0.8.16 or later For Ubuntu, we have found these instructions to work well. For Red Hat/CentOS, we recommend installing from source. R 2.15 or later Shiny R package, installed into the machine-wide site library. This is one easy way to do that: sudo su - -c "R -e \"install.packages('shiny', repos='http://cran.rstudio.com/')\""

You cannot natively host Shiny apps on a Windows machine right now. Running a virtual machine with Linux might be a good alternative.

like image 31
Paul Hiemstra Avatar answered Oct 21 '22 13:10

Paul Hiemstra


Using

https://github.com/leondutoit/shiny-server-on-ubuntu

deployment is fairly easy. Too bad, the author is not very responsive.

like image 32
Dieter Menne Avatar answered Oct 21 '22 14:10

Dieter Menne