Skip to content

Overview

Akram El Assas edited this page Oct 14, 2026 · 145 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, enable the 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.

Important

Desktop Interaction and Session 0 Isolation

Servy can wrap any executable as a native Windows service, including GUI apps as long as they do not require an interactive desktop session. Like all Windows service wrappers (including NSSM and WinSW), Servy processes execute within Session 0, which runs in an isolated environment without interactive desktop access.

If you attempt to run a GUI application that requires an interactive desktop as a service, it will fail to start or crash at runtime, often throwing errors such as Access Violation (0xC0000005) or Null Pointer Exception. If your application requires an active desktop session, use an alternative automation tool (such as Windows Task Scheduler configured to run only when a user is logged on) instead.

Note

Before You Begin

Servy requires administrator rights to install and manage Windows services. If you are using a modern Windows workstation or server, choose the .NET 10.0+ build. If you need support for older platforms such as Windows 7 SP1 or Windows Server 2008 R2, use the .NET Framework 4.8 build instead.

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 servy

Patch My PC

Servy is available in the official Patch My PC catalog for enterprise automated deployment and updates via Microsoft Intune and ConfigMgr (SCCM).

After a default installation servy-cli is on the system PATH - see Installation Guide for the option that controls this and for the portable package.

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. Run it from an elevated PowerShell prompt: installing, starting and stopping a Windows service all require administrator privileges.

servy-cli install `
  --name="NodeApp" `
  --path="C:\Program Files\nodejs\node.exe" `
  --startupDir="C:\apps\nodeapp" `
  --params="server.js" `
  --enableHealth

This creates a service named NodeApp that runs a Node.js server in the background, starts automatically with Windows, and has health monitoring enabled.

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

The Servy Desktop App provides an intuitive graphical interface to configure, install, and manage individual Windows services.

Service Details

Configure core service properties including name, description, executable path, arguments, working directory, and startup type. See Servy Desktop App.

servy-config-main

For more details on CPU affinity, see the FAQ.

Logging

Configure stdout and stderr log file redirection, size-based and date-based log rotation, and retention policies. See Logging & Log Rotation.

servy-config-logging

Note

Enabling the debug option will record sensitive information in the local log file at %ProgramData%\Servy\logs\services\<ServiceName>\Servy.Service.log. This behavior only occurs when local logging is enabled, which is the default setting. Sensitive data is never recorded in the Windows Event Log. The CLI show command and Show-ServyService mask the encrypted fields by default; --decrypt / -Decrypt prints the parameters and environment variables in clear text (the stored password always stays masked). See Servy CLI and Servy PowerShell Module.

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

Recovery

Configure automated liveness checks, external diagnostic heartbeat pings, and automatic restart behavior. See Health Monitoring & Recovery.

servy-config-recovery

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

Advanced

Set custom process environment variables and Windows service dependencies. See Environment Variables and Service Dependencies.

servy-config-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

Configure service execution accounts including LocalSystem, built-in service accounts, domain accounts, and gMSAs. See Security.

servy-config-logon

You can also run the service under:

  • NT AUTHORITY\NetworkService
  • NT AUTHORITY\LocalService
  • Passwordless accounts
servy-config-logon-builtin-accounts

Pre-Launch

Execute custom initialization scripts or executables before the main service process starts. See Pre-Launch & Post-Launch Actions.

servy-config-pre-launch

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

Post-Launch

Run auxiliary tasks immediately after the primary process launches successfully. See Pre-Launch & Post-Launch Actions.

servy-config-post-launch

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

Pre-Stop

Run graceful shutdown tasks or resource draining scripts prior to stopping the main service. See Pre-Stop & Post-Stop Actions.

servy-config-pre-stop

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

Post-Stop

Execute post-cleanup tasks after the primary service and all child processes have completely exited. See Pre-Stop & Post-Stop Actions.

servy-config-post-stop

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

Manager App

Servy Manager is a central administrative interface to manage, monitor, and inspect all services installed across the system.

Services

View all registered services, inspect real-time CPU/RAM metrics, and trigger lifecycle actions. See Servy Manager.

servy-manager-services

Performance

Track real-time CPU and memory utilization using live visual performance graphs. See Servy Manager.

servy-manager-performance

Console

Stream unified stdout and stderr console output in real time with live filtering and tailing controls. See Servy Manager.

servy-manager-console

Dependencies

Inspect full Windows Service Control Manager (SCM) dependency trees with status color coding. See Servy Manager.

servy-manager-dependencies

Logs

Inspect Windows Event Log entries directly within the application viewer. See Servy Manager.

servy-manager-logs

CLI / PowerShell

Servy includes a command-line interface (servy-cli) and a PowerShell module for full automation and CI/CD integration.

CLI

Execute service operations directly via command-line arguments or configuration files. See Servy CLI.

servy-cli

PowerShell

Manage services natively using PowerShell cmdlets and pipeline objects. See Servy PowerShell Module.

servy-powershell

See Also

Clone this wiki locally