How to Set up a PostgreSQL Database on Amazon RDS

Table of Content

  1. What is Database?
  2. What is AWS RDS?
    • Database Created Manually vs Database Created using AWS RDS
  3. What is PostgreSQL?
  4. Creating Amazon RDS with PostgreSQL Manually
    • Prerequisites
    • Important Parameters for setting up Postgres
    • Security Required in Setting up Postgres
    • Connecting to DB instance using Postgres engine with Master Password from pgadmin4
  5. Troubleshooting the PostgreSQL connectivity issues.

What is Database?

All of you might be very well aware of what database is used for , right ? But Let me share few examples of it. Suppose you have an company and you want to store all the information of your employees, such as Name, Employee ID , Employee Address , Employee Joining date , Employee benefits , where do you store them ? So , the Answer is database where you keep your all data securely and efficiently.

This image has an empty alt attribute; its file name is image-44.png

What is AWS RDS?

“Amazon Relational Database” is a web service which helps in setting up and maintaining the relational database in AWS. What I mean by maintaining here is : we can configure our RDS in such a way that it can scale up or scale down whenever required , it has resizable capacity i.e you can configure different instance size and can be load balanced and fault tolerant in nature. All depends on how we would like to configure. The service helps us in solving by removing lots of tedious management tasks than setting up manually and saving lot of our time. RDS supports 6 database engines: Amazon Aurora, PostgreSQL, MySQL, MariaDB, Oracle Database and SQL Server.

Database Created ManuallyDatabase Created using AWS RDS
You need to buy SeverNo need to buy any hardware
You need to configure backups manuallyAWS RDS takes care of backups automatically
To make it highly available you need to configure many thingsYou just need to choose highly available option
You cannot utilize IAM if you database is not build using RDS or on AWSYou can configure access using IAM
Less secure , as you get SHELL accessMore secure , as you don’t have access to SHELL




This image has an empty alt attribute; its file name is image-45.png
AWS RDS service contains RDS instances , Instances contains RDS databases and database users & finally you connect them using Clients such as pgadmin4

What is PostgreSQL?

PostgreSQL is an open source relational database system which has capability to handle heavy workload and can scale systems very easily. It can run mostly on all Operating systems. It is an open source but highly extensible like you can define your own data types, functions .

Some of the features of PostgreSQL are:

  • Security
  • Extensibility
  • Text Search
  • Reliable
  • Data Integrity
  • Good Performance

Creating Amazon RDS with PostgreSQL Manually

This image has an empty alt attribute; its file name is image-49.png

Prerequisites: Make sure you have two things

a) Amazon AWS account , you can create your account via https://signin.aws.amazon.com if you don’t have it already.

b) pgAdmin utility to connect to PostgreSQL database instance via https://www.pgadmin.org/download which will be use later in this tutorial once we are done with creation part.

So, Lets go and create our AWS RDS Postgres now !!

Step 1) Sign into your AWS account and on the top of the Page you will see “Search for services, features, marketplace products and docs” , here please type AWS RDS and choose RDS.

This image has an empty alt attribute; its file name is image-46.png

Step 2) On Left Panel click on Databases and then click on Create database.

This image has an empty alt attribute; its file name is image-47.png

Step 3) After you click on Create database choose method as Standard create , Engine as PostgreSQL and Latest Version : PostgreSQL 12.5-R1 and select FREE tier from Templates.

This image has an empty alt attribute; its file name is image-51.png

Step 4) Lets provide the database name , master username , master password and keeping all the storage values as default .

*According to your need and setup you can Provide storage.

This image has an empty alt attribute; its file name is image-52.png
This image has an empty alt attribute; its file name is image-53.png

Step 5) Lets Configure the Connectivity now : “Availability & durability and connectivity “

Important Note : Security group is used to allow your Inbound and Outbound traffic. In order for us to connect to RDS instance we will modify the inbound and outbound rules of default security group which we are using to create the RDS instance.

Path to reach security group : On top of the Page you will see “Search for services, features, marketplace products and docs” , here look for EC2 and enter and then you will see Security groups under Network and security. Choose the default security group which is linked with your VPC.

This image has an empty alt attribute; its file name is image-58.png
This image has an empty alt attribute; its file name is image-60.png
This image has an empty alt attribute; its file name is image-55.png

Step 6) Make sure the default settings for “Database authentication” and “Additional configuration” are selected.

This image has an empty alt attribute; its file name is image-57.png

Step 7) We are now ready : Lets click on Create Database

**** It usually takes few mins for your RDS instance to be launched.

Here we GO !! Our Database instance is successfully created now

This image has an empty alt attribute; its file name is image-59.png

Step 8) Lets Open pgAdmin and connect to our “myrds” database instance

After you open pgadmin you will see Servers on the left side. Right click and servers and create a new server

This image has an empty alt attribute; its file name is image-63.png

Step 9) Lets Open pgAdmin and connect to our “myrds” database instance

After you open pgadmin you will see Servers on the left side. Right click and create a new server

In General Tab select name as “myrds” and in Connection Tab provide the Host i.e endpoint URL of your database instance ( You can find this in Connectivity and security under Databases in AWS RDS

This image has an empty alt attribute; its file name is image-64.png
This image has an empty alt attribute; its file name is image-65.png

Step 10) Click “SAVE”

This image has an empty alt attribute; its file name is image-66.png



Step 11) Now, let’s go ahead and create a database within the server. Right click on “Databases” and select “Create” and then “Database…” Give the database a name and save when done.

This image has an empty alt attribute; its file name is image-67.png

Step 12) Alright, now our new database “testing” is also created successfully. 

This image has an empty alt attribute; its file name is image-69.png

Troubleshooting the PostgreSQL connectivity issues.

Error while connectingSolution
Database name doesn’t exist while connectingTry connecting the default database i.e postgres
Couldn’t connect to server: connection time out1.Check if you entered correct host name
2. Make sure DB is publicly accessible
3. Check if you are giving correct port i.e 5432
4. Check the Inbound and outbound rule of default security group


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s