Access files in Rstudio in Docker

Posted March 2, 2017 4k views
DockerUbuntu 16.04

I apologize if this is trivial for some – but what would be your recommended way to transfer data between my local files and the Rstudio on the Docker? I can use Filezilla to access my Droplet folder, but would like to view RStudio’s working directory, which was simply “/home/rstudio”.

Ideally, I would like to simply upload some .csv files to the Droplet, run some analyses in the Docker, export some documents and load them on my local computer, but it is not intuitively clear what would be the most efficient way to achieve this goal.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

You can use the docker cp command. This will allow you to transfer in and out of your docker container. Here is the documentation of this command:

Essentially, you run


Obviously, you replace CONTAINER with the name of your container, and you fill in the file paths.

If you want to execute commands in a docker container (to edit files), you can use the docker exec command.
Here is some documentation of this command:

Here, you essentially run

docker CONTAINER exec -it COMMAND

Obviously, you replace CONTAINER with the name of your container and you replace COMMAND with whatever command you would like to run.

Hope this helps!