This Blogpost gives you a slim checklist for your Ruby on Rails Setup for Ubuntu.
First we need a fresh Ubuntu Server minimal installation with openSSH, curl and git. Select openSSH in the ubuntu setup and install curl and git with apt-get.
sudo apt-get install curl git
To make things easier you should add your public key to an authorized_keys file on your fresh installed ubuntu. Your public key should be in your .ssh folder
If you dont have a public key you can generate one by typing
ssh-keygen -t rsa
Append your public key in this file
Now you can login to your server without a password.
We start your setup by creating a new user for your project
sudo adduser *username*
Dont forget to add a save password!
Now switch to your new user
and add your public key to this users authorized_keys file
Install Requirements and Ruby
For Ruby on Rails you obviously need Ruby ;) so lets install RVM (Ruby Version Manager) first
curl -L https://get.rvm.io | bash -s stable
to get rvm in your current shell type
now you should check the requirements for rvm with
install all of the needed requirements on your administrator or root user with
# switch user su administrator sudo apt-get install *
Along with this step you should install some other requirements based on your Rails app:
Nginx, nodejs and supervisor
sudo apt-get install nginx nodejs supervisor
MySql (optional, depends on your setup)
sudo apt-get install mysql-server libmysql-ruby libmysqlclient-dev
ImageMagick (optional, for image resizing and more)
sudo apt-get install imagemagick libmagickwand-dev
But we wanted to install Ruby? yes! back to your new user :)
if you need openssl install the package
rvm pkg install openssl
and then the latest Ruby
rvm install 1.9.3 --with-openssl-dir=$rvm_path/usr
or just install the latest Ruby
rvm install 1.9.3
want to make your new Ruby version default your defualt ruby?
rvm use 1.9.3 --default
Now your server is basicly ready for your first deployment.
To setup supervisor for your Rails App you should checkout Raphael Randschaus Blogpost about foreman and supervisord