Setup services on Amazon EC2


We decided to move our PostgreSQL and Redis extensions from Heroku to separate services based on Amazon EC2 instances.

First of all, let’s create two instances based on Ubuntu 16.04 LTS operating system:

2

Cool. Now we have two instances up and running. One for PostgreSQL and one for Redis.

1

To allow remote connection to our instances and ports - 5432 for PG and 6379 for Redis, we need to create Security Groups and assign them to each instance.

3

Now let’s create rules for Postgresql. 4

And rules for Redis.

5

Now we can change security group of each instance and assign right one.

6

This post assumes, what you have experience with Linux and bash, you had installed Postgresql and Redis on your instances, customized config files to allow remote connections with correct default port bindings.