> 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/knowledge-base/how-to-articles/devolutions-server-docker-deployment/deploy-devolutions-server-and-sql-server-with-docker-compose-on-windows.md).

# Deploy Devolutions Server and SQL Server with Docker Compose on Windows

Deploy Devolutions Server and SQL Server on Windows with Docker Compose, either all in containers or against an existing SQL Server, then verify and troubleshoot the deployment.

This article shows how to deploy Devolutions Server on a Windows machine with Docker Compose. Two deployment options are covered:

* **All-in-one**: Devolutions Server and SQL Server both run in containers on the same Docker network. Best suited for evaluations, labs, and test environments.
* **Hybrid**: Devolutions Server runs in a container and connects to an existing SQL Server installed on the host or on another server. Best suited for organizations that already manage their own SQL Server.

Both options use the same container names. Use only one option per host.

To deploy Devolutions Server with individual `docker run` commands instead, see [Deploy Devolutions Server with Docker](https://docs.devolutions.net/server/knowledge-base/how-to-articles/devolutions-server-docker-deployment.md). For the full list of environment variables, see [Advanced Docker configuration for Devolutions Server](https://docs.devolutions.net/server/knowledge-base/how-to-articles/devolutions-server-docker-deployment/advanced-docker-configuration-for-devolutions-server.md).

{% hint style="info" %}
For the sake of simplicity, Devolutions Server's Docker image version is written `20XX.X` in the code blocks of this article. Change this variable to the version you wish to use.
{% endhint %}

### Prerequisites

* [Docker Desktop](https://docs.docker.com/desktop/setup/install/windows-install/) for Windows with the WSL 2 back end, running in **Linux containers** mode. The Devolutions Server and SQL Server images are Linux images.
* Docker Compose v2 or later (included with Docker Desktop). Run `docker compose version` to confirm it is available.
* At least 4 GB of memory allocated to Docker. SQL Server needs at least 2 GB to start.
* The minimum [system requirements](https://docs.devolutions.net/server/overview-of-devolutions-server/system-requirements.md) to run Devolutions Server.
* For the hybrid option only: an existing SQL Server instance prepared as described in [Prepare an existing SQL Server](#prepare-an-existing-sql-server-hybrid-option).

{% hint style="warning" %}
The Devolutions Server container connects to SQL Server with **SQL Server authentication**. Windows Authentication from a Linux container requires a Kerberos configuration that is not covered here. If you need Windows Authentication, [install Devolutions Server on Windows](https://docs.devolutions.net/server/getting-started/installation.md) instead.
{% endhint %}

### Choose an image tag

The `devolutions/devolutions-server` image does **not** publish a `latest` tag. Use one of the following tag formats, available on [Docker Hub](https://hub.docker.com/r/devolutions/devolutions-server/tags):

| Tag format                       | Example          | Use                                                            |
| -------------------------------- | ---------------- | -------------------------------------------------------------- |
| `release-<year>.<minor>`         | `release-20XX.X` | Follows the newest patch of a release. Convenient for testing. |
| `<year>.<minor>.<patch>.<build>` | `20XX.X.X.X`     | Fixed version. Recommended for production.                     |

### All-in-one deployment

#### Create the configuration files

1. Create an empty folder for the deployment, for example `C:\dvls`, then restrict its access to the current user, SYSTEM, and the Administrators group. Run the following commands in PowerShell:

   ```powershell
   New-Item -ItemType Directory -Path C:\dvls
   icacls C:\dvls /inheritance:r /grant:r "$(whoami):(OI)(CI)F" "*S-1-5-18:(OI)(CI)F" "*S-1-5-32-544:(OI)(CI)F"
   ```
2. In that folder, create a file named `.env` with the following content, and replace every value between angle brackets:

   ```
   MSSQL_SA_PASSWORD=<StrongSaPassword>
   MSSQL_PID=Express
   DVLS_IMAGE_TAG=release-20XX.X
   DATABASE_NAME=DVLS
   DVLS_ADMIN_USERNAME=dvls-admin
   DVLS_ADMIN_PASSWORD=<StrongAdminPassword>
   DVLS_HOSTNAME=localhost
   DVLS_HOST_PORT=5000
   SQL_HOST_PORT=1434
   ```

   * `MSSQL_SA_PASSWORD` must contain at least 8 characters and at least three of the following: uppercase letters, lowercase letters, digits, and symbols. Otherwise, SQL Server refuses to start.
   * `MSSQL_PID` selects the SQL Server edition. `Express` is free but limited to 10 GB per database. `Developer` is free but cannot be used in production. `Standard` and `Enterprise` require a SQL Server license.
   * `SQL_HOST_PORT` is the port used to reach the SQL Server container from the host, for example with SQL Server Management Studio. Port `1434` avoids a conflict with a SQL Server already installed on the host.

{% hint style="warning" %}
The `.env` file contains passwords. Keep the restricted folder permissions, and keep the file out of version control. Avoid the `$` character in passwords, since Docker Compose interprets it as a variable.
{% endhint %}

3. In the same folder, create a file named `docker-compose.yml` with the following content:

   ```yaml
   services:
     sqlserver:
       image: mcr.microsoft.com/mssql/server:2022-latest
       container_name: dvls-sqlserver
       restart: unless-stopped
       environment:
         ACCEPT_EULA: "Y"
         MSSQL_SA_PASSWORD: ${MSSQL_SA_PASSWORD}
         MSSQL_PID: ${MSSQL_PID}
       ports:
         - "${SQL_HOST_PORT}:1433"
       volumes:
         - mssqldata:/var/opt/mssql
       healthcheck:
         test: ["CMD-SHELL", "/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P \"$$MSSQL_SA_PASSWORD\" -Q 'SELECT 1' -C -N -b"]
         interval: 10s
         timeout: 5s
         retries: 30
         start_period: 120s

     # One-time initialization: creates the database schema, the administrator, and the encryption configuration.
     dvls-init:
       image: devolutions/devolutions-server:${DVLS_IMAGE_TAG}
       profiles: ["init"]
       volumes:
         - dvlsdata:/opt/devolutions/dvls/App_Data
       environment:
         DVLS_INIT: "true"
         DATABASE_HOST: sqlserver
         DATABASE_PORT: "1433"
         DATABASE_NAME: ${DATABASE_NAME}
         DATABASE_USERNAME: sa
         DATABASE_PASSWORD: ${MSSQL_SA_PASSWORD}
         DATABASE_ENCRYPT: "true"
         DATABASE_TRUST_SERVER_CERTIFICATE: "true"
         DVLS_ADMIN_USERNAME: ${DVLS_ADMIN_USERNAME}
         DVLS_ADMIN_PASSWORD: ${DVLS_ADMIN_PASSWORD}
         HOSTNAME: ${DVLS_HOSTNAME}
         WEB_SCHEME: http
         WEB_PORT: "5000"
         EXTERNAL_WEB_PORT: "${DVLS_HOST_PORT}"
       depends_on:
         sqlserver:
           condition: service_healthy

     dvls:
       image: devolutions/devolutions-server:${DVLS_IMAGE_TAG}
       container_name: dvls-app
       restart: unless-stopped
       ports:
         - "${DVLS_HOST_PORT}:5000"
       volumes:
         - dvlsdata:/opt/devolutions/dvls/App_Data
       environment:
         DATABASE_HOST: sqlserver
         DATABASE_PORT: "1433"
         DATABASE_NAME: ${DATABASE_NAME}
         DATABASE_USERNAME: sa
         DATABASE_PASSWORD: ${MSSQL_SA_PASSWORD}
         DATABASE_ENCRYPT: "true"
         DATABASE_TRUST_SERVER_CERTIFICATE: "true"
         HOSTNAME: ${DVLS_HOSTNAME}
         WEB_SCHEME: http
         WEB_PORT: "5000"
         EXTERNAL_WEB_PORT: "${DVLS_HOST_PORT}"
       depends_on:
         sqlserver:
           condition: service_healthy

   volumes:
     mssqldata:
     dvlsdata:
   ```

The `dvlsdata` volume is shared by the `dvls-init` and `dvls` services. It stores the encryption configuration that the initialization generates, so the runtime container can decrypt the data in the database. The `mssqldata` volume stores the SQL Server databases.

{% hint style="warning" %}
This example uses the SQL Server `sa` account to keep the evaluation setup simple. For production, create a dedicated SQL login with [least-privilege access](https://docs.devolutions.net/server/knowledge-base/knowledge-base-articles/pre-deployment-account-survey.md#windows-sql-accounts) and use it in `DATABASE_USERNAME` and `DATABASE_PASSWORD`.
{% endhint %}

#### Start the deployment

1. Open PowerShell and go to the deployment folder:

   ```powershell
   cd C:\dvls
   ```
2. Confirm that Docker Compose reads the `.env` file correctly. Both image names must include a tag:

   ```powershell
   docker compose config | Select-String 'image:'
   ```
3. Download the images, including the initialization image:

   ```powershell
   docker compose --profile init pull
   ```
4. Initialize the database and create the administrator account. This step is only needed for the first deployment:

   ```powershell
   docker compose --profile init run --rm dvls-init
   ```
5. If the command does not return after `Initialization completed successfully.` is displayed, press Ctrl+C. The initialization container is removed automatically.

{% hint style="warning" %}
Do not start Devolutions Server while the initialization container is still running. Do not run the initialization again on an existing deployment.
{% endhint %}

6. Start Devolutions Server and SQL Server:

   ```powershell
   docker compose up -d
   ```
7. Follow the Devolutions Server log. SQL Server can take up to two minutes on its first start. Devolutions Server is usually ready a few seconds later, since the initialization already applied the database migrations. Press Ctrl+C to stop following the log:

   ```powershell
   docker compose exec dvls sh -c "tail -n 50 -f /opt/devolutions/dvls/App_Data/DPS_Main*.log"
   ```
8. Open `http://localhost:5000` in a browser (or the port set in `DVLS_HOST_PORT`), then log in with the `DVLS_ADMIN_USERNAME` and `DVLS_ADMIN_PASSWORD` values from the `.env` file.
9. Back up the encryption configuration. It is required to restore or redeploy Devolutions Server with the same database:

   ```powershell
   docker compose cp dvls:/opt/devolutions/dvls/App_Data/encryption.config .\encryption.config
   ```
10. Move `encryption.config` to a secure location outside the deployment folder.

{% hint style="danger" %}
Without the encryption configuration, the data stored in the database cannot be decrypted. Never delete the `dvlsdata` volume unless you have a backup of `encryption.config`.
{% endhint %}

{% hint style="info" %}
This example serves Devolutions Server over HTTP to keep the setup simple. Before giving users access, configure HTTPS with a TLS certificate or a reverse proxy, as described in [Advanced Docker configuration for Devolutions Server](https://docs.devolutions.net/server/knowledge-base/how-to-articles/devolutions-server-docker-deployment/advanced-docker-configuration-for-devolutions-server.md#tls-certificate-configuration).
{% endhint %}

### Hybrid deployment

In this option, only Devolutions Server runs in a container. It connects to an existing SQL Server, for example SQL Server Express installed on the same Windows host.

#### Prepare an existing SQL Server (hybrid option)

Using SQL Server Configuration Manager and SQL Server Management Studio, make sure that the SQL Server instance has:

1. The **TCP/IP** protocol enabled. SQL Server Express ships with TCP/IP disabled.
2. A **static TCP port** configured (for example, `1433`). A container cannot use a named instance such as `HOST\SQLEXPRESS`; it must connect to a host and port.
3. **SQL Server and Windows Authentication mode** (mixed mode) enabled.
4. A dedicated SQL login for Devolutions Server. Do not use `sa`. Either create the database first and make the login its `db_owner` (recommended), or give the login the `dbcreator` server role and let the initialization create the database.
5. An inbound Windows Firewall rule allowing the SQL Server port.

The following script creates the login and the database, and makes the login the database owner. Replace `<StrongPassword>` before running it:

```sql
CREATE LOGIN dvls_login WITH PASSWORD = N'<StrongPassword>';
CREATE DATABASE DVLS;
GO
USE DVLS;
CREATE USER dvls_login FOR LOGIN dvls_login;
ALTER ROLE db_owner ADD MEMBER dvls_login;
```

The `SQL_DATABASE` value in the `.env` file must match this database name.

#### Create the hybrid configuration files

1. Create an empty folder for the deployment, for example `C:dvls`, then restrict its access to the current user, SYSTEM, and the Administrators group. Run the following commands in PowerShell:

   ```powershell
   New-Item -ItemType Directory -Path C:dvls
   icacls C:dvls /inheritance:r /grant:r "$(whoami):(OI)(CI)F" "*S-1-5-18:(OI)(CI)F" "*S-1-5-32-544:(OI)(CI)F"
   ```
2. In that folder, create a `.env` file with the following content, and replace every value between angle brackets:

   ```
   DVLS_IMAGE_TAG=release-20XX.X
   SQL_HOST=host.docker.internal
   SQL_PORT=1433
   SQL_DATABASE=DVLS
   SQL_LOGIN=<DvlsSqlLogin>
   SQL_PASSWORD=<DvlsSqlLoginPassword>
   DVLS_ADMIN_USERNAME=dvls-admin
   DVLS_ADMIN_PASSWORD=<StrongAdminPassword>
   DVLS_HOSTNAME=localhost
   DVLS_HOST_PORT=5000
   ```

   `host.docker.internal` lets the container reach a SQL Server installed on the Docker host. If SQL Server runs on another server, replace it with that server's name or IP address.
3. In the same folder, create a `docker-compose.yml` file with the following content:

   ```yaml
   services:
     # One-time initialization: creates the database schema, the administrator, and the encryption configuration.
     dvls-init:
       image: devolutions/devolutions-server:${DVLS_IMAGE_TAG}
       profiles: ["init"]
       volumes:
         - dvlsdata:/opt/devolutions/dvls/App_Data
       environment:
         DVLS_INIT: "true"
         DATABASE_HOST: ${SQL_HOST}
         DATABASE_PORT: "${SQL_PORT}"
         DATABASE_NAME: ${SQL_DATABASE}
         DATABASE_USERNAME: ${SQL_LOGIN}
         DATABASE_PASSWORD: ${SQL_PASSWORD}
         DATABASE_ENCRYPT: "true"
         DATABASE_TRUST_SERVER_CERTIFICATE: "true"
         DVLS_ADMIN_USERNAME: ${DVLS_ADMIN_USERNAME}
         DVLS_ADMIN_PASSWORD: ${DVLS_ADMIN_PASSWORD}
         HOSTNAME: ${DVLS_HOSTNAME}
         WEB_SCHEME: http
         WEB_PORT: "5000"
         EXTERNAL_WEB_PORT: "${DVLS_HOST_PORT}"
       extra_hosts:
         - "host.docker.internal:host-gateway"

     dvls:
       image: devolutions/devolutions-server:${DVLS_IMAGE_TAG}
       container_name: dvls-app
       restart: unless-stopped
       ports:
         - "${DVLS_HOST_PORT}:5000"
       volumes:
         - dvlsdata:/opt/devolutions/dvls/App_Data
       environment:
         DATABASE_HOST: ${SQL_HOST}
         DATABASE_PORT: "${SQL_PORT}"
         DATABASE_NAME: ${SQL_DATABASE}
         DATABASE_USERNAME: ${SQL_LOGIN}
         DATABASE_PASSWORD: ${SQL_PASSWORD}
         DATABASE_ENCRYPT: "true"
         DATABASE_TRUST_SERVER_CERTIFICATE: "true"
         HOSTNAME: ${DVLS_HOSTNAME}
         WEB_SCHEME: http
         WEB_PORT: "5000"
         EXTERNAL_WEB_PORT: "${DVLS_HOST_PORT}"
       extra_hosts:
         - "host.docker.internal:host-gateway"

   volumes:
     dvlsdata:
   ```

{% hint style="info" %}
`DATABASE_TRUST_SERVER_CERTIFICATE=true` accepts the SQL Server certificate without validating it. If your SQL Server presents a certificate issued by a trusted authority, remove this variable. See [Encrypted database connection (TLS)](https://docs.devolutions.net/server/knowledge-base/how-to-articles/devolutions-server-docker-deployment/advanced-docker-configuration-for-devolutions-server.md#encrypted-database-connection-tls).
{% endhint %}

#### Start the hybrid deployment

Run the same commands as for the all-in-one deployment, from the deployment folder:

```powershell
docker compose --profile init pull
docker compose --profile init run --rm dvls-init
docker compose up -d
docker compose exec dvls sh -c "tail -n 50 -f /opt/devolutions/dvls/App_Data/DPS_Main*.log"
```

If the initialization command does not return after `Initialization completed successfully.` is displayed, press Ctrl+C before running `docker compose up -d`.

Then log in to Devolutions Server, back up `encryption.config` with the same `docker compose cp` command as for the all-in-one deployment, and move the file to a secure location outside the deployment folder.

### Deploy on another server

To reproduce the deployment on another Windows server, follow the steps below. They create a new, empty deployment: the data and the encryption configuration of the first server are not copied.

1. Install Docker Desktop on the target server (see [Prerequisites](#prerequisites)).
2. Create a folder and copy the `docker-compose.yml` and `.env` files into it. Change the passwords in `.env` if needed.
3. Run `Get-ChildItem` in the folder and make sure the files are named exactly `.env` and `docker-compose.yml`. Notepad can add a hidden `.txt` extension.
4. Run the commands from [Start the deployment](#start-the-deployment).
5. To reach Devolutions Server from other computers, set `DVLS_HOSTNAME` to the server's fully qualified domain name and allow the `DVLS_HOST_PORT` port in Windows Firewall.

### Verify the deployment

Run the following commands from the deployment folder. The container names match the examples above.

| Check                                       | Command                                                                                                                                    |
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| Containers are running and SQL is healthy   | `docker compose ps`                                                                                                                        |
| SQL Server health status                    | `docker inspect --format '{{.State.Health.Status}}' dvls-sqlserver` (expected: `healthy`)                                                  |
| Devolutions Server resolves the SQL service | `docker exec dvls-app sh -c "getent hosts sqlserver"`                                                                                      |
| Devolutions Server reaches SQL on port 1433 | `docker exec dvls-app bash -c "(echo > /dev/tcp/sqlserver/1433) 2>&1 && echo OPEN \|\| echo BLOCKED"` (expected: `OPEN`)                   |
| Devolutions Server started correctly        | `docker exec dvls-app sh -c "grep -h -E 'Now listening\|Scheduler initialized' /opt/devolutions/dvls/App_Data/DPS_Main*.log \| tail -n 2"` |
| The web interface answers                   | `curl.exe -s -o NUL -w "%{http_code}" http://localhost:5000/` (expected: `200`)                                                            |

For the hybrid deployment, replace `sqlserver` with the value of `SQL_HOST` and `1433` with the value of `SQL_PORT`. The two SQL Server health rows do not apply, since there is no SQL Server container.

If you changed `DVLS_HOST_PORT`, replace `5000` with its value in the last row.

### Troubleshooting

| Symptom                                                                                                    | Solution                                                                                                                                                                                                                                                                                                                                             |
| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `failed to resolve reference "docker.io/devolutions/devolutions-server:latest": not found`                 | The `latest` tag does not exist. Use a `release-20XX.X` or `20XX.X.X.X` tag (see [Choose an image tag](#choose-an-image-tag)).                                                                                                                                                                                                                       |
| `The "DVLS_IMAGE_TAG" variable is not set` or `invalid reference format`                                   | The `.env` file is missing `DVLS_IMAGE_TAG`, or is not named exactly `.env`. Add the line and make sure the file has no `.txt` extension.                                                                                                                                                                                                            |
| `DATABASE_HOST or AZURE_SQL_HOST is required.`                                                             | The compose file uses environment variables from an older image version. Use the `DATABASE_*` variables shown in this article, map the host port to container port `5000`, and run the `dvls-init` service before the first start.                                                                                                                   |
| The SQL Server container never becomes healthy and the log shows `Password validation failed`              | `MSSQL_SA_PASSWORD` does not meet the SQL Server password policy. Use at least 8 characters with uppercase letters, lowercase letters, digits, and symbols.                                                                                                                                                                                          |
| The SQL Server container stays `unhealthy` and the log repeats `Login failed for user 'sa'`                | `MSSQL_SA_PASSWORD` is only applied the first time the `mssqldata` volume is created. If the volume already existed, SQL Server kept the previous password. Restore the previous password in `.env`, or remove the volumes as described in [Remove the deployment](#remove-the-deployment) if the data can be discarded.                             |
| `dependency sqlserver failed to start`, or the health status alternates between `starting` and `unhealthy` | The first SQL Server start can take up to two minutes on slower disks. Keep `retries: 30` and `start_period: 120s` in the health check, or increase them.                                                                                                                                                                                            |
| The SQL Server container stops right after it starts (out of memory)                                       | Increase the memory available to Docker to at least 4 GB in Docker Desktop (**Settings** – **Resources**).                                                                                                                                                                                                                                           |
| The web interface returns an error for the first minutes after `docker compose up -d`                      | This is expected while SQL Server completes its first start. Wait, and follow the Devolutions Server log with `docker compose exec dvls sh -c "tail -n 50 -f /opt/devolutions/dvls/App_Data/DPS_Main*.log"`.                                                                                                                                         |
| `Bind for 0.0.0.0:5000 failed: port is already allocated`                                                  | Another program uses port 5000 on the host. Set another value for `DVLS_HOST_PORT` in `.env`. To see which program uses the port, run `Get-NetTCPConnection -LocalPort 5000 -State Listen`.                                                                                                                                                          |
| The `dvls-init` command does not return after `Initialization completed successfully.`                     | Press Ctrl+C, then continue with the next step.                                                                                                                                                                                                                                                                                                      |
| `Unhandled exception. System.InvalidOperationException` at `CreateAdministrator` from `dvls-init`          | The deployment is already initialized. Skip the initialization step. Nothing is changed: the encryption configuration and the administrator password stay the same.                                                                                                                                                                                  |
| `Login failed for user '<login>'` (error 18456) from `dvls-init`                                           | Check the `SQL_LOGIN` and `SQL_PASSWORD` values in `.env`, that the login exists, and that SQL Server and Windows Authentication mode (mixed mode) is enabled.                                                                                                                                                                                       |
| The login page shows `Unable to find the encryption file. Please contact your administrator.`              | The runtime container does not have the encryption configuration created at initialization. Make sure both `dvls-init` and `dvls` mount the same `dvlsdata` volume at `/opt/devolutions/dvls/App_Data`. If the database already contains data encrypted with a lost key, that data cannot be recovered and the deployment must be initialized again. |
| The container cannot reach an existing SQL Server (hybrid option)                                          | Verify that TCP/IP is enabled, that a static port is configured, that the Windows Firewall allows the port, and that the `extra_hosts` entry is present when `SQL_HOST` is `host.docker.internal`.                                                                                                                                                   |
| `docker` is not recognized in PowerShell                                                                   | Start Docker Desktop, then open a new PowerShell window so the updated `PATH` is loaded.                                                                                                                                                                                                                                                             |

### Update Devolutions Server

Back up the database and `encryption.config` before updating.

1. Add the following `dvls-update` service under `services:` in `docker-compose.yml`, and add `dvlsbackup:` under `volumes:`. The example uses the all-in-one values:

   ```yaml
     dvls-update:
       image: devolutions/devolutions-server:${DVLS_IMAGE_TAG}
       profiles: ["update"]
       volumes:
         - dvlsdata:/opt/devolutions/dvls/App_Data
         - dvlsbackup:/backup
       environment:
         DVLS_UPDATE_MODE: "true"
         DVLS_BACKUP_PATH: /backup
         DATABASE_HOST: sqlserver
         DATABASE_PORT: "1433"
         DATABASE_NAME: ${DATABASE_NAME}
         DATABASE_USERNAME: sa
         DATABASE_PASSWORD: ${MSSQL_SA_PASSWORD}
         DATABASE_ENCRYPT: "true"
         DATABASE_TRUST_SERVER_CERTIFICATE: "true"
       depends_on:
         sqlserver:
           condition: service_healthy
   ```

   For the hybrid deployment, use the same `DATABASE_*` values as the `dvls` service, and replace `depends_on` with the `extra_hosts` entry of the `dvls` service.
2. Stop Devolutions Server:

   ```powershell
   docker compose stop dvls
   ```
3. Change `DVLS_IMAGE_TAG` in the `.env` file.
4. Download the new images and update the database:

   ```powershell
   docker compose --profile update pull
   docker compose --profile update run --rm dvls-update
   ```
5. Wait for `Database update completed successfully.`, then start Devolutions Server with the new version:

   ```powershell
   docker compose up -d
   ```

For the update mode variables, see [Advanced Docker configuration for Devolutions Server](https://docs.devolutions.net/server/knowledge-base/how-to-articles/devolutions-server-docker-deployment/advanced-docker-configuration-for-devolutions-server.md#version-updates).

### Remove the deployment

Stop and remove the containers while keeping the database and the Devolutions Server data:

```powershell
docker compose down
```

{% hint style="danger" %}
The following command also deletes the volumes. This cannot be undone.

* **All-in-one**: deletes the SQL Server databases and the encryption configuration.
* **Hybrid**: deletes only the encryption configuration. The database stays on your SQL Server and can no longer be decrypted.

```powershell
docker compose --profile init down -v
```

{% endhint %}

#### See also

* [Deploy Devolutions Server with Docker](https://docs.devolutions.net/server/knowledge-base/how-to-articles/devolutions-server-docker-deployment.md)
* [Advanced Docker configuration for Devolutions Server](https://docs.devolutions.net/server/knowledge-base/how-to-articles/devolutions-server-docker-deployment/advanced-docker-configuration-for-devolutions-server.md)
* [Database setup](https://docs.devolutions.net/server/getting-started/installation/database-setup.md)
* [Security checklist](https://docs.devolutions.net/server/getting-started/security-checklist.md)


---

# 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/knowledge-base/how-to-articles/devolutions-server-docker-deployment/deploy-devolutions-server-and-sql-server-with-docker-compose-on-windows.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.
