Creating Postgres Database

It is possible to install PostgreSQL to a Droplet on a self managed basis, which is a cost effective and oftentimes preferable approach. The resources are available at the following location:

https://www.postgresql.org/download/

PostgreSQL is a remarkable database and is not especially difficult to maintain, although it has tendency to become more anxious when it comes to assuring backups and high availability. The maintenance of high availability and backups is the main value proposition of Managed PostgreSQL on DigitalOcean or alternative hosting provider.

For the purpose of this documentation, PostgreSQL Managed Database at DigitalOcean will be used.

In the DigitalOcean Control Panel, navigate to Databases on the left hand navigation:

Image

Click on the Database menu item to expose the page to begin database creation:

Image

Locate the prominent Create Database Cluster button:

Image

Click the button to expose the Create Database Cluster:

Image

Specify a datacenter nearby (in this case Frankfurt) and PostgreSQL version 14:

Image

Scroll down to size the server, selecting in this case 2vCPU and 4GB RAM:

Image

No standby is needed although it would be suggested given production use. Scroll down and note the Create Database Cluster button:

Image

Click the Create Database Cluster button to begin the process of database creation:

Image

Upon the database having been created note the availability of the connection settings:

Image

Clicking the show button will expose the password:

username = doadmin
password = *******
host = db-postgresql-fra1-34965-do-user-12376516-0.b.db.ondigitalocean.com
port = 25060
database = defaultdb
sslmode = require

The database settings which will be passed as an Environment Variable later in the documentation.

Network security is outside the scope of this documentation; however, note that it is sensible to restrict access to the database to only the remote IP address in use, although this will not affect connections via the local network:

Image

Creating Redis Database

The following is for completeness, however, this guide does not suggest using Redis on Digital Ocean unless comfortable configuring TLS as follows:

https://www.digitalocean.com/community/tutorials/how-to-connect-to-managed-redis-over-tls-with-stunnel-and-redis-cli

In the same Databases context menu, proceed to create a new database as if it were Postgres SQL as above, instead selecting Redis a the database product type:

Image

Select the desired size as specified in the introduction:

Image

Before scrolling down to confirm the creation of the Redis database:

Image

Once created, the credentials for the Redis database exist in a very similar location:

Image

The senstive information is exposed in the same manner as with Postgres, clicking show. Hive off the following information for the installation of Jube as the final step of this process:

username = default
password = ************************ show
host = db-redis-fra1-14927-do-user-12376516-0.c.db.ondigitalocean.com
port = 25061

Jube™. © Jube Holdings Limited 2022 to present.