Introduction to using AWS EC2 to host PostgreSQL server

Imagine the following scenario:

  1. You have several files of data that are interconnected with each other

  2. You want to create data tables combining information from separate data files

  3. You want your project team to access the data and tables all from one location

A SQL server allows you to input your data into a database and create tables from different files using SQL commands, and you can also create users and allow them access to different databases in your server.

There's a big remaining question: how do you create a server for everyone in your project team to access? Several cloud vendors offer solutions, but most of the pre-configured SQL database cloud services can become expensive (if you'd like to investigate for yourself, Amazon Relational Database Services (RDS) lists their pricing for PostgreSQL here).

A cheaper solution is to install and create your own PostgreSQL server on an Amazon EC2 instance and having your teammates access the server through pgAdmin4, PostgreSQL's most popular GUI.

In this documentation, we will

  1. Configure an AWS EC2 Ubuntu machine for PostgreSQL server

    • Configure instance to scale up or down depending on CPU demand using EC2 auto-scale feature

  2. Set-up PostgreSQL server with users in our Ubuntu instance

  3. Access PostgreSQL server on our remote computers using pgAdmin4

  4. Backing up your PostgreSQL EC2 server in AWS

The goal is to review every step and give clear rationale so that you not only know what to do but also why you're doing it. Additionally, I list all of the website resources referenced in each section.

About PostgreSQL

If you'd like to learn how to use PostgreSQL, here is a comprehensive guide I found incredibly useful:

Contact Me

If you have any questions or find any issues with this documentation, feel free to contact me!


🐦 @beliciataylor

For more information about me, visit my website:

Last updated