This tutorial aims to guide you in configuring Amazon Web Services (AWS) for deploying Rails applications. Amazon Web Services provides a highly reliable, scalable, and low-cost infrastructure platform in the cloud, that powers hundreds of thousands of businesses. By the end of the tutorial, you should be able to:
t2.micro
is free and should be sufficient for our needs.After your instance is up and running, you need to install the necessary software. SSH into your instance and install the following:
sudo apt-get update
sudo apt-get install curl
\curl -sSL https://get.rvm.io | bash -s stable --ruby
source ~/.rvm/scripts/rvm
sudo apt-get install -y nodejs
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn
gem install rails
After setting up an environment for Rails, you can create a new Rails application by running:
rails new my_app
This will create a new Rails application under a directory named my_app
.
In this tutorial, we've walked through the process of setting up an AWS account, creating an EC2 instance, and installing Rails on that instance.