IBM Support

Windows Service with NSSM

Troubleshooting


Problem

You can configure Vault to execute as a Windows service using either the standard Windows SC tool / sc.exe or with the third party community-developed NSSM tool.

This guide will focus on providing an example of Vault service creation using NSSM in both GUI and command line modes.

All examples in this guide use the cmd.exe interpreter.

The example values used in this guide are detailed as follows.

Example Vault Configuration

This guide uses a minimalistic Vault configuration using the filesystem storage backend as configuration of this particular backend requires a file path value that needs some clarification regarding its handling.

Here is the example:

storage "file" {
  path    = "/vault/data"
}

listener "tcp" {
  address     = "0.0.0.0:8200"
  tls_disable = 1
}
  • Filesystem based storage backend
    • You must use Unix style path for the value of path; Vault will use the correct Windows path based on the provided path. For our example configuration, Vault data files will be written to C:\vault\data.
  • Listening on all available network interfaces on the default port TCP/8200
  • No TLS enabled


NOTE: This is a simple example and not intended to be used as guidance for a production configuration.

Paths and Environment Variables

The examples in this guide presume the following to be true:

  • Vault data will be stored at C:\vault\data
  • Vault configuration will be located at C:\vault\config
  • The VAULT_ADDR environment variable has been set as a user-level Windows environment variable with a value of http://localhost:8200

Please review these values carefully and set them where necessary; be sure to use your own values where appropriate.

NOTE: For certain uses, paths must be specified as Unix style paths and cannot be Windows style paths. These examples are specifically called out where necessary in the relevant sections of this guide.

NSSM

NSSM offers a simple UI for building the service definition, but can also be scripted or operated from the command line. Here is an example of configuring a Vault service using NSSM.

Begin by issuing the command from a command shell invoked as an Administrator user (using cmd.exe here):

C:\Windows\System32> nssm install vault

You’ll be greeted with a small GUI window for configuring the service:

Application

Here you’ll want to set the correct values for Path and Arguments here and then proceed to the Details tab.

Details

Here, you’ll want to set a helpful Display Name but leave the rest of the settings at their default values.

Log on

These settings should be left at their default values.

Dependencies

These settings should be left at their default values.

Process

These settings can be left at their default values or you could raise the priority to something higher or adjust CPU affinity if Vault is or is not the primary system service.

Shutdown

These settings should be left at their default values.

Exit actions

These settings should be left at their default values.

I/O

These settings should be left at their default values.

File rotation

These settings should be left at their default values.

Once you’ve finished with the settings, select Install service.

The service should then be installed successfully. You can now manage the service with either nssm commands or the standard Services settings.

Here is an example of starting Vault with nssm from a cmd.exe shell:

Add Vault Service with Command Line

Here is a basic example of adding the Vault service using nssm directly from the cmd.exe shell, without using the UI. Ensure that the cmd.exe is opened as an Administrator and execute a command like the following:

C:\Windows\System32> nssm install vault c:\\bin\vault.exe "server -config=/vault/config/server.hcl"

The -config option should match the actual path to your Vault’s configuration file, and it must be specified as a Unix style path, not a Windows style path.

See the NSSM Managing services from the command line documentation for more options.

Resources

  1. How to create a Windows service by using Sc.exe
  2. NSSM
  3. NSSM - Managing services from the command line

Document Location

Worldwide

[{"Type":"MASTER","Line of Business":{"code":"LOB77","label":"Automation Platform"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSLC9Y2","label":"IBM Vault Self-Managed"},"ARM Category":[{"code":"a8mgJ0000000E6EQAU","label":"Vault-\u003EOther"}],"ARM Case Number":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"1.14.12;1.14.13;1.15.0;1.15.1;1.15.10;1.15.11;1.15.12;1.15.13;1.15.14;1.15.15;1.15.16;1.15.2;1.15.3;1.15.4;1.15.5;1.15.6;1.15.7;1.15.8;1.15.9;1.16.0;1.16.1;1.16.10;1.16.11;1.16.12;1.16.13;1.16.14;1.16.15;1.16.16;1.16.17;1.16.18;1.16.19;1.16.2;1.16.20;1.16.21;1.16.22;1.16.23;1.16.24;1.16.25;1.16.26;1.16.27;1.16.28;1.16.29;1.16.3;1.16.30;1.16.31;1.16.4;1.16.5;1.16.6;1.16.7;1.16.8;1.16.9;1.17.0;1.17.1;1.17.10;1.17.11;1.17.12;1.17.13;1.17.14;1.17.15;1.17.16;1.17.17;1.17.18;1.17.2;1.17.3;1.17.4;1.17.5;1.17.6;1.17.7;1.17.8;1.17.9;1.18.0;1.18.1;1.18.10;1.18.11;1.18.12;1.18.13;1.18.14;1.18.15;1.18.2;1.18.3;1.18.4;1.18.5;1.18.6;1.18.7;1.18.8;1.18.9;1.19.0;1.19.1;1.19.10;1.19.11;1.19.12;1.19.13;1.19.14;1.19.15;1.19.16;1.19.17;1.19.18;1.19.19;1.19.2;1.19.3;1.19.4;1.19.5;1.19.6;1.19.7;1.19.8;1.19.9;1.20.0;1.20.1;1.20.10;1.20.11;1.20.12;1.20.13;1.20.2;1.20.3;1.20.4;1.20.5;1.20.6;1.20.7;1.20.8;1.20.9;1.21.0;1.21.1;1.21.2;1.21.3;1.21.4;1.21.5;1.21.6;1.21.7;1.21.8;2.0.0;2.0.1;2.0.2;2.0.3;4.2.0-5.4.0"}]

Historical Number

360001965207

Document Information

Modified date:
09 July 2026

UID

ibm17264736