Problems running Rstudio on JupyterHub


I’ve read a lot on this topic, but I a bit lost right now.

I’m building a containerized IDE / development environment for my team based on JupyterHub. Really impressed on the wide range of functionality and happy with my installation so far:

  • Signing in with github
  • Create (linux)user when user is in whitelist / allowed users
  • Running VS code / Code server
  • Running Jupyter notebooks

One last piece for me is to install Rstudio as we also work a lot with R.

In my dockerfile I install R studio with the following lines

# Install R Studio
RUN apt-get -y install r-base gdebi-core
RUN cd /srv/jupyterhub && \
    wget && \
    gdebi -n -q rstudio-server-2022.02.0-443-amd64.deb
RUN pip install jupyter-rsession-proxy


I no have two issues:

  1. When launching the container, Rstudio is not running. I manually need to run: rstudio-server start in a connected terminal. This can best be solved with a small script when starting the container?

  2. Clicking on the R-icon in JupyterHub I then get the following:

    For some reason the host-name gets really weird and is changed to “dime” witch is part of the original hostname containing dashes:

Copy pasting my valid base-url in the url displayed in the browser instead of https://dime/ so I get,[username]/rstudio/auth-sign-in?appUri=%2F. Running this results in a working rstudio when clicking again on the R-server icon.

Can sameone point me in the right direct to fix this wrong redirecting behaviour?

Heya! Glad you are enjoying using JupyterHub :slight_smile:

For RStudio, RSESSION_PROXY_RSTUDIO_1_4=yes should no longer be required. If you’re on the latest version of jupyter-rsession-proxy, just going to the /rstudio URL on your hub should ‘do the right thing’. I think manually running rstudio-server start might cause some issues, as jupyter-rsession-proxy has to do some custom stuff to get everything going.

If just going to https://<hub-url>/hub/user-redirect/rstudio doesn’t work, please can you post the logs from the user container as well as the versions of rstudio and jupyter-rsession-proxy?


I’m getting the same behavior. When my hostname is:

it’s being redirected and failing due to incorrect hostname:

Any idea how to fix?

I ran it under a different hostname, one without ‘-’ in the name. It worked fine. This issue may potentially be a bug. I’ll wait for confirmation before I submit it to github.

1 Like

man…u R not connected to the internet probably :sunglasses: