Install Devolutions Server for Linux
Devolutions Server is available for Linux with Microsoft Kestrel as the built-in web server and Microsoft PowerShell 7 for command-line installation. The present topic shows how to manually install Devolutions Server for Linux using Bash prompts and PowerShell scripts, as well as how to access and remove it.
Alternatively, Devolutions Server can be installed automatically using the scripts found on the Devolutions GitHub ScriptLibrary repository.
Installing prerequisites
If Microsoft SQL Server is not already installed, run the following Bash prompt with the
MSSQL_SA_PASSWORDvariable changed to a strong password:source /etc/os-release curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --dearmor --batch --yes -o /usr/share/keyrings/microsoft-prod.gpg curl -fsSL https://packages.microsoft.com/config/ubuntu/$VERSION_ID/mssql-server-2022.list | sudo tee /etc/apt/sources.list.d/mssql-server-2022.list sudo apt-get update sudo apt-get install -y mssql-server sudo MSSQL_SA_PASSWORD="mystrongpassword" MSSQL_PID="evaluation" /opt/mssql/bin/mssql-conf -n setup accept-eula sudo /opt/mssql/bin/mssql-conf set sqlagent.enabled true sudo systemctl restart mssql-serverMSSQL_PIDis set to evaluation in this example, but a product key can be entered here instead.
Run this Bash prompt to install PowerShell 7:
sudo apt-get update sudo apt-get install -y wget apt-transport-https software-properties-common source /etc/os-release wget -q https://packages.microsoft.com/config/ubuntu/$VERSION_ID/packages-microsoft-prod.deb sudo dpkg -i packages-microsoft-prod.deb rm packages-microsoft-prod.deb sudo apt-get update sudo apt-get install -y powershell
Ensure that the installation takes place in a directory that is accessible for the current user as the command line wget downloads a .deb package to said directory.
Choose whether to install the Devolutions.PowerShell module for the current user or all users.
For current user (location:
/.local/share/powershell/Modules), run:For all users (location:
/opt/microsoft/powershell/7/Modules), run:
A warning is likely to appear stating that the installation comes from an untrusted repository. The module is hosted on PowerShell Gallery, the official location for hosting PowerShell modules managed by Microsoft. To avoid seeing this warning in the future, run:
Although not required, provisioning separate users and groups for Devolutions Server is highly recommended. Here is a Bash prompt to create a user and a group both named dvls with the installation directory set to
/opt/devolutions/dvls:
Downloading and installing Devolutions Server for Linux
Run the PowerShell script below to download the latest version of Devolutions Server for Linux and extract the
.tar.gzfile into the/opt/devolutions/dvlslocation:It is best for Devolutions Server to be able to respond over TLS. If a certificate does not exist already, one can be quickly generated using this Bash prompt:
In the example above, the
subjectAltNameusesDNS:.To respond on an IP only, useIP:instead.
Note that the generated .pfx certificate does not have a password.
Using the Devolutions.PowerShell module, run installation for Devolutions Server via PowerShell. Make sure to customize the values listed here:
MYHOSTMSSQLHOSTDBUSERNAMEYOURSTRONGPASSWORDMYEMAIL
If a certificate has already been generated, proceed to modify the
appsettings.jsonfile to allow Kestrel to respond over TLS using this PowerShell script:To offer background running of Devolutions Server for Linux, it is recommended to create a unit file for systemd via this Bash prompt:
To start Devolutions Server, run:
Accessing Devolutions Server for Linux
By default, Devolutions Server for Linux listens on port 5000 on the IP or hostname of the installation system, which most commonly looks like: http://MYHOST:5000. Be aware that OAuth errors may occur upon first launch when trying to access Devolutions Server from a unconfigured URL. If this is the case, add additional URIs to listen on, or modify the primary one by running the following script in PowerShell:
If Devolutions Server remains inaccessible outside of the installed system, check if the requisite firewall ports are opened, by adding Uncomplicated Firewall to the prompt, for example: sudo ufw allow 5000.
Importing Devolutions Server encryption key
Export from an existing Windows installation
Import to new Linux installation
Updating Devolutions Server for Linux
Do not extract the new .tar.gz archive directly over /opt/devolutions/dvls. Doing so overwrites appsettings.json and encryption.config, which leaves the service unable to start and may make existing data undecryptable. Always follow the update method detailed on this page.
Backup the database. Here's how to do so for Microsoft SQL Server (Linux or remote):
Full path to
sqlcmdavoids "command not found" error in non-login shells where/etc/profile.d/mssql-tools.shhas not been sourced.-Ctrusts the server certificate (required for local SQL Server installs that use a self-signed certificate).Backup to a directory writable by the MSSQL user.
/var/opt/mssql/data/works out of the box.Make sure the
.bakfile exists and is not empty before proceeding to the next step.Stop the Devolutions Server service using the following script:
Back up the installation and configuration files. Keep in mind that
/opt/devolutions/dvlsis in mode 550 and is owned bydvls:dvls, therefore the backup cmdlets must run as root. Start PowerShell withsudo pwsh, then paste this script:Backup-DPSConfigurationFilespreserves:appsettings.json,web.config, andencryption.config.Backup-DPSInstallationFilespreserves custom folders, anomaly detection folder, and any user-added assets.
Empty the install directory except for
App_data, as it contains runtime state that survives upgrades. Use this script to do so:Use
--strip-componentsonly if the archive has a top-level folder.Restore configuration and custom data. In this step,
appsettings.json(DB connection string) andweb.configare put back into the new installation. Sinceencryption.configwas already preserved insideApp_Data/by step #5,Restore-DPSConfigurationFileswill not put it at the install root because that is not where it lives on Linux. Here is the restoration script:Pull the connection strings from the restored
appsettings.json:Update-DPSDatabaseprints no output on success. Verify that it worked by checking that the command returned exit code 0 and that, after starting the service in step #9, the journal shows Migration done with status Done entries with no[ERR]lines.Re-apply ownership and permissions:
Start the service and check if it works correctly:
Troubleshooting
Service won't start,
appsettings.jsonmissing or empty: restore from$BackupConfig/appsettings.json, repeat steps #8 and 9.Login works but entries fail to decrypt:
encryption.configwas not restored. Copy$BackupConfig/encryption.configinto$DVLSPath/App_Data/, fix permissions (chown dvls:dvlsandchmod 660), then restart.DB schema errors at runtime:
Update-DPSDatabasewas skipped or failed. Repeat step #7.Full rollback: stop the service (see step #3), empty
/opt/devolutions/dvlsexceptApp_Data/(step #5), copy the contents of$BackupInstallback into/opt/devolutions/dvls, restoreappsettings.jsonfrom$BackupConfig, re-apply ownership and permissions from step #8, restore the DB from the.bakproduced in step #1, then restart.
Removing Devolutions Server
To remove Devolutions Server, run the Bash prompt below and customize it for the system. This script relies on the DbaTools PowerShell module to facilitate the removal of the MSSQL database. It assumes localhost is the MSSQL installation and dvls the database name.
Last updated
Was this helpful?