Configuring ROracle on RStudio Connect




This article assumes Oracle Instant Client Basic & SDK, and ROracle, are already installed. For assistance installing ROracle, visit this page.

As an alternative to ROracle, you may wish to consider using the DBI R package and the RStudio Commercial Drivers. For more information, see

If you are using RStudio Server Pro, RStudio Connect, or Shiny Server Pro, then you can download and use RStudio Professional Drivers at no additional charge, available here: 


Configuring ROracle on RStudio Connect

The final steps of the ROracle Installation involve setting several paths in the environment to include LD_LIBRARY_PATHOCI_LIB, and ORACLE_HOME.

The LD_LIBRARY_PATH must be set prior to the R process executing.  Using R startup files such as and will not suffice, since the R process has already started.  The ideal way to set this value is to use a Program Supervisor script: 

As an example, here is a configuration that uses a custom script to prepare a custom execution environment before finally running R.  

Add the following to: /etc/rstudio-connect/rstudio-connect.gcfg

Supervisor = /opt/scripts/

Then, the contents of example could be something like:


echo arguments: "$@"

export LD_LIBRARY_PATH="/usr/lib/oracle/11.2/client64/lib:$LD_LIBRARY_PATH"
export OCI_LIB="/scratch/instantclient_11_2"
export ORACLE_HOME="/path/to/oracle/home/"

exec "$@"


Note:  In this example, /opt/scripts/ was used to store the script to avoid any directories masked by the sandbox.  The following locations are masked during R execution:

  • The Server.DataDir directory, containing all variable data used by RStudio Connect.
  • The SQLite.Dir directory, which can optionally be placed outside the data directory.
  • Configuration directories, including /etc/rstudio-connect.
  • The Server.TempDir/connect-workspaces directory, which contains temporary directories, one per R process.