PowerAuth Cloud uses PostgreSQL database as the primary datastore type. While it is possible to configure the images to use other database engine as well (Oracle, MySQL, etc.), we recommend PostgreSQL as the stable, performant and open choice.
The Docker images automatically keep the database schema up-to-date using Liquibase. Whenever you install the application or update it to a new version, the container updates the DB schema. On application downgrade, the changes are rolled back automatically (losing information specific for the new versions). Therefore, you only need to follow this documentation when you are installing and setting up the database from scratch.
To get started, download and install the current version of PostgreSQL:
Start the database and connect to it using your preferred database tool.
Tip: We use DataGrip by JetBrains for any database related tasks. It allows easy data editing for all popular database engines and contains a powerful SQL console for even the most complex database tasks.
Start by creating the
powerauth user in the database and by setting the user a strong password.
Tip: You can generate a strong password locally on your computer using
openssl rand -base64 12.
CREATE USER powerauth; ALTER USER powerauth WITH PASSWORD '$PASSWORD$';
Now, let’s create the
powerauth database to which we will store the data.
CREATE DATABASE powerauth; GRANT ALL PRIVILEGES ON DATABASE powerauth TO powerauth;
Install Helper Extensions
There are several PostgreSQL database extensions that may come in handy later. Installation of those is optional.
CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; -- includes uuid_generate_v4()
This is everything you need at this moment. Once the database is up and running with the right user and database, you can launch the Docker container. The Docker container uses Liquibase to create the schema automatically.