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:
Click on the Database menu item to expose the page to begin database creation:
Locate the prominent Create Database Cluster button:
Click the button to expose the Create Database Cluster:
Specify a datacenter nearby (in this case Frankfurt) and PostgreSQL version 14:
Scroll down to size the server, selecting in this case 2vCPU and 4GB RAM:
No standby is needed although it would be suggested given production use. Scroll down and note the Create Database Cluster button:
Click the Create Database Cluster button to begin the process of database creation:
Upon the database having been created note the availability of the connection settings:
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:
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:
Select the desired size as specified in the introduction:
Before scrolling down to confirm the creation of the Redis database:
Once created, the credentials for the Redis database exist in a very similar location:
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