I would like to know what port R shiny will use to display the app. I can see on some forums that the port should be 8100, but when I run the app, the chosen posrt changes every time R is restarted.
Is there any way to specify this port? Or at least to know the port that will be used, to use it in another part of the script?
The server running on port 3838 defines two locations. The first is at the URL /users , which makes user applications available using the user_dirs hosting model, as documented in the Host Per-User Application Directories section of the Shiny Server Administrator's guide.
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 this post you'll see a few ways of how to organize your files to be served locally.
Open C:\xampp\apache\conf, find the httpd. conf file and open with notepad++. Look for these lines and change 80 in the last line any other port, for example 8080. This way we will be able to run Apache but the http://localhost/url won't work for that you need to append port number into the URL.
Open the app. R script in your RStudio editor. RStudio will recognize the Shiny script and provide a Run App button (at the top of the editor). Either click this button to launch your app or use the keyboard shortcut: Command+Shift+Enter (Control+Shift+Enter on Windows).
There is a port=
parameter you can specify to runApp
. The default value is NULL
which chooses a random port. Read the ?runApp
help page for more information.
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