I have a windows machine with IIS and I can see the IIS welcome page on http://myname/
. I have recently started using Shiny through its own server and I can see shiny apps on http://127.0.0.1:port
Now my question is how can I allow others to see my shiny apps on http://myname:port
? (since 127.0.0.1 is not accessible from other computers). Is this possible with the free version of shiny?
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.
In the File menu, under New File, select Shiny Web App…. When prompted, choose a name for your project. Select Multiple File and choose a directory to store the new app's files. To test the project locally, click Run App in the upper right corner of the text editor.
The easiest way to turn your Shiny app into a web page is to use shinyapps.io, RStudio's hosting service for Shiny apps. shinyapps.io lets you upload your app straight from your R session to a server hosted by RStudio. You have complete control over your app including server administration tools.
You should make following:
Set Shiny to start from port "XXXX" and your IP (instead of 127.0.0.1)
For example:
options(shiny.port = 7775)
options(shiny.host = "192.0.0.45")
Run your App
runApp(app)
Make sure the port is opened in your firewall.
To be a bit more precise, this is how your file startApp.R
might look like:
library(shiny) options(shiny.host = '0.0.0.0') options(shiny.port = 8888) runApp('shinyapp')
This is an example of how you would set the options if Shiny was running behind nginx with tcp.
The comments have already said this, but in the interest of providing an answer:
You can use shiny server (free and pro) to host apps on your own server. I believe this will allow you to set it up on http://myname/, however shiny server should be running in a linux environment as listed by @pops.
https://www.rstudio.com/products/shiny/shiny-server/
Or
you can use shiny.io to host them for you, with premium versions having the ability to set your own domain
https://www.shinyapps.io/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With