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

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

  1. If Microsoft SQL Server is not already installed, run the following Bash prompt with the MSSQL_SA_PASSWORD variable 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-server

    MSSQL_PID is set to evaluation in this example, but a product key can be entered here instead.

  1. 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.

  1. 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

  1. Run the PowerShell script below to download the latest version of Devolutions Server for Linux and extract the .tar.gz file into the /opt/devolutions/dvls location:

    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 subjectAltName uses DNS:. To respond on an IP only, use IP: instead.

Note that the generated .pfx certificate does not have a password.

  1. Using the Devolutions.PowerShell module, run installation for Devolutions Server via PowerShell. Make sure to customize the values listed here:

    • MYHOST

    • MSSQLHOST

    • DBUSERNAME

    • YOURSTRONGPASSWORD

    • MYEMAIL

    If a certificate has already been generated, proceed to modify the appsettings.json file 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:

  2. 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.

  1. Backup the database. Here's how to do so for Microsoft SQL Server (Linux or remote):

    Full path to sqlcmd avoids "command not found" error in non-login shells where /etc/profile.d/mssql-tools.sh has not been sourced.

    -C trusts 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.

  2. Make sure the .bak file exists and is not empty before proceeding to the next step.

  3. Stop the Devolutions Server service using the following script:

  4. Back up the installation and configuration files. Keep in mind that /opt/devolutions/dvls is in mode 550 and is owned by dvls:dvls, therefore the backup cmdlets must run as root. Start PowerShell with sudo pwsh, then paste this script:

    • Backup-DPSConfigurationFiles preserves: appsettings.json, web.config, and encryption.config.

    • Backup-DPSInstallationFiles preserves custom folders, anomaly detection folder, and any user-added assets.

  5. Empty the install directory except for App_data, as it contains runtime state that survives upgrades. Use this script to do so:

    Use --strip-components only if the archive has a top-level folder.

  6. Restore configuration and custom data. In this step, appsettings.json (DB connection string) and web.config are put back into the new installation. Since encryption.config was already preserved inside App_Data/ by step #5, Restore-DPSConfigurationFiles will not put it at the install root because that is not where it lives on Linux. Here is the restoration script:

  7. Pull the connection strings from the restored appsettings.json:

    Update-DPSDatabase prints 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.

  8. Re-apply ownership and permissions:

  9. Start the service and check if it works correctly:

Troubleshooting

  • Service won't start, appsettings.json missing or empty: restore from $BackupConfig/appsettings.json, repeat steps #8 and 9.

  • Login works but entries fail to decrypt: encryption.config was not restored. Copy $BackupConfig/encryption.config into $DVLSPath/App_Data/, fix permissions (chown dvls:dvls and chmod 660), then restart.

  • DB schema errors at runtime: Update-DPSDatabase was skipped or failed. Repeat step #7.

  • Full rollback: stop the service (see step #3), empty /opt/devolutions/dvls except App_Data/ (step #5), copy the contents of $BackupInstall back into /opt/devolutions/dvls, restore appsettings.json from $BackupConfig, re-apply ownership and permissions from step #8, restore the DB from the .bak produced 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?