Configuration Options
Quick reference for all harperdb-config.yaml top-level sections.
For how to apply configuration (YAML file, environment variables, CLI, Operations API), see Configuration Overview.
http
Configures the Harper component server (HTTP, REST API, WebSocket). See HTTP Configuration for full details.
http:
port: 9926
securePort: 4443
cors: true
timeout: 120000
mtls: false
logging:
level: info
path: ~/hdb/log/http.log
sessionAffinity— Route requests from same client to same worker thread (ipor header name)compressionThreshold— Response size threshold for Brotli compression; Default:1200(bytes)cors— Enable CORS; Default:truecorsAccessList— Allowed domains for CORS requestscorsAccessControlAllowHeaders—Access-Control-Allow-Headersvalue for OPTIONS preflightheadersTimeout— Max wait for complete HTTP headers (ms); Default:60000maxHeaderSize— Max HTTP header size (bytes); Default:16394requestQueueLimit— Max estimated request queue time (ms) before 503; Default:20000keepAliveTimeout— Inactivity before closing keep-alive connection (ms); Default:30000port— HTTP port; Default:9926securePort— HTTPS port; requires TLS configuration; Default:nullhttp2— Enable HTTP/2; Default:false(Added in: v4.5.0)timeout— Request timeout (ms); Default:120000mtls— Enable mTLS authentication for incoming connections; sub-options:user,required,certificateVerification(see Certificate Verification)logging— HTTP request logging (disabled by default, Added in: v4.6.0); sub-options:level,path,timing,headers,id. See Logging Configuration
threads
Worker thread pool configuration.
threads:
count: 11
maxHeapMemory: 300
count— Number of worker threads; Default: CPU count minus onemaxHeapMemory— Heap limit per thread (MB)heapSnapshotNearLimit— Take heap snapshot when approaching limitdebug— Enable debugging; sub-options:port,startingPort,host,waitForDebugger
authentication
Authentication and session configuration. Added in: v4.1.0; enableSessions added in v4.2.0. See Authentication Configuration.
authentication:
authorizeLocal: true
cacheTTL: 30000
enableSessions: true
operationTokenTimeout: 1d
refreshTokenTimeout: 30d
authorizeLocal— Auto-authorize loopback requests as superuser; Default:truecacheTTL— Session cache duration (ms); Default:30000enableSessions— Cookie-based sessions; Default:trueoperationTokenTimeout— Access token lifetime; Default:1drefreshTokenTimeout— Refresh token lifetime; Default:1dlogging— Authentication event logging (Added in: v4.6.0); sub-options:path,level,tag,stdStreams. See Logging Configuration
operationsApi
Harper Operations API endpoint configuration. See Operations API Overview.
operationsApi:
network:
port: 9925
cors: true
tls:
certificate: ~/hdb/keys/certificate.pem
privateKey: ~/hdb/keys/privateKey.pem
network.cors/network.corsAccessList— CORS settingsnetwork.domainSocket— Unix socket path for CLI communication; Default:<rootPath>/hdb/operations-servernetwork.headersTimeout/network.keepAliveTimeout/network.timeout— Timeout settings (ms)network.port— Operations API port; Default:9925network.securePort— HTTPS port; Default:nulltls— TLS override for the Operations API; sub-options:certificate,certificateAuthority,privateKey. Seetls
tls
Global TLS configuration for HTTPS and TLS sockets (used by HTTP and MQTT). Can be a single object or an array for SNI. See TLS and Certificate Management.
tls:
certificate: ~/hdb/keys/certificate.pem
certificateAuthority: ~/hdb/keys/ca.pem
privateKey: ~/hdb/keys/privateKey.pem
certificate— Path to TLS certificate; Default:<rootPath>/keys/certificate.pemcertificateAuthority— Path to CA file; Default:<rootPath>/keys/ca.pemprivateKey— Path to private key; Default:<rootPath>/keys/privateKey.pemciphers— Allowed TLS cipher suites
mqtt
MQTT protocol configuration. Added in: v4.2.0. See MQTT Configuration.
mqtt:
network:
port: 1883
securePort: 8883
webSocket: true
requireAuthentication: true
network.port— Insecure MQTT port; Default:1883network.securePort— Secure MQTT port; Default:8883network.mtls— Enable mTLS for MQTT connections; sub-options:user,required,certificateAuthority,certificateVerificationwebSocket— Enable MQTT over WebSocket on HTTP port; Default:truerequireAuthentication— Require credentials or mTLS; Default:truelogging— MQTT event logging (Added in: v4.6.0); sub-options:path,level,tag,stdStreams. See Logging Configuration
logging
Application logging. Added in: v4.1.0; per-component logging added in v4.6.0. See Logging Configuration.
logging:
level: warn
root: ~/hdb/log
stdStreams: false
auditLog: false
rotation:
interval: 1D
maxSize: 100M
level— Log verbosity (trace→debug→info→warn→error→fatal→notify); Default:warnfile— Write to file; Default:trueroot— Log directory; Default:<rootPath>/logpath— Explicit log file path (overridesroot)stdStreams— Write to stdout/stderr; Default:falseconsole— Includeconsole.*output; Default:trueauditLog— Enable table transaction audit logging; Default:falseauditRetention— Audit log retention duration; Default:3dexternal— Logging for components using the logger API; sub-options:level,pathrotation.enabled/rotation.compress/rotation.interval/rotation.maxSize/rotation.path— Log file rotation (activates whenintervalormaxSizeis set)auditAuthEvents.logFailed/auditAuthEvents.logSuccessful— Log failed/successful authentication events; Default:false
replication
Native WebSocket-based replication (Plexus). Added in: v4.4.0. See Replication and Clustering.
replication:
hostname: server-one
url: wss://server-one:9933
databases: '*'
routes:
- wss://server-two:9933
hostname— This instance's hostname within the clusterurl— WebSocket URL peers use to connect to this instancedatabases— Databases to replicate; Default:"*"(all). Each entry supportsnameandshardedroutes— Peer nodes; URL strings or{hostname, port, startTime, revokedCertificates}objectsport— Replication portsecurePort— Secure replication port; Default:9933(changed from9925in v4.5.0)enableRootCAs— Verify against Node.js Mozilla CA store; Default:trueblobTimeout— Blob transfer timeout (ms); Default:120000failOver— Failover to alternate node if peer unreachable; Default:trueshard— Shard ID for traffic routing; see Shardingmtls.certificateVerification— Certificate revocation checking (CRL/OCSP) for replication connections; see Certificate Verificationlogging— Replication event logging; sub-options:path,level,tag,stdStreams. See Logging Configuration
storage
Database storage configuration. See Database Overview and Compaction.
storage:
path: ~/hdb/database
caching: true
compression: true
compactOnStart: false
writeAsync— Disable disk sync for higher throughput (disables durability guarantees); Default:falsecaching— In-memory record caching; Default:truecompression— LZ4 record compression; Default:true(enabled by default since v4.3.0). Sub-options:dictionary,thresholdcompactOnStart— Compact all non-system databases on startup; Default:false(Added in: v4.3.0)compactOnStartKeepBackup— Retain compaction backups; Default:falsemaxTransactionQueueTime— Max write queue time before 503; Default:45snoReadAhead— Advise OS against read-ahead; Default:falseprefetchWrites— Prefetch before write transactions; Default:truepath— Database files directory; Default:<rootPath>/databaseblobPaths— Blob storage directory or directories; Default:<rootPath>/blobs(Added in: v4.5.0)pageSize— Database page size (bytes); Default: OS defaultreclamation.threshold/reclamation.interval/reclamation.evictionFactor— Background storage reclamation settings (Added in: v4.5.0)
databases
Per-database and per-table file path overrides. Must be set before the database/table is created. See Database Overview.
databases:
myDatabase:
path: /data/myDatabase
auditPath: /data/myDatabase-audit
tables:
myTable:
path: /data/myTable
<dbName>.path— Database files directory<dbName>.auditPath— Audit log directory for this database<dbName>.tables.<tableName>.path— Table files directory
analytics
Analytics aggregation configuration. See Analytics Overview.
analytics:
aggregatePeriod: 60
replicate: false
aggregatePeriod— Aggregation interval (seconds); Default:60(Added in: v4.5.0)replicate— Replicate analytics data across cluster; Default:false
localStudio
Local Harper Studio GUI. See Studio.
localStudio:
enabled: true
enabled— Enable local Studio athttp://localhost:<port>; Default:false
componentsRoot
Path to local component files. Added in: v4.2.0 (previously customFunctionsRoot). See Components.
componentsRoot: ~/hdb/components
rootPath
Root directory for all Harper persistent data, config, logs, and components.
rootPath: /var/lib/harper
Component Configuration
Installed components are configured directly at the root of harperdb-config.yaml using the component name as the key — not nested under a components: section. See Components.
my-component:
package: 'HarperDB-Add-Ons/my-component'
port: 4321
<component-name>.package— NPM package name, GitHub repo (user/repo), or local path<component-name>.port— Port for the component; Default: value ofhttp.port