What are the database requirements?
General database requirements
CAST Imaging requires at least one RDBMS to store both the data generated during analyses and persistence data (settings/properties etc.):
- CAST supports only PostgreSQL .
- Customers are responsible for installing PostgreSQL on their own machines on both Microsoft Windows or Linux (see the note below about Linux deployments where a database instance is provided as part of the installation)
- Details about one instance will be required during the CAST Imaging installation process (both analysis and persistence data will automatically be stored on this instance).
- Customers are free to install additional database instances post-install, for example to separate the storage of persistence data and analysis data on two separate instances.
Depending on your installation scenario:
- Microsoft Windows: install an official PostgreSQL release from EnterpriseDB - see Install PostgreSQL for Microsoft Windows.
- Linux: install an official PostgreSQL release directly on a Linux machine or through Docker/Podman (see Install PostgreSQL for Linux), or use the PostgreSQL instance provided by CAST as a Docker container.
Starting 3.6.0-funcrel, when installing CAST Imaging on Linux via Docker or Linux via Podman, the database mode is controlled by the DB_MODE parameter in the configuration.conf file providing deployment flexibility (see Installation variables):
DB_MODE=embedded(default): CAST provides and manages a PostgreSQL container automatically (see below for the supported PostgreSQL release). No external PostgreSQL installation is required as part of the installation process. All Analysis and persistence data will automatically be stored on this instance. Customers are free to install additional database instances post-install for analysis data storage.DB_MODE=external: You must provide details of an external PostgreSQL instance and configure the connection parameters (DB_HOST,DB_PORT,DB_NAME,DB_USER,DB_PASSWORD,DB_DATABASE) inconfiguration.confbefore installing. In 3.6.7-funcrel and above, the installer connects to the instance you provide and validates it before the installation starts - see Installation prechecks.
For those installing older releases on Linux (3.5.x-funcrel or earlier), the embedded PostgreSQL instance will always be installed and will be used by default for both analysis and persistence data.
Best practice for database naming: use only lowercase letters (a-z), numbers (0-9), and underscores (_) for the database name (DB_DATABASE) - for example app_db, orders_v2, or reporting_prod. Avoid hyphens (customer-db), spaces (customer db), mixed case (CustomerDB), and other special characters (customer$db). PostgreSQL folds unquoted identifiers to lowercase and requires quoting for these characters, which can prevent CAST Imaging services (including SSO) from starting correctly.
Requirements for analysis data
Three schemas will be created automatically in a database of your choice (postgres by default) for each application you onboard in CAST Imaging:
<application_name>_local<application_name>_central<application_name>_mngt
An additional schema will be created automatically in a database of your choice (postgres by default) if you are using the CAST Health/Management Dashboard, where results for all applications are consolidated together:
general_measure(or other custom name)
Requirements for persistence data
Two schemas (control_panel and keycloak) will be created automatically in the database of your choice (postgres by default) during the installation.
If either of the control_panel and keycloak schemas already exist on the target database instance they will be re-used and this will cause unexpected behaviour.
Note that in previous releases (3.0.x - 3.5.x) one database called keycloak_v3 was created for authentication persistence purposes instead of the schema keycloak.
Supported PostgreSQL releases
CAST supports the following official PostgreSQL releases on both Microsoft Windows and Linux (64-bit):
| PostgreSQL release | Architecture | Notes |
|---|---|---|
| 18.x | 64bit | Recommended. Requires com.castsoftware.imaging.core 8.4.8 or above. |
| 17.x | 64bit | Requires com.castsoftware.imaging.core 8.4.8 or above. Note: When using a 17.x instance with CAST Imaging 3.5.4-funcrel installed on Docker/Podman/Kubernetes, schema backups via the built-in application backup feature are unavailable. This is a known issue, resolved in 3.5.5-funcrel. |
| 16.x | 64bit | Requires com.castsoftware.imaging.core 8.4.1 or above. |
| 15.x | 64bit | CAST provides this release of PostgreSQL as a Docker image when installing CAST Imaging on Linux via Docker/Podman. |
Requirements for the database user and encoding
These requirements apply to any instance you provide yourself - all Microsoft Windows installations, and Linux installations using DB_MODE=external. The instance CAST provides on Linux/Podman (DB_MODE=embedded) already meets them.
During the installation and each time an application is onboarded, CAST Imaging creates schemas, roles and objects on your behalf using the account you provide (DB_USER on Linux/Podman, CSS_USER on Microsoft Windows), so that account needs sufficient rights:
| Requirement | Detail |
|---|---|
| Role privileges | The login role must be SUPERUSER, or hold both CREATEDB and CREATEROLE. |
| Tablespace privileges | The login role must hold CREATE on the pg_default tablespace. |
| Server encoding | The database must use the UTF8 encoding. |
An encoding other than UTF8 can corrupt analysis data. The encoding of a database is fixed when the database is created and cannot be changed afterwards, so a database created with another encoding must be re-created with ENCODING 'UTF8'.
To check the instance before you install:
SELECT rolsuper, rolcreatedb, rolcreaterole FROM pg_roles WHERE rolname = current_user;
SELECT has_tablespace_privilege(current_user, 'pg_default', 'CREATE');
SHOW server_encoding;
Where the role privileges are missing, grant them with a superuser account - for example, for a login role called operator:
ALTER ROLE operator CREATEDB CREATEROLE;
GRANT CREATE ON TABLESPACE pg_default TO operator;
In 3.6.7-funcrel and above, the installer verifies all three before it makes any change to your machine. Insufficient role privileges stop the installation. A missing tablespace privilege and a non-UTF8 encoding are reported as warnings only and the installation continues, so resolve them yourself. See Installation prechecks.