Getting up to speed with PostgreSQL for your development is super easy with Qumulus.
Create a new instance, select Ubuntu 24.04, Instance type as t1.small (or the size which suits you) and add script to the user data section, click launch!
Here is the 'user data' script you can use
#!/bin/bash
#This is a basic setup that is intended to be used for development purposes.
# Update package list and install Postgres and UFW
apt update > /dev/null 2>&1
apt install postgresql postgresql-contrib ufw -y > /dev/null 2>&1
# Replace 'PleaseChangeYourPassword' with your actual secure password once the installation is completed.
POSTGRES_PASSWORD="PleaseChangeYourPassword"
# Update Postgres configuration:
# 1. Enable remote access by binding Postgres to all interfaces.
POSTGRES_CONF=`find /etc/postgresql -name postgresql.conf`
sed -i "s/#listen_addresses = 'localhost'/listen_addresses = '*'/g" $POSTGRES_CONF
# 2. Update pg_hba.conf to allow remote connections.
PGHBA_CONF=`find /etc/postgresql -name pg_hba.conf`
sudo echo -e "host\tall\tall\t0.0.0.0/0\tmd5" >> $PGHBA_CONF
sudo -u postgres psql template1 -c "ALTER USER postgres with encrypted password '$POSTGRES_PASSWORD';"
systemctl enable postgresql
systemctl restart postgresql
# Enable UFW if it's inactive.
if ufw status | grep -iq "inactive"; then
echo "y" | ufw enable
fi
# Allow incoming TCP connections on port 5432 (Postgres).
ufw allow 5432/tcp
# Allow incoming TCP connections for SSH.
ufw allow 22/tcp
ufw reload
Once your instance is up and running, You can assign a public IP to it and to it .Make sure you have inbound rules defined to allow for the instance and open port for PostgreSQL in the assigned to your VM.