Change .rstudio from Rstudio server

.rstudio is at home folder by default. In our system, we have several RStudio Servers installed. And .rstudio folder is shared and overwritten, which causes many problem.

The customization feature had been request years ago, but I cannot find it has been implemented. Any solution?



Could you give a bit more details about what you are asking? What OS are you on, and exactly what behavior are you hoping to get?


Thank you for the reply. I am on the RedHat linux system. And we have installed Rstudio servers on several machines and VMs, with the same home directory mounted. Therefore, all Rstudio servers share the same .rstudio folder by default.

I would like to customize the location of .rstudio directory (not at the user home directory by default), so as to avoid the .rstudio information overwritten from the use of different Rstudio servers.



We would not recommend mounting the same home directory onto multiple servers. Even if you are able to customize the location of .rstudio, you will have problems when people are working on projects at the same time.

I'm going to guess that you are doing this in order to share code and data. Instead of mounting the same home directory for everyone, you should let everyone have separate home directories, and mount your code and data to a separate directory. If you want to encourage people to use this separate directory for their R sessions and projects, you can use RStudio server options to set the default directory for new projects and new R sessions.


We have our own home directories. I am not to share code with others.

I am talking about my home directory, which is mounted to different servers. I have accounts of several Rstudio servers which all use the same location for .rstudio (ie. my home directory).


We don't recommend running multiple servers against the same home directory, but you can achieve what you want by creating replacing the .rstudio folder in your home directory with a symlink that points to a local disk path. Full instructions at the end of this article:

I had read this article already, which addresses the issue about disk space. Please note, this just changes the location by symlink, but it does not solve the issue due to the use of the same .rstudio.

Here, I think it might be simple to have a global option in the RStudo, to customize the location of .rstudio rather than the default location at the user home folder.



A symlink can point to any named location. You can name a location which is different on every server (such as one in /tmp or /opt) in order to use a different .rstudio folder on each server.

Just to be sure, load balancing mechanism in Rstudio Server Pro allows multiple servers to share the same /home on a shared storage. Right ?
Something like that

but with multiple nodes.This is what we have done with several nodes sharing file share including the /home.
Should we do otherwise ? I am in doubt now.

That's correct. The reason you can do this with a Server Pro load-balanced setup is that the servers work together to coordinate access to the directory. If you're using multiple servers but they aren't load-balanced, they can overwrite each other's data or create other race conditions.

1 Like

In our system, the SAME home directory is mounted to the different servers, so I cannot name .rstudio differently on every server.


Perfect! Thank you for the confirmation.