This guide will show you how to connect Postgres to a Digital Ocean droplet and test this connection using Arctype. An example of doing this in one click is below.
If you don’t already have Postgres installed on your Digital Ocean droplet, you can do so using the command below:
sudo apt install postgresql postgresql-contrib
You can also spin up a managed database cluster on the Databases tab in the Digital Ocean web console.
To connect using the flags format with Postgres using the
doadmin user, paste the entire command from the control panel into your terminal:
PGPASSWORD=your_password psql -U doadmin -h your_cluster.db.ondigitalocean.com -p 25060 -d defaultdb --set=sslmode=require
When you connect successfully, your terminal changes to the
psql prompt, which displays the name of the database you’re connected to.
Test your connection using Arctype.