Running a Rshiny app locally

Morning,
Can I run an R shiny app locally on the R studio IDE session? The requirement is to run and save apps on the local machine (data and the app is stored within the companies network). Running and saving R shiny apps the cloud or the shiny server are not viable options.

Sure just use runApp:

runApp(appDir = "path or app object goes here", port = 80, launch.browser = FALSE, host ="0.0.0.0")

How often is the package patched i.e monthly, fortnightly etc.
To prevent users from uploading apps on the cloud, I will blacklist the URL at the proxy, will that break any functions within the IDE session.
Is there a way to prevent users from downloading the open source server, is there other ways to block publishing apps on the web or keeping the app locally.

Can you provide more details about your deployment strategy and setup? If you are planning to distribute the app as code that others are going to execute on their own R sessions, then blacklisting an URL is going to do nothing to prevent your app reaching the public internet.

If you say, "data and the app is stored within the companies network", then what is the problem with using a local instance of shiny-server? That way you will not have to distribute the source code to the users in order for them to use the app.

Within our environment we have R studio, a user will pull the package from the companies repository. The repository is a folder that contains r studio packages. The shiny app (graph) will be uploaded on the teams intranet page. Due to the data the app cannot be published on the public internet or shared externally. Due to the data the solution has to be on premise, essentially no external hosting or access.

Shiny server cannot be deployed in our environment, we have no linux operating system machines, additionally the business will have to pay a resource to maintain and deploy the server.

I don't see a way for you to effectively protect the app if all users have access to the source code.

You could run the app on a Docker container and expose that to the local network, or install shiny-server on WSL if you have Windows machines.

We are not allowed to use Docker in the environment. What do you mean by 'all users have access to the source code.'

That is what I get from this, isn't your app developed as an R package that others install and run in their own environments? If I'm wrong, can you please clarify?

Apologies for the late reply.
So, the package is kept in the companies r studio package repository location. If a user wants to use the package, they pull from it the location in their IDE session. So, it will only run locally and shiny app will only be on their local machine. It will only be shared if they, I guess, zip it and email it or chose to advertise it on the intranet.
So, yes, I guess you are right, they run their own environments.
However, with every user running their own app, I want to make sure that the data developed using r shiny can only be locally stored. Not be externally available, accessed or stored. To do so, they cannot use the cloud, and the shiny server is not possible due to resourcing issue. So, the only option is the IDE, however I am quite unfarmilar with the technology behind r studio and due to lack of skills no one can answer my questions, nor know how r studio is configured/downloaded on the network.

I'm still not understanding what is your specific question but I'm going to try to clarify some things.

Nor R, Shiny or RStudio can restrict file access permissions. That would need to be handled at the operatin system level.

Actually, you don't need the IDE to run the app locally, you just need R and the shiny package. The integration with the IDE only facilitates opening a browser window pointing to the correct port.

okay, I will break up my questions.

  1. Where is the data stored when I develop a Rshiny app using R studio
  1. When I develop an app, save it, hit run app in R studio, how is it published, how does the app run? internet?

Wherever you set it to be, data storage is not provided by R.

  1. When I hit publish, assumption here, it will open a web browser. Can this, be externally seen / accessible if the external new the address.

The publish button is a commodity for "publishing" your app either on shinyapps.io (on the cloud) or Posit Connect (on premises or the cloud).

In general, the code gets copied into a container, the container gets executed and a session of your app gets exposed either to the public internet or to your local network (depending on where are you publishing and how is your infrastructure configured).

Is the container on premise ? or depends on how we have configured it

It depends on where you are publishing the app

Also, just to clarify. You where talking about distributing your app as a package whitin your network, and that is a completely different scenario to publishing your app.

thank you, I not sure if we have Posit Connect on premsise. So need to confirm that.

This is only aplicable when you are publishing to Posit Connect, which is a commercial product that needs to be installed on a Linux server either on premises or in the cloud.

There is a difference between running the app and publishing the app (e.g. to shinyapps.io) - see discussion above.
However, if you hit just "run app" then yes a browser opens (to show the content of the app) but it refers to the local storage, the harddrive were your application resides.
The data should not be sent to the "internet".
You may test this by using a computer with Wi-fi off or network cable unplugged...