You can run MDriven Server and MDriven Turnkey on a Synology DSM device when you want to host an MDriven application from a Synology shared folder.
Overview
This installation uses:
- MDriven Server to store and serve your MDriven model and application configuration.
- MDriven Turnkey to run the generated web application.
- A database. This guide uses MariaDB installed from Synology Package Center; you can instead run another database engine in Docker.
- The x64 ASP.NET Core Runtime for Linux, which the Linux MDriven binaries require.
The example in this guide uses the application name myApp and the shared-folder path \\synology\webapp\myApp. Replace myApp, database credentials, and volume paths with values for your installation.
Before you begin
Prepare the Synology host
- In Synology DSM, enable SSH so that you can connect to the device and install the ASP.NET Core Runtime.
- Create a shared folder for the application. This guide uses
webapp. - Create an application folder beneath the share. For example, create
\\synology\webapp\myApp. - Download the current Linux binaries for MDriven Server and MDriven Turnkey from MDriven.
- Download the x64 ASP.NET Core Runtime for Linux.
Choose and prepare the database
Install MariaDB from DSM Package Center if you intend to use MariaDB. Alternatively, run the database of your choice as a Docker image.
For a MySQL or MariaDB installation, create a database and a database user before configuring MDriven Server. For example:
| Setting | Example value |
|---|---|
| Database | myApp
|
| Database user | myAppUser
|
| Database password | myPassword
|
Keep the credentials available. You enter them in MDriven Server after the services are running.
Install the ASP.NET Core Runtime
- Connect to the Synology device through SSH. SSH must be enabled in DSM first.
- Extract the downloaded ASP.NET Core Runtime
.tar.gzfile. - Add the runtime location to the environment used when MDriven Server and MDriven Turnkey start.
- Confirm that the startup task described below runs with this environment available.
The exact extraction location and environment-variable configuration depend on the DSM version and the runtime package that you downloaded. Ensure that both MDriven processes use the same configured runtime environment.
Install the MDriven binaries
Extract each Linux package into its own folder below your application folder:
| Component | Example destination |
|---|---|
| MDriven Turnkey | \\synology\webapp\myApp\MDTurnkey
|
| MDriven Server | \\synology\webapp\myApp\MDServer
|
Do not extract one package over the other. Keeping the components in separate folders makes upgrades and diagnostics clearer.
Create the startup script
Create a file named run.sh in the application folder:
\\synology\webapp\myApp\run.sh
The script must start both the MDriven Server installation in MDServer and the MDriven Turnkey installation in MDTurnkey. It must also make the ASP.NET Core Runtime environment available to both processes.
If you create run.sh in Notepad++, save it with Unix line endings: Edit → EOL Conversion → Unix (LF). A script saved with Windows line endings may not run correctly on Synology.
If you extend the script to restart an existing application instance, make sure it does not leave an old MDriven Server or Turnkey process running before starting a replacement. Test the script from an SSH session before scheduling it at boot.
Start the application at boot
Create a boot-time task in DSM:
- Open Control Panel → Task Scheduler.
- Create a Triggered Task.
- Configure the task to run at boot time.
- Set the command to:
/bin/bash /volume1/webapp/myApp/run.sh
The /volume1/ path is an example. Use the actual mounted volume path for the shared folder on your Synology device.
Run the task manually once, then verify that both MDriven Server and MDriven Turnkey have started before relying on the boot trigger.
Configure MDriven Server
After MDriven Server starts, open its administration interface:
Replace synology with the host name or address of your device. Configure the database connection in MDriven Server. For the MariaDB/MySQL example above, use:
Server=localhost;Port=3306;Database=myApp;Uid=myAppUser;Pwd=myPassword;This connection string assumes that MariaDB runs on the Synology host and listens on port 3306. If the database runs in Docker or on another machine, use its reachable host and port instead.
Configure MdrivenServerOverride.xml and TurnkeySettingsOverride.xml as part of the installation so that you can preserve your environment-specific settings when upgrading MDriven Server and Turnkey. For ongoing configuration, administration, backups, and recovery guidance, see HowTos:Configure and Maintain MDriven Server.
Verify access
Verify the two services independently:
| Service | Default address pattern |
|---|---|
| MDriven Server | https://<host>:5010
|
| MDriven Turnkey | http://<host>:5011
|
Ensure that your Synology firewall and network configuration allow access to the required ports. The MDriven Server and Turnkey endpoints serve different purposes: use MDriven Server to administer the server and configure the application, and use Turnkey to open the application.
Troubleshooting
The boot task does not start the services
- Verify that the task calls the correct
run.shpath for the Synology volume. - Verify that
run.shuses Unix (LF) line endings. - Run the same
/bin/bashcommand through SSH to isolate Task Scheduler issues from script issues. - Check that the ASP.NET Core Runtime environment is available to the scheduled task, not only to your interactive SSH session.
MDriven Server or Turnkey is not reachable
- Confirm that the corresponding process started successfully.
- Confirm the host name, protocol, and port. MDriven Server uses port
5010; Turnkey uses port5011in the local-installation guidance. - Check DSM firewall and network rules for both ports.
Model upload fails with MySQL or MariaDB
Some combinations of MySQL connector and MySQL server versions may cause an error when uploading a model. Check the connector and database-server versions in use when this occurs, then review the server configuration and error information in HowTos:Configure and Maintain MDriven Server.
