1

I am trying to host a Shiny app on a machine hooked up to a LAN. In the directory housing my app, I have the server.R, ui.R, and launcher.R scripts. The launcher.R file looks like:

#!/usr/bin/Rscript
library(shiny)
setwd("~/path/to/shinyApp/")
shiny::runApp(host="0.0.0.0",port=4414)

When I run this via RStudio, the app launches, behaves normally, and can be accessed by other machines through the LAN by going to 987.65.43.21:4414 in a browser. When I run the app with launch.browser=T, the address reads 127.0.0.1:4414.

I want to be able to run the launcher and host the app without RStudio running. When I try running the launcher code via command line, the app gives the usual messages

Loading required package: methods
Listening on http://0.0.0.0:4414

but I cannot access the app through a LAN browser. If I navigate to the 127.0.0.1:4414 on the host machine, I can access it, but not via the machine's IP on another machine like I could when running RStudio.

Does anyone have any insight on what could be going on? Thanks!

NWaters
  • 1,163
  • 1
  • 15
  • 27
  • I'm interested in knowing if you found a solution here. It's obviously been a while since this was posted, but I'm in a situation where I can only host my script on a windows device (so `shiny-server` is not an option), I'm not ready to share this on shiny io, and I want my other users to be able to start this script up without having to open R. Any luck? – Dorton Feb 01 '22 at 03:41
  • Hi @Dorton, its been a long time since I though about this but I ended up just leaving Rstudio running in the background. Not the most satisfying ending to the story unfortunately! – NWaters Feb 07 '22 at 03:53

1 Answers1

2

Install shiny-server from here this will allow you to access your shiny apps from your LAN. Just put your shiny files in /srv/shiny-server/myApp and you can access them through xx.xx.xx.xx:3838/myApp/

RmIu
  • 4,357
  • 1
  • 21
  • 24
  • 2
    Thanks for the idea; the machine I am trying to use as a host is a Mac, which isn't supported for Shiny Server. I may try to compile from source, but any ideas for how to make it work without Shiny Server? – NWaters Dec 09 '15 at 15:58