Resetting a user's state on RStudio Server



RStudio Server stores users' custom settings, session information and options in a hidden directory called .rstudio. If this directory does not exist, RStudio will create it on startup. This directory includes user settings, log files, and other state information. Removing (or renaming) this directory will reset RStudio's state for that user, analogous to a fresh installation. 

In addition, R stores user session information in several files that may also need to be moved or renamed in order to reset the user's session fully. These are the .Rdata file (containing data and R objects; for more see here)  and the .Rhistory file (containing the command history; for more see here).

We recommend renaming these directories to create a backup version instead of completely deleting them. This allows you to save your settings and history, in case you want to revert back to them. Additionally, if you experienced a crash or the user is not able to log in, this directory may contain vital information for determining the source of the error. In this case, we recommend renaming these directories and sending them to RStudio Support if requested.

Resetting RStudio's state for a user:

The .rstudio directory and the .Rdata and .Rhistory files are located in each user's default working directory (typically their home directory). 

To reset RStudio's state:

  1. Navigate to the user's working directory. Note that if you are using RStudio Projects, these will have their own session files that may need to be reset separately (for instance, if a user is unable to load RStudio while working in a Project).
  2. Rename the .rstudio directory and the .Rdata and .Rhistory files (for instance, via the command sudo mv /home/user1/.rstudio /home/user1/.rstudio-old)
  3. Open a fresh browser window and log into RStudio Server.

Note that this will only reset the state for that particular user. 

If you are using RStudio Projects, we'd also recommend resetting the project-specific state if you're having issues - you can do this by navigating to the Project's folder in your file browser, and renaming the .Rproj.user directory there.