The Elastic Guru

The Elastic Guru is a community of amazing AWS enthusiasts

We're a place where friendly AWS peeps create, read and share content to ignite the curiosity, learning, growth and success in young people.

Create new account Log in
loading...
Cover image for How to build a Ruby on Rails app on AWS for beginners - Part 2.

How to build a Ruby on Rails app on AWS for beginners - Part 2.

lee profile image lee Updated on ・1 min read

Now it is time to provision our database. We are going to go with Postgres.

There are 2 ways to do this on AWS, we can either install Postgres into our ec2 Linux host, or we can provision the database separately in AWS LightSail as a PaaS RDS database.

In this example we are just going to install Postgres locally on our LightSail ec2 instance.

This is a fairly simple process, first of lets install a recent version of Postgres.

sudo apt install postgresql-11 libpq-dev
Enter fullscreen mode Exit fullscreen mode

Next up we we are going to setup our DB user.

sudo -u postgres createuser lee -s

# If you would like to set a password for the user, you can do the following

sudo -u postgres psql 
postgres=# \password lee
Enter fullscreen mode Exit fullscreen mode

Next up, I'll show you how to do this with LightSail's RDS PaaS DB option.

Discussion (1)

pic
Editor guide
Collapse
jenna profile image
Jenna

Whoa I didn't know that LightSail now did databases, I'll have to check that out for sure.