Skip to content

Examples & Recipes

Akram El Assas edited this page Nov 15, 2025 · 117 revisions

Services can be installed and configured easily through the Servy GUI, but this page focuses on real-world examples using the Servy CLI for automation, scripting, and CI/CD scenarios.

Once installed, the CLI executable is available at:

C:\Program Files\Servy\servy-cli.exe

Note: If the value of --params in install command includes arguments that start with --, use an equals sign (=) to prevent parsing issues. Example: --params="--mode=production --port=7008" Without the equals sign, the CLI might interpret --mode or --port as its own options instead of part of the service parameters.

Run a Node.js / Express App as a Service

servy-cli install `
  --name="MyNodeApp" `
  --description="Node.js Express API" `
  --path="C:\Program Files\nodejs\node.exe" `
  --params="C:\apps\myapp\server.js" `
  --startupDir="C:\apps\myapp" `
  --startupType="Automatic"

Run a Python Script as a Service

servy-cli install `
  --name="MyPythonJob" `
  --description="Python background job" `
  --path="C:\Python311\python.exe" `
  --params="C:\apps\scripts\job.py" `
  --startupDir="C:\apps\scripts" `
  --startupType="Automatic"

Run a Go App as a Service

servy-cli install `
  --name="MyGoService" `
  --description="Go background service" `
  --path="C:\apps\my-go-app\my-go-app.exe" `
  --params="--port=8080 --mode=worker" `
  --startupDir="C:\apps\my-go-app" `
  --startupType="Automatic"

Run a Java JAR as a Service

servy-cli install `
  --name="MyJavaService" `
  --description="Java Spring Boot App" `
  --path="C:\Program Files\Java\jdk-21\bin\java.exe" `
  --params="-jar C:\apps\springboot\app.jar" `
  --startupDir="C:\apps\springboot" `
  --startupType="Automatic"

Run a Rust or C++ App as a Service

servy-cli install `
  --name="MyRustService" `
  --description="Rust background service" `
  --path="C:\apps\rustsvc\rust_svc.exe" `
  --startupDir="C:\apps\rustsvc" `
  --startupType="Automatic"

Run a PHP App as a Service

servy-cli install `
  --name="MyPHPWorker" `
  --description="PHP queue worker" `
  --path="C:\php\php.exe" `
  --params="C:\apps\worker\queue-worker.php" `
  --startupDir="C:\apps\worker" `
  --startupType="Automatic"

Run a .NET App as a Service

servy-cli install `
  --name="MyDotNetApp" `
  --description=".NET Worker Service" `
  --path="C:\apps\dotnetapp\MyApp.exe" `
  --startupDir="C:\apps\dotnetapp" `
  --startupType="Automatic"

Or, if using dotnet runtime with a DLL:

servy-cli install `
  --name="MyDotNetApp" `
  --description=".NET Worker Service" `
  --path="C:\Program Files\dotnet\dotnet.exe" `
  --params="C:\apps\dotnetapp\app.dll" `
  --startupDir="C:\apps\dotnetapp" `
  --startupType="Automatic"

Run a PowerShell script as a Service

servy-cli install `
  --name="PowerShellScript" `
  --description="PowerShell Script" `
  --path="C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" `
  --params='-File \"C:\scripts\script\my script.ps1\"' `
  --startupDir="C:\scripts\script" `
  --startupType="Automatic" 

Run a Batch File as a Service

servy-cli install `
  --name="MyBatchScript" `
  --description="Batch automation job" `
  --path="C:\Windows\System32\cmd.exe" `
  --params="/c C:\scripts\backup-job.bat" `
  --startupDir="C:\scripts" `
  --startupType="Automatic"

Tip: You can view and manage all installed services visually using Servy Manager, or automate deployments via Servy CLI.

Clone this wiki locally