> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/server/getting-started/installation/database-setup/database-instance/sqlite.md). Agents can also search and read this documentation through its [MCP server](https://docs.devolutions.net/~gitbook/mcp).

# SQLite

Use a SQLite database file with Devolutions Server: single-node rules, lock files, creation with the Devolutions Server Console or Docker, backup and restore.

Devolutions Server can store its data in a ***SQLite*** database file on the local disk of the Devolutions Server machine, instead of a Microsoft SQL Server or PostgreSQL server. SQLite needs no database server and no database accounts, but only one Devolutions Server node can use the file. Choose Microsoft SQL Server or [PostgreSQL](https://docs.devolutions.net/server/getting-started/installation/database-setup/database-instance/postgresql.md) for high availability or load balancing.

## Rules

<table><thead><tr><th width="230">RULE</th><th>DETAILS</th></tr></thead><tbody><tr><td><strong>One active node</strong></td><td>Exactly one Devolutions Server instance or maintenance process may use the database file at a time. The separate Devolutions Scheduler service is not supported with SQLite: scheduling runs embedded in Devolutions Server. SQLite is not suitable for high availability, load balancing, active-passive nodes on shared storage, or several container replicas.</td></tr><tr><td><strong>Local file</strong></td><td>The file must be on the local storage of the Devolutions Server machine (or a block-storage volume attached to it), not on a network or distributed file system (SMB, NFS, synchronized folders, object-store mounts). Network paths that start with <code>\\</code> are refused.</td></tr><tr><td><strong>Absolute path</strong></td><td>The path must be a full path to a file, for example <code>C:\DevolutionsServer\Data\Devolutions_Server.db</code>. Otherwise the Devolutions Server Console shows "The SQLite database file must be an absolute local file path."</td></tr><tr><td><strong>Creation</strong></td><td>On a new installation, the Devolutions Server Console creates the file. Create its parent folder first, with permissions that protect it.</td></tr><tr><td><strong>Connection settings</strong></td><td>Devolutions Server opens the file with foreign keys turned on, a 5-second busy timeout and the write-ahead logging (WAL) mode. SQLite allows only one writer at a time.</td></tr><tr><td><strong>Companion files</strong></td><td>SQLite keeps <code>&#x3C;file>-wal</code> and <code>&#x3C;file>-shm</code> (sometimes <code>&#x3C;file>-journal</code>) next to the database file. Devolutions Server also creates <code>&#x3C;file>.lock</code> (schema upgrades) and, in the Docker image, <code>&#x3C;file>.container.lock</code> (held by the running server). Keep them together and don't delete them while Devolutions Server runs.</td></tr><tr><td><strong>File already in use</strong></td><td>When another process holds the lock, Devolutions Server doesn't start and logs "The SQLite database '{path}' is already in use by another process."</td></tr><tr><td><strong>Encryption keys</strong></td><td>The database, its companion files and the encryption configuration of the instance must be on persistent, protected storage.</td></tr></tbody></table>

## Differences from SQL Server and PostgreSQL

* No database accounts: in the Devolutions Server Console, ***Host***, ***Database***, ***Authentication type***, ***Username***, ***Password***, ***Advanced settings*** and ***Advanced credentials*** are hidden; only ***File*** is shown. See [Database](https://docs.devolutions.net/server/devolutions-server-console/devolutions-server-settings/database.md).
* No least permissions: ***Apply least permissions*** and ***Generate script...*** are not available.
* No compatibility level step during the installation and the upgrade.
* No database accounts are added to the infrastructure vault.
* Don't add server credentials, ports, TLS parameters or SQL Server options to a SQLite connection string. `DATABASE_ENCRYPT` and `DATABASE_TRUST_SERVER_CERTIFICATE` don't protect a SQLite file.

## Create an instance on SQLite

### With the Devolutions Server Console

1. Start an installation in the Devolutions Server Console, as described in [Devolutions Server instance creation](https://docs.devolutions.net/server/getting-started/installation/devolutions-server-instance-creation.md).
2. On the ***Setting database information*** page (or the database page of the basic installation), set ***Database engine*** to ***SQLite***.
3. In ***File***, enter the full path of the database file, or click the browse button and choose a folder and a file name. The proposed name is `Devolutions_Server.db` (filter ***SQLite DB files (\*.db)*** or ***All files***).
4. Click ***Test connection***, then complete the wizard.

### With the command line

The command line of the Devolutions Server Console (`DPS.Console.CLI.exe`) creates a SQLite database with `--database-type Sqlite` and `--database-file`:

```powershell
DPS.Console.CLI.exe server db create --database-type Sqlite --database-file 'D:\DVLS\Data\dvls.sqlite' --accept-eula
```

The connection string written for the instance is equivalent to `Data Source=D:\DVLS\Data\dvls.sqlite;Mode=ReadWriteCreate`. The `Mode` keyword (or another SQLite-only keyword) is required: a bare `Data Source=...` is read as a SQL Server connection string. To switch an existing instance to a SQLite file, use `server instance --instance '<instance name>' --database-type Sqlite --database-file '<path>'`.

### With Docker

Set `DATABASE_TYPE=SQLite` and `DATABASE_PATH` to an absolute file path below the persisted `App_Data` folder of the container (`/opt/devolutions/dvls/App_Data` by default), for example `/opt/devolutions/dvls/App_Data/dvls.sqlite`. With SQLite, the container refuses `DATABASE_HOST`, `DATABASE_NAME`, `DATABASE_USERNAME`, `DATABASE_PASSWORD`, `DATABASE_PASSWORD_FILE`, `DATABASE_PORT` and their `AZURE_SQL_*` equivalents. Persist the whole `App_Data` folder, not only the database file: it also holds the encryption configuration, the application identity and the SQLite companion files. See [Devolutions Server Docker deployment](https://docs.devolutions.net/server/knowledge-base/how-to-articles/devolutions-server-docker-deployment.md).

Never mount the same volume into another Devolutions Server replica, initialization job or scheduler while the container runs. Kubernetes deployments with several replicas or read-write-many volumes are not supported with SQLite.

## Back up a SQLite database

The built-in backup job of the [Backup manager](https://docs.devolutions.net/server/web-interface/administration/backup/backup-manager.md) creates a `.sqlite` copy with the SQLite online backup (or `VACUUM INTO`), then opens the copy read-only and runs an integrity check: the backup succeeds only when the check returns `ok`. With a backup password, the copy is placed in the password-protected ZIP file. A failure shows "SQLite online backup failed.", "SQLite VACUUM INTO backup failed." or "SQLite backup integrity check failed." No external database tool is needed.

In the Docker image, the update mode (`DVLS_UPDATE_MODE`) first saves a checked copy of the database as `App_Data/Backups/database/dvls-pre-update-<timestamp>-<id>.sqlite`. `DVLS_BACKUP_PATH` changes that location.

{% hint style="warning" %}
Don't copy the database file alone while Devolutions Server runs: the copy may miss the data still in the `-wal` file. The backup doesn't include the encryption keys: back up the encryption configuration separately. A backup can be restored only into SQLite.
{% endhint %}

## Restore a SQLite backup

1. Stop Devolutions Server, the Devolutions Scheduler service and every process that could open the database. Make sure no active node holds `<file>.lock`.
2. Keep a copy of the current database and of its encryption configuration.
3. Restore the matching encryption configuration (`encryption.config`) of the instance.
4. Replace the database file with the backup file. Extract it first when the backup is a password-protected ZIP file.
5. Delete the old `<file>-wal`, `<file>-shm` and `<file>-journal` files: never mix them with a restored file.
6. Set the file permissions, start the single Devolutions Server node and sign in to check the data.

To move a SQLite database to Microsoft SQL Server or PostgreSQL, see [Migrate between database engines](https://docs.devolutions.net/server/getting-started/installation/database-setup.md#migrate-between-database-engines).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.devolutions.net/server/getting-started/installation/database-setup/database-instance/sqlite.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
