You can definitely handle the availability of an application, the port it listens on, etc. through runApp. The pieces of the pie that you will be missing and that shiny server handles for you are (not an exhaustive list):
- starting up / tearing down an R process when requested / no longer needed
- hosting multiple applications
- handling restarting the app if / when the R process crashes
Obviously, in some cases, it is easier to just use runApp to make the app available. In other cases, if you decide you need Shiny Server, the following outlines situations where you need root. In the absence of this situation, you should be able to run Shiny Server without root privileges (as any user you like).
Aside from spawning R Shiny processes as particular users, the shiny-server process itself can be configured to run as different users to control its privileges. There are many scenarios in which Shiny Server would need to be run as root:
- If user_apps or user_dirs is enabled for any location. In order to host applications as various users, Shiny Server must have root privileges.
- If your configuration uses run_as to spawn applications as multiple different users.
- If you're running any server on a privileged port (a port in the range of 1-1024).
- If you're using auth_pam to leverage PAM authentication. (Pro only)
- If you're using auth_google and store your client secret in a file. (Pro only)
- If you specify a value for metrics_user (Pro only)