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.
Prerequisites
Docker version
20.10.Xor 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
SUPERUSERattribute.
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.
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
Pull the latest Devolutions Server Docker image:
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-datavolume keepsApp_Dataso that the encryption configuration can be extracted afterward. With PostgreSQL, add-e DATABASE_TYPE=PostgreSQLand-e DATABASE_ENCRYPT=true, and setDATABASE_HOSTto the PostgreSQL server name.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--rmoption removes the container and keeps thedvls-init-datavolume.Extract
encryption.configfrom the initialization volume and convert it to base64. Store theencryption.config.b64file securely: every runtime start needs it.Start Devolutions Server in runtime mode with the base64 encryption configuration. With PostgreSQL, add the same
DATABASE_TYPEandDATABASE_ENCRYPTvariables as in the initialization command. Once this is done, use thedocker psanddocker logs dvls-servercommands to make sure everything is in working order.Access the web interface by opening
https://localhost:5000in your browser. Go past the self-signed certificate security warning by clicking Advanced – Proceed. A custom TLS certificate can be mounted later.Log in by using
dvls-adminfor both the username and password. Devolutions Server then requires a new password for this account.Make sure that Devolutions Server is running with
DVLS_ENCRYPTION_CONFIG_B64, its web interface is accessible, andencryption.config.b64is saved in a secure location (it is needed for every restart and redeployment). Once this is done, remove the temporary initialization volume:
Pull the latest Devolutions Server Docker image:
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-datavolume keepsApp_Dataso that the encryption configuration can be extracted afterward. With PostgreSQL, add-e DATABASE_TYPE=PostgreSQLand-e DATABASE_ENCRYPT=true, and setDATABASE_HOSTto the PostgreSQL server name.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--rmoption removes the container and keeps thedvls-init-datavolume.Extract
encryption.configfrom the initialization volume and convert it to base64. Store theencryption.config.b64file securely: every runtime start needs it.Start Devolutions Server in runtime mode with the base64 encryption configuration. With PostgreSQL, add the same
DATABASE_TYPEandDATABASE_ENCRYPTvariables as in the initialization command. Once this is done, use thedocker psanddocker logs dvls-servercommands to make sure everything is in working order.Access the web interface by opening
https://localhost:5000in your browser. Go past the self-signed certificate security warning by clicking Advanced – Proceed. A custom TLS certificate can be mounted later.Log in by using
dvls-adminfor both the username and password. Devolutions Server then requires a new password for this account.Make sure that Devolutions Server is running with
DVLS_ENCRYPTION_CONFIG_B64, its web interface is accessible, andencryption.config.b64is saved in a secure location (it is needed for every restart and redeployment). Once this is done, remove the temporary initialization volume:
Pull the latest Devolutions Server Docker image:
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-datavolume keepsApp_Dataso that the encryption configuration can be extracted afterward. With PostgreSQL, add-e DATABASE_TYPE=PostgreSQLand-e DATABASE_ENCRYPT=true, and setDATABASE_HOSTto the PostgreSQL server name.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--rmoption removes the container and keeps thedvls-init-datavolume.Extract
encryption.configfrom the initialization volume and convert it to base64. Store theencryption.config.b64file securely: every runtime start needs it.Start Devolutions Server in runtime mode with the base64 encryption configuration. With PostgreSQL, add the same
DATABASE_TYPEandDATABASE_ENCRYPTvariables as in the initialization command. Once this is done, use thedocker psanddocker logs dvls-servercommands to make sure everything is in working order.Access the web interface by opening
https://localhost:5000in your browser. Go past the self-signed certificate security warning by clicking Advanced – Proceed. A custom TLS certificate can be mounted later.Log in by using
dvls-adminfor both the username and password. Devolutions Server then requires a new password for this account.Make sure that Devolutions Server is running with
DVLS_ENCRYPTION_CONFIG_B64, its web interface is accessible, andencryption.config.b64is 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:
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.
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:
Copy the certificate and its private key, in PEM format, to a folder of the Docker host, for example
/host/path/certs.Add these options to the runtime command, with
WEB_SCHEME=httpsandHOSTNAMEset to the name in the certificate (for example,devolutions-server.company.com):
Container management
docker start dvls-server
Starts the container.
docker stop dvls-server
Stops the container.
docker rm dvls-server
Removes the container.
See also
Last updated
Was this helpful?