Run rstan on AWS

I searched a bit and found there are people using rstan in AWS. I had everything ready in AWS. Now I am testing it out. If anyone happens to run rstan in AWS and have some resources to share here, I’d appreciate it a lot. Thanks agian.

1 Like

Great question @ffwang2011, I would love to read what other people are doing and whether there is some agreement on best practices. Is anyone else using remoter? In case you want to try this workflow, I wrote some basic notes on how I do it.

FWIW folks in our group tend to use rstan on AWS with EC2 instances and Docker:

  • start an EC2 instance, exposing any necessary ports in the security group settings (e.g., 8787 for RStudio server, or 8888 for Jupyter notebook)
  • ssh into it
  • (if necessary) install docker
  • then run your Docker container that has an RStudio server instance or Jupyter notebook/lab
  • connect via web browser and do your thing

Here’s an example Dockerfile:

Another good option that would be more straightforward: Louis Aslett’s RStudio AMIs -

It seems that there is a problem currently with the certificate of your site. I was able to access that posting before, but since a few weeks ago, chrome tells me it can’t access the site.

It really is a pity, since I found your notes the most comprehensive ones on this subject.

@Tillmann_Nett I’m in the process of moving to a new domain so somethings are not working as they should. This link should work fine.

Hi all. I’m trying to use rstan on an AWS EC2 instance with the docker image jrnold/rstan, following the steps outlined above by @mbjoseph.

I’m struggling to figure out how to connect to the container once it’s running - I suspect it’s very simple, but I’m a novice and am not having much success finding how to do it online.

If anyone could elaborate on

  1. the required security group settings when launching an EC2 instance,
  2. the port specifications when calling docker run -p ..., and
  3. how to connect via web browser,

that would be very much appreciated!

I’ve found the answers I was looking for:

  1. need to Add a “Custom TCP Port” with Port Range “8787” in the security group settings.
  2. docker run -p 8787:8787 -e PASSWORD=<mypassword> ... maps the ports and sets the password required by rocker/tidyverse
  3. connect in the browser with “http://” + the public IPv4 address of the EC2 instance + “:8787”