0

I want to deploy shinyApp in local server. Is there any such code by which I can deploy shinyApps in local server.

When I run shinyApp locally on desktop, it runs by IP: http://XXX.0.0.1:XXXX/ Every time I run the shinyApp it runs with different port number. I want to configure IP address at local server for shinyApp. I don't know how to do it. Is there any syntax/function like "rsconnect" to deploy shinyApp in local server? We know how to connect to MySQL. Similarly any such code by which we can connect to local server IP? code for connecting to MySQL:

library(RMySQL)
mydb = dbConnect(MySQL(), user='######', password='#######', dbname='#####', 
host='###.##.###.###', port=####)

Any help would be greatly appreciated.

Sanky Ach
  • 333
  • 8
  • 23
  • Check out `?shiny::runApp` – Radim Dec 31 '18 at 07:29
  • But my question was about a server which is locally available. – Sanky Ach Dec 31 '18 at 08:14
  • Not the desktop as local. Our company's own server, where I would like to port the R shinyApp files and host from that server. – Sanky Ach Dec 31 '18 at 08:15
  • I believe it's more of a network issue than a shiny issue. You can assign a static IP to the desktop which hosts the shiny app. Regarding the port, you can specify it in `runApp()`. Then you would have a fixed IP+port. shinyApps is a PaaS. You can't deploy it locally. – Omri374 Dec 31 '18 at 09:20
  • to host shiny apps on a server, you need to install `R` and [Shiny-server](https://www.rstudio.com/products/shiny/shiny-server/) first... then configure the settings such as port via `runApp()` – Radim Dec 31 '18 at 11:54
  • Is that IP 127.0.0.1 by any chance? If so, that's localhost which only the local machine can access. You can run the app on 0.0.0.0 to make it accessible from other machines. See https://stackoverflow.com/a/53597061/2640469 – greg L Dec 31 '18 at 13:43

1 Answers1

1

Set the default values you want to initialize in (~/.Rprofile) under user directory

options(shiny.port = 9999)
options(shiny.host= xx.xx.xx.xx)
RKC
  • 33
  • 5