Deploy Devolutions Server and SQL Server with Docker Compose on Windows
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. For the full list of environment variables, see Advanced Docker configuration for Devolutions Server.
Prerequisites
Docker Desktop 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 versionto 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 to run Devolutions Server.
For the hybrid option only: an existing SQL Server instance prepared as described in Prepare an existing SQL Server.
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:
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
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:In that folder, create a file named
.envwith the following content, and replace every value between angle brackets:MSSQL_SA_PASSWORDmust 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_PIDselects the SQL Server edition.Expressis free but limited to 10 GB per database.Developeris free but cannot be used in production.StandardandEnterpriserequire a SQL Server license.SQL_HOST_PORTis the port used to reach the SQL Server container from the host, for example with SQL Server Management Studio. Port1434avoids a conflict with a SQL Server already installed on the host.
In the same folder, create a file named
docker-compose.ymlwith the following content:
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.
Start the deployment
Open PowerShell and go to the deployment folder:
Confirm that Docker Compose reads the
.envfile correctly. Both image names must include a tag:Download the images, including the initialization image:
Initialize the database and create the administrator account. This step is only needed for the first deployment:
If the command does not return after
Initialization completed successfully.is displayed, press Ctrl+C. The initialization container is removed automatically.
Start Devolutions Server and SQL Server:
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:
Open
http://localhost:5000in a browser (or the port set inDVLS_HOST_PORT), then log in with theDVLS_ADMIN_USERNAMEandDVLS_ADMIN_PASSWORDvalues from the.envfile.Back up the encryption configuration. It is required to restore or redeploy Devolutions Server with the same database:
Move
encryption.configto a secure location outside the deployment folder.
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:
The TCP/IP protocol enabled. SQL Server Express ships with TCP/IP disabled.
A static TCP port configured (for example,
1433). A container cannot use a named instance such asHOST\SQLEXPRESS; it must connect to a host and port.SQL Server and Windows Authentication mode (mixed mode) enabled.
A dedicated SQL login for Devolutions Server. Do not use
sa. Either create the database first and make the login itsdb_owner(recommended), or give the login thedbcreatorserver role and let the initialization create the database.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:
The SQL_DATABASE value in the .env file must match this database name.
Create the hybrid configuration files
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:In that folder, create a
.envfile with the following content, and replace every value between angle brackets:host.docker.internallets 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.In the same folder, create a
docker-compose.ymlfile with the following content:
Start the hybrid deployment
Run the same commands as for the all-in-one deployment, from the deployment folder:
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.
Install Docker Desktop on the target server (see Prerequisites).
Create a folder and copy the
docker-compose.ymland.envfiles into it. Change the passwords in.envif needed.Run
Get-ChildItemin the folder and make sure the files are named exactly.envanddocker-compose.yml. Notepad can add a hidden.txtextension.Run the commands from Start the deployment.
To reach Devolutions Server from other computers, set
DVLS_HOSTNAMEto the server's fully qualified domain name and allow theDVLS_HOST_PORTport in Windows Firewall.
Verify the deployment
Run the following commands from the deployment folder. The container names match the examples above.
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
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).
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 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.
Add the following
dvls-updateservice underservices:indocker-compose.yml, and adddvlsbackup:undervolumes:. The example uses the all-in-one values:For the hybrid deployment, use the same
DATABASE_*values as thedvlsservice, and replacedepends_onwith theextra_hostsentry of thedvlsservice.Stop Devolutions Server:
Change
DVLS_IMAGE_TAGin the.envfile.Download the new images and update the database:
Wait for
Database update completed successfully., then start Devolutions Server with the new version:
For the update mode variables, see Advanced Docker configuration for Devolutions Server.
Remove the deployment
Stop and remove the containers while keeping the database and the Devolutions Server data:
See also
Last updated
Was this helpful?