ssh [email protected]
- Note you're not SSH-ed in so file path is relative to your local directories
- Note -r is recursive, assuming copying relevant folder(s) and files within
scp -r /path/to/local/dir [email protected]:/path/on/remote/server
Taken from: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-20-04
sudo apt update
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
sudo apt update
apt-cache policy docker-ce
sudo apt-get -y install docker-ce
sudo systemctl status docker
Notes:
-rm
flag will delete container when it's done-d
flag runs in background/detached mode-v
maps your files on the server into the folder/path/within/container
within the Docker container (so you can usesetwd()
within the container to navigate to this location to use the files)-p
maps the server port 80 (default web) to the port 8787 in the container (RStudio Server by default runs out of 8787), so you can go to your IP XXX.XXX.XXX.XXX (=XXX.XXX.XXX.XXX:80) to access the web interface-e
you must obligatorily set a password for the web interface (default usename is 'rstudio', default password used to be 'rstudio' as well)- The container image
rocker/tidyverse
will automatically be pulled from DockerHub since you're on a fresh install of Ubuntu.
docker run --rm -d -v /path/on/remote/server:/path/within/container -p 80:8787 -e PASSWORD=rstudio rocker/tidyverse
docker run --rm -d -v /home:/home/rstudio -p 80:8787 -e PASSWORD=rstudio --name rstudio rocker/tidyverse
docker exec rstudio bash -c 'chown rstudio /home/rstudio'