DEV Community

loading...
Supabase

Getting a PostgreSQL server up and running in Digital Ocean within minutes

dragarcia profile image Angelico ・3 min read

At Supabase, our goal is to make it quick and painless to get started with PostgreSQL. This means eliminating as many hoops as possible that one may need to jump through. We first built a repository that allows you to build a PostgreSQL server with pre-installed extensions in the cloud provider of your choice. Now, we are bringing it one step further and have embarked on making our build of PostgreSQL readily available in their marketplaces, starting with the Digital Ocean Marketplace.

Postgres + Goodies

Before we get started, allow me to run you through with what you will be getting with every Supabase Postgres Droplet at the time of this writing:

  • ✅ Postgres 12. Includes generated columns and JSON path support
  • ✅ Ubuntu 18.04 (Bionic)
  • pg-contrib-12. Because everyone should enable pg_stat_statements.
  • readonly role. A readonly role set up by default for the public schema.
  • wal_level = logical and max_replication_slots = 5. Ready for replication.
  • PostGIS. Postgres' most popular extension - support for geographic objects.
  • pgTAP. Unit Testing for Postgres
  • pgAudit. Generate highly compliant audit logs.
  • plv8. Write in Javascript functions in Postgres.
  • plpython3u. Python3 enabled by default. Write in Python functions in Postgres.

Getting Started

1. Create your droplet

Head over to our digital ocean marketplace listing and create your droplet. We made sure that you could create one even at the most basic configuration. No restrictions for you here.

2. Set up the password for the DB Superuser postgres

SSH into your instance using the user root and type in the following once you are in:

$ sudo -u postgres psql

This logs you into the psql terminal as the DB Superuser postgres.
psql Screenshot

Set your password with this command:

$ \password

Enter your desired password afterward and re-enter it when prompted. Once done, you can now exit your SSH connection.

3. Try out your new database

With any SQL client of your choice (I use DBeaver), connect to your database with the following credentials:

  • Host: insert droplet ip address
  • Port: 5432
  • User: postgres
  • Password: insert your chosen password
  • Database: postgres

You are good to go! You now have a brand new PostgreSQL database with all the added extensions, ready to be used with the command CREATE EXTENSION. And you didn't even have to break a sweat in getting all of them up running and working together. 😉


We'll announce all our future features with more freebies here on DEV first. Follow us so that you don't miss out.

follow gif
For more information on what goes in our build of PostgreSQL, do visit our repository here. Don't forget to leave us a star! 🤩

Discussion (0)

pic
Editor guide