Simple script from setting up R, Git, and Jags on Amazon EC2 Ubuntu Instance

[This article was first published on Christopher Gandrud (간드루드 크리스토파), and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Just wanted to put up the script I’ve been using to create an Amazon EC2 Ubuntu instance for running RStudio, Git, and Jags. There isn’t anything really new in here, but it it has been serving me well.

The script begins after the basic instance has been set up in the Amazon EC2 console (yhat has a nice post on how to do this, though some of their screenshots are a little old). Just SSH into the instance and get started.

# Set up RStudio and JAGS on an Amazon EC2 instance
# Using Ubuntu 64-bit
# Partially from http://blog.yhathq.com/posts/r-in-the-cloud-part-1.html
# See yhat for EC2 instance set up
# Navigate to key pair
# ssh -i YOUR_KEYPAIR.pem ubuntu@PUBLIC_DNS
# Add a user/password.
# This will become your RStudio username and password.
sudo adduser USER_NAME
# Get all programs up to date
sudo apt-get update
# Install R and JAGSS
sudo add-apt-repository ppa:marutter/rrutter
sudo apt-get install r-base-dev jags r-cran-rjags
# Check that you have the latest R installed
## see also: http://askubuntu.com/a/352438
sudo apt-get update
apt-cache showpkg r-base
# If R is not the latest version add latest PACKAGE_VERSION returned
# from the pervious line to:
sudo apt-get install -f r-base=PACKAGE_VERSION
# Install git
sudo apt-get install git
# Configure git
git config --global user.name GIT_USER_NAME
git config --global user.email GIT_USER_EMAIL
# Install RStudio
## for latest version of RStudio see http://www.rstudio.com/ide/download/server
sudo apt-get update
sudo apt-get install gdebi-core
sudo apt-get install libapparmor1
wget http://download2.rstudio.org/rstudio-server-0.98.945-amd64.deb
sudo gdebi rstudio-server-0.98.945-amd64.deb
# Verify RStudio installation
sudo rstudio-server verify-installation
#### Git clone your repo as usual, ideally into /home/USER_NAME ####
# This is where RStudio server looks.
# Change owner of the repo to USER_NAME
sudo chown -R USER_NAME /home/USER_NAME/REPO_NAME
# Access RStudio Server with http://PUBLIC_DNS:8787

To leave a comment for the author, please follow the link and comment on their blog: Christopher Gandrud (간드루드 크리스토파).

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)