Running RStudio via Docker in the Cloud

11 comments
Deploying applications via Docker container is the current talk of town. I have heard about Docker and played around with it a little, but when Dirk Eddelbuettel posted his R and Docker talk last Friday I got really excited and had to have a go myself.

My aim was to rent some resources in the cloud, pull an RStudio Server container and run RStudio in a browser. It was actually surprisingly simple to get started.

I chose Digital Ocean as my cloud provider. They have many Linux systems to choose from and also a pre-built Docker system.


After about a minute I had kicked off the Docker droplet I could log into the system in a browser window and start pulling the Docker file, e.g. Dirk's container.


Once the downloads finished I could start the RStudio Server using the docker run command and log into a RStudio session. To my surprise even my googleVis package worked out of the box. The plot command opened just another browser window to display the chart; here the output of the WorldBank demo.


All of this was done within minutes in a browser window. I didn't even use a terminal window. So, that's how you run R on an iPad. Considering that the cost for the server was $0.015 per hour, I wonder why I should buy my own server, or indeed buy a new computer.

11 comments :

Justin Booze said...

Hi mages,

Does the estimated cost include storage of data? This solution looks to be cheaper than Amazon EC?

Markus Gesmann said...

The cost is for a server with 30GB SSD and 2TB transfer.

Forrest Stevens said...

Great post, thanks for sharing your experience!

stephenl said...

This is awesome. The iPad comment: Unless something has changed recently I don't think using RStudio from a browser works with a mobile browser. I think it has to do with the ace editor.

monitus said...

Thanks for the great idea! At the risk of this being obvious, could you let me know the specific docker command to run rstudio? Is it just run docker ... rstudio-server start? Do you have to configure it so that it is accessible on a public IP address?

Markus Gesmann said...

I only experimented a little with this on my iPad, but it seemed to work.

Markus Gesmann said...

The discussion pointed out by Carsten below has a lot more of the details.

Mark Sellors said...

Glad you've had a chance to have a go with docker Markus! Sounds like it was useful.

I'd be interested to see another post if you decide to take it any further.

Markus Gesmann said...

Thanks to you as well and your great talk at EARL!

Michael Crawford said...

Hi Markus - have something similar using Vagrant & EC2. We built an machine image as standard set-up for data analysis that has Git, R, RStudio, Shiny server, Anaconda python & IPython notebooks. Its a great way to quickly beef up processing power on the fly and makes deploying demos to clients a breeze.

Markus Gesmann said...

Brilliant! It is really astonishing what one can achieve nowadays with the could infrastructure. It has really speeded up prototyping.
Getting feedback faster from clients makes all the differences in ensuring resources are well spend.

Post a Comment