> For the complete documentation index, see [llms.txt](https://docs.licensespring.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.licensespring.com/floating-server/floating-server-v2/running-and-administration/windows-service-setup.md).

# Windows Service Setup

This guide covers how to set up Floating Server V2 to run as a Windows service using SQLite as its database backend.

## Prerequisites

* Floating Server V2 executable
* A valid `default.yaml` configuration file
* Administrator access on the Windows machine

{% stepper %}
{% step %}

## Place the Floating Server in a Directory

Create the following directory structure:

```
C:\LS\
├── floating-server.exe
└── config\
    └── default.yaml
```

{% endstep %}

{% step %}

## Update the Configuration

In `default.yaml`, configure the database section as follows:

```yaml
database:
  type: sqlite
  path: ./data/db.sqlite  # configure path as needed
```

{% endstep %}

{% step %}

## Confirm the Server Runs Manually First

Before setting up the Windows service, confirm the server starts correctly. Open PowerShell and run:

```powershell
cd C:\LS
.\floating-server.exe
```

{% hint style="warning" %}
If the server fails to start manually, resolve the issue before proceeding with the Windows service setup.
{% endhint %}
{% endstep %}

{% step %}

## Download and Prepare WinSW

Download WinSW-x64.exe and move it to `C:\LS`. Rename it to `fs2-service.exe`.

{% hint style="info" %}
The WinSW executable and the XML configuration file must share the same base name:

* `fs2-service.exe`
* `fs2-service.xml`
  {% endhint %}
  {% endstep %}

{% step %}

## Create the Service Configuration File

Create the file `C:\LS\fs2-service.xml` with the following content:

```xml
<service>
  <id>LicenseSpringFloatingServerV2</id>
  <name>LicenseSpring Floating Server V2</name>
  <description>Runs the LicenseSpring Floating Server V2.</description>
  <executable>C:\LS\floating-server.exe</executable>
  <workingdirectory>C:\LS</workingdirectory>
  <startmode>Automatic</startmode>
  <delayedAutoStart>true</delayedAutoStart>
  <logpath>C:\LS\logs</logpath>
  <log mode="roll"></log>
  <onfailure action="restart" delay="10 sec"/>
  <onfailure action="restart" delay="30 sec"/>
  <onfailure action="restart" delay="60 sec"/>
</service>
```

{% endstep %}

{% step %}

## Install and Start the Service

Open an **Administrator PowerShell** and run:

```powershell
cd C:\LS
.\fs2-service.exe install
.\fs2-service.exe start
.\fs2-service.exe status
```

The Floating Server V2 is now running as a Windows service and will start automatically on system boot.
{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.licensespring.com/floating-server/floating-server-v2/running-and-administration/windows-service-setup.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
