9

I created an R Shiny application that I'd like to share with my co-workers within my network. I tried hosting the app on my computer so that other users from the network could access it and use it with their data files.

I tried:

    runApp("appname",host="0.0.0.0",port=3986)

And also:

    runApp("appname",host="DNSMachinename")

The latter attempt resulted in the following error:

While my colleagues are able to acceess the app, it doesn't really run like it does on my machine. Thanks for the help.

user1922730
  • 303
  • 4
  • 10
  • Maybe think about using shiny server on AWS. I can post more detail as an answer if you'd like. AWS can restrict the access at IP level and shiny server itself has authentication built in. – B.Mr.W. Sep 17 '14 at 18:55
  • Is there a possibility to set up an old computer as a server that hosts the Shiny app? I would love to move to AWS, but at this point I am one of the few pushing for using Shiny and R in the work place, and I'd need to display the value we can get to justify a migration towards AWS. – user1922730 Sep 18 '14 at 13:11
  • I posted some information below which I think is helpful for setting up an R environment for a team. – B.Mr.W. Sep 18 '14 at 16:49
  • I've had success sharing apps with coworkers on my network by setting up shiny server on a virtual machine on my workstation. Ultimately, though, we moved to AWS. – Matthew Plourde Sep 19 '14 at 11:52
  • That's the step that I am trying to take, once my superiors see the value I think we are at a scale that requires AWS or something equivalent. – user1922730 Sep 19 '14 at 14:56
  • Hi @MatthewPlourde I found your question and would like to know the steps that you took to host it on your company's internet network. Is this the right sequence: 1. Set up VM and install Linux 2. Set up Shiny Server 3. Host it on the computer There are gaps in my understanding in order to enable execution, I was wondering if you could post your solutions? Thanks! – user1922730 Sep 19 '14 at 19:32
  • I used virtualbox with the extension packs. I remember having to mess around with the network adapter settings in order to make it visible to others on the network. I think I used NAT to connect the VM to internet to get everything I needed to install, then switching to Bridged Adapter to allow others to see it. AWS does have a free tier, however. This might be the easiest option for you to take. I remember my apps have very low performance over the network when I hosted them on the VM, but this may have been idiosyncratic to my situation. – Matthew Plourde Sep 19 '14 at 19:42

3 Answers3

4

The shiny tutorial list a number of ways to share your app. I particularly hosting a zip file somewhere with the app, and letting your co-workers use runUrl to automatically download the app and run it locally. In this way people can continue to run the latest version of the app, but it does not run on your machine.

Jilber Urbina
  • 58,147
  • 10
  • 114
  • 138
Paul Hiemstra
  • 59,984
  • 12
  • 142
  • 149
  • Thanks, I am trying to make my organisation use R and Shiny, but there are not many of us who are proficient in R. So what I am hoping is to let users use these apps but by deploying it within the organisation's network and not on the web, due to the sensitivity of the data. – user1922730 Sep 17 '14 at 18:07
  • The solution I suggested does not involve posting the app on the internet. This kind of solution can function fine within an intranet situation. As long as there is a URL, in the local company network or on the internet, you can use this solution. This however does require the people running the app having R installed. The only other alternative I see is to use a dedicated server to host the app. – Paul Hiemstra Sep 17 '14 at 19:30
4

Since you showed your interest in Shiny server, and it might be more convenient for me to just post a few thoughts in the "answer" since it won't fit well in the comment.

Since you have a group, and I would highly recommend you take a look at R server and shiny server.

(1) Shiny server

You can totally install Shiny server on a old computer and I would recommend using Linux OS like (Ubuntu) and it will save you some time following the tutorial. We have a cluster and we used one of the servers there to host a shiny server and shiny server at the same time. And only internal employee can access it and it is within company's network.

(2) R server

I am not exactly sure which environment you are using to program R but if you want to evangalize R in your team. Have a stable environment that could be accessed by everyone inside your company with authentication is a good way to get started.

(3) shinyapps.io

Is a free platform that you can host your shiny app, it is in alpha version and I don't think there is much authentication or security built in. HEREenter link description here is an example hosted on shinyapps.io

(4) AWS free tier

If you have never used AWS before, you can have a micro instance running on AWS free for one year! I would highly recommend using AWS instead F* around with a old computer.

B.Mr.W.
  • 18,910
  • 35
  • 114
  • 178
  • Thanks for the information. To my understanding only the Professional Edition of Shiny Server offers authentication eh? The trick at this point is to deliver something that is secure, free and accessible to non-R users, a tough nut to crack but if I pull it off, funding will come. – user1922730 Sep 18 '14 at 17:04
4

If you are still trying to get buy-in for your server or cloud solution, I just finished developing the RInno package for this exact problem, i.e. when a company will not pay for Shiny Server or there are security concerns with cloud services.

To get started:

install.packages("RInno")
require(RInno)
RInno::install_inno()

Then you just need to call two functions to create an installation framework:

create_app(app_name = "myapp", app_dir = "path/to/myapp")
compile_iss()

If you would like to include R for your co-workers who don't have it installed, add include_R = TRUE to create_app:

create_app(app_name = "myapp", app_dir = "path/to/myapp", include_R = TRUE)

It defaults to include shiny, magrittr and jsonlite, so if you are using other packages like ggplot2 or plotly, just add them to the pkgs argument. You can also include GitHub packages to the remotes argument:

create_app(
    app_name = "myapp", 
    app_dir  = "path/to/myapp"
    pkgs     = c("shiny", "jsonlite", "magrittr", "plotly", "ggplot2"),
    remotes  = c("talgalili/installr", "daattali/shinyjs"))

If you are interested in other features, check out FI Labs - RInno

Jonathan Hill
  • 1,745
  • 15
  • 25