---
title: "Persistence"
description: "Reference for the wallet2-persistence.conf configuration file."
stack: "Community Stack (open source) — version 1.1.1"
stack_version: "1.1.1"
stack_comparison: https://docs.walt.id/community-vs-enterprise.md
canonical_url: https://docs.walt.id/community-stack/wallet2/configurations/config-files/persistence
generated: 2026-10-01
---
# Persistence Configuration

`wallet2-persistence.conf` configures SQL persistence for Wallet API v2 wallets, keys, DIDs, and credentials.

**Note:**

The shipped configuration enables `wallet2-persistence`, so wallet data persists to SQLite by default and survives restarts. If you remove `wallet2-persistence` from [`_features.conf`](https://docs.walt.id/community-stack/wallet2/configurations/config-files/features.md), the service keeps all data in memory and loses it on restart.

## File Location

```
waltid-services/waltid-wallet-api2/config/wallet2-persistence.conf
```

## Fields

### `jdbcUrl`

_String_ — JDBC connection URL.

- **SQLite** — Defaults to `jdbc:sqlite:wallet2.db`.
- **PostgreSQL** — Supported with `jdbc:postgresql://...` URLs.

### `driverClassName`

_String_ — JDBC driver class.

- **SQLite** — Defaults to `org.sqlite.JDBC`.
- **PostgreSQL** — Use `org.postgresql.Driver`.

### `username`

_String_ — Database username.

This is only relevant for database engines that require credentials, such as PostgreSQL. Defaults to an empty string.

### `password`

_String_ — Database password.

This is only relevant for database engines that require credentials, such as PostgreSQL. Defaults to an empty string.

### `maximumPoolSize`

_Int_ — Maximum database connection pool size.

Defaults to `5`.

### `minimumIdle`

_Int_ — Minimum idle database connections.

Defaults to `1`.

## SQLite

```hocon
# wallet2-persistence.conf
jdbcUrl = "jdbc:sqlite:data/wallet2.db"
driverClassName = "org.sqlite.JDBC"
```

## PostgreSQL

```hocon
# wallet2-persistence.conf
jdbcUrl = "jdbc:postgresql://localhost:5432/wallet2"
driverClassName = "org.postgresql.Driver"
username = "wallet"
password = "secret"
maximumPoolSize = 10
minimumIdle = 1
```

**Note:**

Enabling persistence requires listing `wallet2-persistence` in [`_features.conf`](https://docs.walt.id/community-stack/wallet2/configurations/config-files/features.md), then restarting the service.

Set `jdbcUrl` (and the other options) directly in `wallet2-persistence.conf`. When running via Docker, mount your edited config directory into the container so these values take effect.
