🚀 Welcome to MDriven Learn –  Don’t miss the latest Release Notes.
MDriven on Synology
This page was created by Wikiadmin on 2026-07-29. Last edited by Restore-user on 2026-10-21.

How to run MDriven on a Synology box

This guide will help you get up and running with MDriven Server and MDriven Turnkey environment on a Synology DSM. Since the Synology has the ability to run MariaDB with an easy installation from the built-in package center, we will assume this is the best solution. There is also an option to run the database in Docker - then we can choose, e.g., PostgreSQL.

Preparations

Download the latest MDriven Core Server and Turnkey binaries for Linux from mdriven.net and ASP.NET Core Runtime x64 for Linux.

Create a new share on the Synology box, e.g., [\\synology\webapp ] where we will run the MDriven application from.

If Maria DB is not installed, add it from Package center, or add your flavor of database as a Docker image.

Install ASP.NET Core Runtime

Connect to your Synology through SSH. This assumes you have enabled SSH on your Synology box.

You will now install asp.net by extracting the tar.gz file and adding a path to an environment variable.

mkdir -p /usr/local/bin/dotnet && tar zxf aspnetcore-runtime-8.0.3-linux-x64.tar.gz -C /usr/local/bin/dotnet
export DOTNET_ROOT=/usr/local/bin/dotnet
export PATH=$PATH:/usr/local/bin/dotnet

Initiate a database

For mySQL: Create the database MyApp and the user myAppUser in mySQL

mysql -p -u root

CREATE DATABASE myApp;
CREATE USER myAppUser@localhost IDENTIFIED BY 'myPassword'; GRANT ALL PRIVILEGES ON myApp.* TO myAppUser@localhost;

Setup MDriven

Extract Mdriven Turnkey Core for Linux into \\synology\webapp\myApp\MDTurnkey

Extract Mdriven Server Core for Linux into \\synology\webapp\myApp\MDServer

Create a script file run.sh* that will be used to start the MDriven environment.

Save it together with your application on \\synology\webapp\myApp\

dotnet /volume1/webapp/myApp/MDServer/AppCompleteGenericCore.dll -port=5010 -nohttps
dotnet /volume1/webapp/myApp/MDTurnkey/StreaminAppCoreWebApp.dll -port=5011 -nohttps

If you're using Notepad++, be sure to end the line in unix (LF), Edit -> EOL Conversion->Unix Configuration.

Create a Triggered Task that will run at boot time in your Synology box by navigating to Control Panel -> Task Scheduler

Run your script as follows: /bin/bash /volume1/webapp/myApp/run.sh

Configure MDriven Server

Now you are ready to browse to your MDriven Server at https://synology:5010 and set up your MySQL database with a connection string.

Server=localhost;Port=3306;Database=myApp;Uid=myAppUser;Pwd=myPassword;

As always, we have to configure MdrivenServerOverride.xml and TurnkeySettingsOverride.xml to make sure we have a smooth process of upgrading the servers.

MySQL/MariaDB: Unfortunately, there may be a bug between some versions of the MySQL connector and MySQL server which may result in an error when uploading your model.

* Extended run.sh that will restart the application if it is currently running:

#!/bin/bash /volume1/webapp/myApp/run.sh
clear
BLUE='\033[0;34m'
printf "${BLUE}STARTING MDRIVEN ENVIRONMENT\n\n"
APPNAME=myApp
TURNKEYPORT=5011
SERVERPORT=5010

# Kill process to restart webapplications
netstat -lpn | grep ":$TURNKEYPORT" | awk '{sub(/\/.*/, "", $NF); print $NF}' | xargs -i kill -kill {}
netstat -lpn | grep ":$SERVERPORT" | awk '{sub(/\/.*/, "", $NF); print $NF}' | xargs -i kill -kill {}

# Start MDriven Environment
sleep 1s
cd /volume1/webapp/myApp/MDServer
/usr/local/bin/dotnet/dotnet /volume1/webapp/myApp/MDServer/AppCompleteGenericCore.dll -port=$SERVERPORT -nohttps &
sleep 15s
cd /volume1/webapp/myApp/MDTurnkey
/usr/local/bin/dotnet/dotnet /volume1/webapp/myApp/MDTurnkey/StreaminAppCoreWebApp.dll -port=$TURNKEYPORT -nohttps &
printf "${BLUE}RUNNING IN BACKGROUND\n\n"