10

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

ngwells
  • 188
  • 1
  • 1
  • 8

3 Answers3

29

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)
user1693885
  • 493
  • 4
  • 5
  • 1
    how do you keep it running even after a user x's out from the browser? – road_to_quantdom Feb 10 '19 at 04:25
  • 1
    This is terrible for hosting multiple apps. Need something like shiny proxy that only opens the app when someone tries to access it. – Frank May 14 '20 at 14:09
  • 1
    It actually works, surprisingly well. We run dozens of apps on it for years before buying RStudio – clnreanu May 14 '20 at 20:28
  • @clnreanu I wonder if this solution works with simultaneous users who run the same functions by applying different filters etc? – maydin Aug 08 '20 at 15:32
  • 1
    @maydin yes it works, each user sees his/her own instance – clnreanu Aug 09 '20 at 06:03
  • I wonder if this solution works with huge numbers of simultaneous users(20+) – KmnsE2 Nov 04 '20 at 16:09
  • I don't know why but simply setting `host = "0.0.0.0"` works for me just as well as the solution that fetches the ip from within R. `0.0.0.0` seems to get automatically translated to my host computer's IP4 address as I can connect to the app from a different computer via `http://[ip of my host computer]:1234`. – Snoeren01 Apr 19 '23 at 07:35
5

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.

Paul Hiemstra
  • 59,984
  • 12
  • 142
  • 149
  • What about through a virtual machine? – Roman Luštrik Apr 17 '13 at 05:55
  • 1
    If you install Linux on the virtual machine than you can install Shiny Server on that machine. – Paul Hiemstra Apr 17 '13 at 06:09
  • @PaulHiemstra I have been able to set up Shiny Server on a Linux VM. By using a bridged network I can also access the Shiny application on my Windows Server (also a VM currently) and host machine (Windows 10). On my Windows Server I have setup an IIS web server. Do you have an idea how I can route my application to run as part of a website hosted on an IIS web server? I am tied to finding ways to do this due to IT infrastructure, and I want to find ways to incorporate R and R Shiny in our workflow and make them available for co-workers but also external parties. – smoens Feb 11 '18 at 11:54
1

Using

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

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

Dieter Menne
  • 10,076
  • 44
  • 67