简体   繁体   中英

R- Shiny webserver on a local server

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 should make following:

  1. Find your IP ("ipconfig" from cmd prompt in Windows)
  2. 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")

  3. 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/

When using Shiny localy the library set a server in which you can access the Shiny application. If you want to make it accesible on a LAN you have to set up a Shiny server .

You will need a Linux server with R and Shiny instaled, in addition to all the libraries your application needs. To configure it you can follow this

Once the server is totally configured you can add your own applications to the server adding the applications to the folder:

/srv/Shiny-server/myApp

And will be available in yourServerAddress:3838/myApp

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM