For the complete documentation index, see llms.txt. This page is also available as Markdown.

Deploy Devolutions Server with Docker

This article shows how to deploy Devolutions Server using Docker with a SQL Server or PostgreSQL database. The Devolutions Server Docker image is a Linux image available for the linux/amd64 and linux/arm64 platforms.

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.

Prerequisites

  • Docker version 20.10.X or later.

  • A database instance:

    • A SQL Server instance, including Azure SQL Database, properly set up for Devolutions Server.

    • Or a PostgreSQL 14 or later instance, self-hosted or managed, with a role that has the SUPERUSER attribute.

  • The minimum system requirements to run Devolutions Server.

Prepare the database

The container connects to the database with a single account, used for the initialization, the schema upgrades and normal operation. Create a dedicated account for Devolutions Server instead of using an administrator account such as sa or postgres.

SQL Server

Using an administrator account (for example, sa or an Azure SQL administrator), create a dedicated login and the Devolutions Server database, then add the login to the db_owner role of that database.

If the database does not exist, the initialization creates it with the Latin1_General_CS_AS collation, which requires the login to have the permission to create databases.

PostgreSQL

Using an administrator account, create a dedicated login role for Devolutions Server. Initialization connects to the postgres maintenance database to check whether the Devolutions Server database exists, so the role needs the CONNECT privilege on postgres (PostgreSQL grants it to all roles by default).

After the initialization, the schema upgrades and the normal operation of Devolutions Server do not require the SUPERUSER attribute. To limit the privileges of the role, remove the attribute. The role remains the owner of the database:

Database connection variables

The examples in this article connect to SQL Server. To connect to PostgreSQL, add -e DATABASE_TYPE=PostgreSQL and -e DATABASE_ENCRYPT=true to the initialization and runtime commands, and set DATABASE_HOST to the name of the PostgreSQL server. The other variables are the same for both database engines.

Variable
SQL Server
PostgreSQL

DATABASE_TYPE

SqlServer (default).

PostgreSQL.

DATABASE_HOST

Server name. A port can be added in the host,port format.

Server name. A port can be added in the host:port format, which takes precedence over DATABASE_PORT.

DATABASE_PORT

1433 (default).

5432 (default).

DATABASE_ENCRYPT

true encrypts the connection. Default: false.

true encrypts the connection and validates the server certificate. Default: false (not encrypted).

DATABASE_TRUST_SERVER_CERTIFICATE

true trusts the server certificate without validating it. Default: false.

With DATABASE_ENCRYPT=true, true keeps the encryption without validating the server certificate. Default: false.

The complete list of variables is in Advanced Docker configuration for Devolutions Server.

Devolutions Server first time setup

  1. Run Devolutions Server in initialization mode to create the database if it does not exist, create its schema and its first administrator, generate the encryption keys, and configure HTTPS with a self-signed certificate. The dvls-init-data volume keeps App_Data so that the encryption configuration can be extracted afterward. With PostgreSQL, add -e DATABASE_TYPE=PostgreSQL and -e DATABASE_ENCRYPT=true, and set DATABASE_HOST to the PostgreSQL server name.

  2. Wait for the Initialization completed successfully. message, then press Ctrl+C to stop the container. After the initialization, the container keeps running Devolutions Server until it is stopped. The --rm option removes the container and keeps the dvls-init-data volume.

  3. Extract encryption.config from the initialization volume and convert it to base64. Store the encryption.config.b64 file securely: every runtime start needs it.

  4. Start Devolutions Server in runtime mode with the base64 encryption configuration. With PostgreSQL, add the same DATABASE_TYPE and DATABASE_ENCRYPT variables as in the initialization command. Once this is done, use the docker ps and docker logs dvls-server commands to make sure everything is in working order.

  5. Access the web interface by opening https://localhost:5000 in your browser. Go past the self-signed certificate security warning by clicking Advanced – Proceed. A custom TLS certificate can be mounted later.

  6. Log in by using dvls-admin for both the username and password. Devolutions Server then requires a new password for this account.

  7. Make sure that Devolutions Server is running with DVLS_ENCRYPTION_CONFIG_B64, its web interface is accessible, and encryption.config.b64 is saved in a secure location (it is needed for every restart and redeployment). Once this is done, remove the temporary initialization volume:

  1. Run Devolutions Server in initialization mode to create the database if it does not exist, create its schema and its first administrator, generate the encryption keys, and configure HTTPS with a self-signed certificate. The dvls-init-data volume keeps App_Data so that the encryption configuration can be extracted afterward. With PostgreSQL, add -e DATABASE_TYPE=PostgreSQL and -e DATABASE_ENCRYPT=true, and set DATABASE_HOST to the PostgreSQL server name.

  2. Wait for the Initialization completed successfully. message, then press Ctrl+C to stop the container. After the initialization, the container keeps running Devolutions Server until it is stopped. The --rm option removes the container and keeps the dvls-init-data volume.

  3. Extract encryption.config from the initialization volume and convert it to base64. Store the encryption.config.b64 file securely: every runtime start needs it.

  4. Start Devolutions Server in runtime mode with the base64 encryption configuration. With PostgreSQL, add the same DATABASE_TYPE and DATABASE_ENCRYPT variables as in the initialization command. Once this is done, use the docker ps and docker logs dvls-server commands to make sure everything is in working order.

  5. Access the web interface by opening https://localhost:5000 in your browser. Go past the self-signed certificate security warning by clicking Advanced – Proceed. A custom TLS certificate can be mounted later.

  6. Log in by using dvls-admin for both the username and password. Devolutions Server then requires a new password for this account.

  7. Make sure that Devolutions Server is running with DVLS_ENCRYPTION_CONFIG_B64, its web interface is accessible, and encryption.config.b64 is saved in a secure location (it is needed for every restart and redeployment). Once this is done, remove the temporary initialization volume:

  1. Run Devolutions Server in initialization mode to create the database if it does not exist, create its schema and its first administrator, generate the encryption keys, and configure HTTPS with a self-signed certificate. The dvls-init-data volume keeps App_Data so that the encryption configuration can be extracted afterward. With PostgreSQL, add -e DATABASE_TYPE=PostgreSQL and -e DATABASE_ENCRYPT=true, and set DATABASE_HOST to the PostgreSQL server name.

  2. Wait for the Initialization completed successfully. message, then press Ctrl+C to stop the container. After the initialization, the container keeps running Devolutions Server until it is stopped. The --rm option removes the container and keeps the dvls-init-data volume.

  3. Extract encryption.config from the initialization volume and convert it to base64. Store the encryption.config.b64 file securely: every runtime start needs it.

  4. Start Devolutions Server in runtime mode with the base64 encryption configuration. With PostgreSQL, add the same DATABASE_TYPE and DATABASE_ENCRYPT variables as in the initialization command. Once this is done, use the docker ps and docker logs dvls-server commands to make sure everything is in working order.

  5. Access the web interface by opening https://localhost:5000 in your browser. Go past the self-signed certificate security warning by clicking Advanced – Proceed. A custom TLS certificate can be mounted later.

  6. Log in by using dvls-admin for both the username and password. Devolutions Server then requires a new password for this account.

  7. Make sure that Devolutions Server is running with DVLS_ENCRYPTION_CONFIG_B64, its web interface is accessible, and encryption.config.b64 is saved in a secure location (it is needed for every restart and redeployment). Once this is done, remove the temporary initialization volume:

Operating modes

The Devolutions Server container operates in three distinct modes:

Mode
Environment Variable
Purpose
Behavior

Runtime (default)

No special variables

Normal operation

Applies pending database schema upgrades, then starts the web server and keeps running.

Initialization

DVLS_INIT=true

First-time setup

Creates the database if it does not exist, its schema, the encryption keys and the administrator account, then starts the web server and keeps running.

Update

DVLS_UPDATE_MODE=true

Database upgrade

Backs up the configuration files and the installation folder, migrates the database, then exits.

Initialization and Update modes are mutually exclusive.

To start the runtime mode without applying the pending schema upgrades, set DVLS_DATABASE_UPGRADE_ON_STARTUP=false.

Custom port

Devolutions Server listens on port 5000 by default. To change it, set the PORT environment variable and publish the same port in the docker run command. For example, to use the 8080 port, replace -e PORT=5000 and -p 5000:5000 with -e PORT=8080 and -p 8080:8080, then open https://localhost:8080.

PORT takes precedence over WEB_PORT. The ASPNETCORE_URLS variable has no effect: the container sets the listening address from WEB_SCHEME and PORT.

Mount a custom TLS certificate

Mount your own certificate files instead of using the auto-generated self-signed certificate:

  1. Copy the certificate and its private key, in PEM format, to a folder of the Docker host, for example /host/path/certs.

  2. Add these options to the runtime command, with WEB_SCHEME=https and HOSTNAME set to the name in the certificate (for example, devolutions-server.company.com):

If neither file is found at these paths, Devolutions Server generates a self-signed certificate instead. If only one of the two files is found, the container stops with an error.

Container management

Commands
Functions

docker start dvls-server

Starts the container.

docker stop dvls-server

Stops the container.

docker rm dvls-server

Removes the container.

Removing the container is safe as long as you have the encryption.config.b64 file, access to your database, and your environment variables documented.

See also

Last updated

Was this helpful?