RStudio Server OSS - Define custom libPath for all users

I am attempting to execute RStudio Server OSS within Docker as a container and allow users to load packages from an external volume. I am having difficulty configuring RStudio Server to use a different library path. I have tried editing both /etc/rstudio/rserver.conf and /usr/lib64/R/etc/Renviron files as described here https://stackoverflow.com/questions/32205259/rstudio-server-set-libpath-for-all-users.

Executing "Sys.getenv('LD_LIBRARY_PATH')" in the web browser session does show my custom path has been set, but executing ".libPaths()" does not.

If I install a new package, e.g., install.packages('ggplot2'), everything gets placed in the original lib path location, not the one I've defined in both Renviron and rserver.conf. I have tried restarting rserver and rsession processes.

What am I doing wrong?

Have a look at the other answer there. LD_LIBRARY_PATH is for loading dynamic libraries (so files), not for libraries of R packages. You can set environment variables such as R_LIBS_SITE or R_LIBS_USER in R_HOME/etc/Renviron{.site} or .Library.site in R_HOME/etc/Rprofile.site, c.f. the R admin manual. Note that RStudio server ignores environment variables set outside of Renviron{.site}.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.