Skip to content

Instantly share code, notes, and snippets.

@Dulani
Created September 18, 2014 05:30
Show Gist options
  • Save Dulani/fcaedcb3176d1d9ef74d to your computer and use it in GitHub Desktop.
Save Dulani/fcaedcb3176d1d9ef74d to your computer and use it in GitHub Desktop.
Setup R and RStudio on RHEL on AWS
#Setup and launch an RHEL EC2 instance
#Ensure that the security group (firewall) allows access to port 8787
#Login via SSH
#Guide: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstancesLinux.html
ssh -i keyfile.pem ec2-user@ec2-11-22-33-44.compute-1.amazonaws.com
#Keyfile.pem is the name of your the keyfile you generated with AWS.
#RHEL users are either root or ec2-user
#ec2-11-22-33-44.compute-1.amazonaws.com is the "actuall" public name assigned by AWS
#Gain root access:
#Guide: https://forums.aws.amazon.com/thread.jspa?threadID=83329
sudo su
#Install R (not using su or sudo from site, instead using the line above):
#Guide: http://www.jason-french.com/blog/2013/03/11/installing-r-in-linux/
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
#yum update #Not sure I like this step… Adds way more than I want/need…
yum install R
Ultimately, need to save this as a corporate approved AMI so that it doesn’t need to be recreated every time!
#Install R Studio Server
wget http://download2.rstudio.org/rstudio-server-0.98.1060-x86_64.rpm
sudo yum install --nogpgcheck rstudio-server-0.98.1060-x86_64.rpm
#Add a username and password so that someone can login to the server.
useradd uname
passwd uname
#Access the server using the public name and the port 8787.
http://ec2-11-22-33-44.compute-1.amazonaws.com:8787
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment