Skip to content

Instantly share code, notes, and snippets.

@alinaselega
Last active May 7, 2020 18:08
Show Gist options
  • Save alinaselega/80b2b4e9fc24d8137af07f46544bda59 to your computer and use it in GitHub Desktop.
Save alinaselega/80b2b4e9fc24d8137af07f46544bda59 to your computer and use it in GitHub Desktop.
This gist is a quick guide on how to run RStudio in docker.

This tutorial is a useful refresher for running RStudio in Docker: link.

The main command is:

docker run --rm -e PASSWORD=test -p 8787:8787 -v /local_path:container_path rocker/verse

The flags do the following:

  • --rm ensures the container is deleted after terminating;
  • -e specifies the password; "rstudio" is the not a valid password (this reflects changes not covered in the tutorial);
  • -p runs RStudio on the local port 8787;
  • -v attaches a volume allowing one to open/save files in the container.

If rocker/verse is not downloaded yet, running this command will download it from the repo. Docker should be installed first. It is currently already installed on my WSL so the installation process is beyond the scope of this gist.

One can then access RStudio in the browser at http://localhost:8787/, with username: rstudio and specified password.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment