Skip to main content

Database

Certeasy stores all ACME state (accounts, orders, challenges, certificates, audit logs) in a relational database.

Supported Drivers

DriverKeyNotes
SQLitesqliteDefault. No setup required. Recommended for single-node deployments. Do not supports multiple nodes
PostgreSQLpostgresRecommended for multi node deploymnent.
SQL ServersqlserverFor environments standardized on Microsoft SQL Server.

Configuration

database:
driver: postgres
dsn: "postgres://certeasy:secret@db01:5432/certeasy?sslmode=require"
ping-timeout-sec: 5
max-idle-conn: 5
max-conn: 10
conn-max-lifetime: 2m
conn-max-idle-time: 1m

SQLite (default)

If database is omitted entirely, Certeasy uses SQLite at %WORKDIR%/db.sqlite.

# Explicit SQLite config
database:
driver: sqlite
path: "C:\\ProgramData\\certeasy\\db.sqlite"

PostgreSQL

database:
driver: postgres
dsn: "postgres://certeasy:secret@db01:5432/certeasy?sslmode=require"

SQL Server

database:
driver: sqlserver
dsn: "sqlserver://certeasy:secret@sqlserver01:1433?database=certeasy"

Fields

FieldDefaultDescription
driversqliteDatabase driver: sqlite, postgres, sqlserver
dsnConnection string (PostgreSQL and SQL Server)
path%WORKDIR%/db.sqliteFile path (SQLite only)
ping-timeout-sec10Timeout for the startup connectivity check
max-idle-conn2 (SQLite), 5 (others)Maximum idle connections
max-conn10Maximum open connections
conn-max-lifetime2m (PostgreSQL / SQL Server), unset for SQLiteHard cap on a pooled connection's total lifetime. The default sits strictly below typical firewall / NAT idle timeouts (5–15 min) so the pool recycles before the network drops a stale connection — otherwise the next use surfaces as Read: EOF. 0 disables the cap.
conn-max-idle-time1m (PostgreSQL / SQL Server), unset for SQLiteA connection idle in the pool longer than this is closed. Complements conn-max-lifetime for hosts that drop idle sockets aggressively. 0 disables.

Migrations

Certeasy runs database migrations automatically at startup. Migrations are embedded in the binary — no external SQL files are needed. If the schema is already up to date, startup proceeds immediately.

Schema Reference

See Schema Reference for the full list of tables and their lifecycle.