Skip to main content

Database Configuration

Main Database

Configure the main database in the [icp_server.storage] section of <ICP_HOME>/conf/deployment.toml.

KeyDescription
dbTypeDatabase engine — mysql, postgresql, mssql, or h2
hostDatabase server hostname (not used for H2)
portDatabase server port (not used for H2)
nameDatabase/schema name
usernameDatabase user
passwordDatabase password

MySQL

[icp_server.storage]
dbType = "mysql"
host = "localhost"
port = 3306
name = "icp_db"
username = "<DB_USER>"
password = "<DB_PASSWORD>"

PostgreSQL

[icp_server.storage]
dbType = "postgresql"
host = "localhost"
port = 5432
name = "icp_db"
username = "<DB_USER>"
password = "<DB_PASSWORD>"

Microsoft SQL Server

[icp_server.storage]
dbType = "mssql"
host = "localhost"
port = 1433
name = "icp_db"
username = "<DB_USER>"
password = "<DB_PASSWORD>"

H2 (In-Memory)

[icp_server.storage]
dbType = "h2"

H2 is suitable for development and testing only.


Credentials Database

The default authentication backend stores user credentials in a separate database or schema. These are flat top-level keys in deployment.toml (not under any table header).

credentialsDbType = "postgresql"   # h2, postgresql, mysql, or mssql
credentialsDbHost = "localhost"
credentialsDbPort = 5432
credentialsDbName = "credentialsdb"
credentialsDbUser = "icp_user"
credentialsDbPassword = "icp_password"
KeyTypeDefaultDescription
credentialsDbTypestring"h2"h2, postgresql, mysql, or mssql
credentialsDbHoststring"localhost"Not used for H2
credentialsDbPortint5432Not used for H2
credentialsDbNamestring"credentialsdb"Database/schema name
credentialsDbUserstring"icp_user"Database user
credentialsDbPasswordstringDatabase password

For PostgreSQL, credentials are stored in a credentials schema within the same database. For H2, they are stored in <ICP_HOME>/bin/database/credentials.