How to install RStudio Server in Databricks

To install RStudio Server in Databricks you need to download RStudio, install it and setup it up inside Databricks notebook and settings.

  1. Create a new notebook file

2. Copy, paste and run. This will create a script which will download the RStudio Server installer.

script = """#!/bin/bash

set -euxo pipefail

if [[ ! -f "$RSTUDIO_BIN" && $DB_IS_DRIVER = "TRUE" ]]; then
  apt-get update
  apt-get install -y gdebi-core
  cd /tmp
  # You can find new releases at
  wget -O rstudio-server.deb
  sudo gdebi -n rstudio-server.deb
  rstudio-server restart || true

dbutils.fs.put("/databricks/rstudio/", script, True)

3. In your second Cmd run the shell file

%fs head /databricks/rstudio/

4. Now go to Compute -> Configuration select your clusters (if you don’t have one, then create one). In Advanced options select “Init Scripts” and add the shell file


5. Confirm and restart your cluster

6. When the cluster is up again select the Cluster -> Apps menu in the top. And press the Set up RStudio

7. Press Open RStudio and login with your credentials

Now you have a full functional running RStudio inside your Databricks.

Databricks source documentation: