Skip to content

Overview

Akram El Assas edited this page Jun 13, 2026 · 98 revisions

Table of Contents

  1. Get Started
  2. Quick Example
  3. Desktop App
    1. Service Details
    2. Logging
    3. Recovery
    4. Advanced
    5. Log On
    6. Pre-Launch
    7. Post-Launch
    8. Pre-Stop
    9. Post-Stop
  4. Manager App
    1. Services
    2. Performance
    3. Console
    4. Dependencies
    5. Logs
  5. CLI / PowerShell
    1. CLI
    2. PowerShell
  6. See Also

Important

Console UI Compatibility If your app tries to visually update the command prompt (like clearing the screen or moving the cursor), it will crash when running as a background service since services don't have visible windows. To fix this without changing your code, simply turn on Enable Console UI option in the service configuration while installing your service.

Get Started

Servy lets you run any application as a native Windows service with full control over startup, environment, logging, and lifecycle management.

You can manage services using the desktop app (GUI), the CLI (servy-cli), or PowerShell.

To get started, download the latest release from GitHub or install via a package manager:

WinGet

winget install servy

Chocolatey

choco install -y servy

Scoop

scoop bucket add extras
scoop install innounp
scoop update innounp
scoop install servy

Quick Example

You can manage services using the desktop app (GUI), the CLI, or PowerShell.

Here's a minimal example using the CLI to run a Node.js app as a Windows service:

servy-cli install `
--name="MyService" `
--path="C:\Program Files\nodejs\node.exe" `
--startupDir="C:\MyServer" `
--params="C:\MyServer\server.js"    

This creates a service named MyService that runs your Node.js server in the background and starts automatically with Windows.

Then start the service:

servy-cli start --name="MyService"    

Or from an elevated Command Prompt:

sc.exe start MyService

Explore more examples and recipes for Python, Java, Go, and other popular frameworks.

Desktop App

Service Details

This tab lets you configure the main service properties such as name, description, executable path, arguments, startup directory, and startup type.

main

Logging

This tab lets you configure stdout and stderr logging, including size-based log rotation, date-based log rotation, the maximum number of rotated log files to retain, and additional options such as enabling debug logs.

logging

Note

Enabling the debug option will record sensitive information in the local log file at %ProgramData%\Servy\logs\Servy.Service.log. This behavior only occurs when local logging is enabled, which is the default setting. To maintain security, sensitive data is never recorded in the Windows Event Log or displayed within the CLI and PowerShell module.

For detailed information about logging, check out the Logging & Log Rotation documentation.

Recovery

Here you can set up recovery actions (restart service, restart process, restart computer, or run a failure program) to automatically handle process crashes and failed health checks.

servy-config-recovery-8 4

For detailed information about health monitoring and recovery, check out the Health Monitoring & Recovery documentation.

Advanced

The advanced tab provides additional configuration options such as environment variables and service dependencies.

advanced

For detailed information about environment variables, check out the Environment Variables documentation.

For detailed information about service dependencies, check out the Service Dependencies documentation.

Log On

This tab allows you to configure the service account, including support for local accounts, domain accounts, and gMSA accounts.

Servy securely encrypts stored passwords using AES. For more details, see the Security page.

logon

You can also run the service under:

  • NT AUTHORITY\NetworkService
  • NT AUTHORITY\LocalService
  • Passwordless accounts
logon

Important

Permissions: If the service runs under an account other than LocalSystem, NetworkService, or LocalService, you must grant Write access to %ProgramData%\Servy for that account. See the Security page for more information.

Scoop Users: If you installed via Scoop, permissions are not set automatically. You must manually grant NetworkService or LocalService access to the %ProgramData%\Servy folder.

Pre-Launch

Configure an optional pre-launch program that runs before the main service process starts. This can be used to prepare the environment, set up dependencies, or run initialization scripts. By default, pre-launch hook runs synchronously with a timeout. If it fails, the service won't start unless Ignore Failure is enabled.

Set the timeout to 0 to run the pre-launch hook in fire-and-forget mode. When set to 0, the hook is started and the service is launched immediately without waiting for completion. Use this only for tasks that do not affect the service's ability to start or run correctly. Stdout/Stderr redirection and retries are not available in fire-and-forget mode.

Orphaned fire-and-forget pre-launch hooks are cleaned up when the service stops.

servy-config-pre-launch

For detailed information about pre-launch hook, check out Pre-Launch & Post-Launch Actions documentation.

Post-Launch

Configure an optional post-launch program that runs after the process starts successfully.

post-launch

Orphaned post-launch hooks are cleaned up when the service stops.

For detailed information about post-launch hook, check out Pre-Launch & Post-Launch Actions documentation.

Pre-Stop

Configure an optional script or executable to run before the main service stops. This can be used for graceful shutdown tasks such as notifying external systems or draining resources. The pre-stop process runs synchronously and extends the service stop timeout while it is running. Set the timeout to 0 to run the pre-stop process in fire-and-forget mode.

servy-config-pre-stop

For detailed information about pre-stop hook, check out Pre-Stop & Post-Stop Actions documentation.

Post-Stop

Configure an optional script or executable to run after the wrapped process and all of its child processes have exited. The post-stop process is started in fire-and-forget mode and does not block service shutdown.

servy-config-post-stop

For detailed information about post-stop hook, check out Pre-Stop & Post-Stop Actions documentation.

Manager App

Servy Manager is a utility for Servy that provides a centralized interface to manage all services installed or imported into Servy.

Services

The Manager provides a central place to view all installed services, their status, CPU & RAM usage in real time, and quick actions (start, stop, restart, install, uninstall, remove, edit, copy PID).

servy-gui-services

Performance

Monitor CPU & RAM usage in real time from the Performance tab with live graphs.

servy-manager-performance-5 3

Console

Monitor service stdout and stderr output in real time from a single, unified console.

The Console view automatically loads recent log history, continues tailing live output, and keeps both streams ordered by timestamp for accurate troubleshooting.

You can filter logs instantly, pause updates while selecting or copying text, and resume live streaming without losing context.

servy-manager-console

Dependencies

The Dependencies tab provides a visual representation of a service dependency tree retrieved from the Service Control Manager (SCM). Each dependency is displayed with its current status, where running services are shown in green, stopped services in red, and cycles in orange. The tree can be refreshed at any time using the Refresh button or by pressing F5.

This view is especially useful for understanding startup and shutdown order, diagnosing why a service fails to start, and quickly identifying stopped or missing dependencies that may impact service availability.

servy-manager-dependencies

Logs

Servy writes logs to the Windows Event Log, and its built-in log viewer lets you inspect them in real time directly from the GUI.

servy-manager-logs

CLI / PowerShell

Servy also comes with a PowerShell module and CLI commands, enabling full automation and integration into CI/CD pipelines.

CLI

After installation, the Servy directory is automatically added to the system PATH environment variable. This allows you to run servy-cli.exe directly from any elevated Command Prompt or PowerShell session.

CLI commands

servy-cli

PowerShell

PowerShell module

servy-powershell

See Also

Clone this wiki locally