# Setting up the Floating Server V2

{% hint style="warning" %}
**All core features are fully available via the API** and through the **built-in Swagger page**, accessible at:

> http\://\<your-server-url>/swagger/index.html
> {% endhint %}

## Compatibility

* **Environments supported**: The Floating Server can be built to run on Windows and on Linux
* **Client SDKs**: The client applications that connect to the floating server can use one of our SDKs. This version of the floating server will initially support C++, .NET, and Java SDKs. Support for other SDKs will be added later.
* **Database options**: the floating server can run using **SQLite** or **PostgreSQL**.
* **Provisioning options**: the Floating server can be provisioned with certificate files, or with a Yubikey.

{% hint style="info" %}
**Recommended Database**: Use PostgreSQL for production environments

For production environments and due to performance issues, we recommend using PostreSQL
{% endhint %}

## Download the Floating Server

## Steps to get the Floating Server to Run

{% stepper %}
{% step %}

### Prepare configuration file

Create a configuration file called `default.yaml`, and place it in a subfolder called `config` where the binary is located: `config/default.yaml`

Here is a template for the `default.yaml` file:

{% code title="default.yaml" %}

```yaml
database:
 # if using sqlite
  type: sqlite
  path: ./data/db.sqlite
# if using postgres
  type: postgres
  host: localhost
  port: 5432
  user: fsuser
  password: fspassword
  name: fsdb
  CryptoProviderKey: "" # secret used to encrypt db data in OAuth mode

server:
  port: 8080 # port on which the server runs
  Verbose: true # level of information given in logs
  DisableUserAuth: false # disable user authentication requirement, not admin!

cloud:
  UseOAuth: false
  # if authenticating with API/Shared key
  APIKey: ""
  SharedKey: ""
  # if authenticating with OAuth
  ClientId: ""
  ClientSecret: ""
  # cloud server config
  BaseURL: "" # default: "https://api.licensespring.com"
  APIPrefix: "" # default: "/api/v4/"
  ServerPublicKey: "" # default: LicenseSpring Prod's public key
  # if having Airgap licenses, fetch this key from platform
  AirgapPublicKey: ""
  # provisioning config
  UseHardwareKey: false # choose provisioning method
  PrivateKeyPath: "" # path to generated priv key. Ignore if using hardware key
  CertificatePath: "" # path to cert received from LS. Ignore if using hardware key
  CACertificatePath: "" # path to CA certificate, in both provision methods
```

{% endcode %}

#### Database Configuration

The database section defines how the application connects to the underlying database. Two database types are currently supported: **SQLite** and **PostgreSQL**.

{% hint style="info" %}
please comment out or delete the fields from `default.yaml` for the database you will not be using.
{% endhint %}

**SQLite**

{% hint style="warning" %}
When using SQLite, make sure the database directory specified in the YAML configuration file actually exists. For example, if you're using `./data/db.sqlite` as shown in the sample above, ensure that the `data` directory exists. The Floating Server will not create missing directories automatically. The database file can be named anything. The server will create it if it doesn't exist.
{% endhint %}

If you're using SQLite, provide the file path for the database file:

> type: sqlite\
> path: ./data/db.sqlite

**PostgreSQL**

To use PostgreSQL instead of SQLite, update the `default.yaml` with the following fields:

Fields:

* `host`: The `PostgreSQL` server address (usually `localhost` for local development)
* `port`: Port number (default is `5432`)
* `user`: The PostgreSQL username
* `password`: The password for the specified user
* `name`: The name of the database to connect to

> type: postgres\
> host: the posgres host\
> port: the postgres port\
> user: the user in db\
> password: password\
> name: give the db a name

**Setting Up PostgreSQL (Local)**

* Install PostgreSQL (if not installed)
* Create the database and user:
  * Run `psql postgres` and inside the psql prompt execute:

{% code title="SQL - Create DB and User" %}

```pgsql
CREATE DATABASE fsdb;
CREATE USER fsuser WITH PASSWORD 'fspassword';
GRANT ALL PRIVILEGES ON DATABASE fsdb TO fsuser;
```

{% endcode %}

* Verify the connection:

{% tabs %}
{% tab title="bash" %}

```bash
psql -h localhost -U fsuser -d fsdb
```

{% endtab %}

{% tab title="powershell" %}

```powershell
psql -h localhost -U fsuser -d fsdb
```

{% endtab %}
{% endtabs %}

You will be prompted for the password that you set above, "fspassword" or whatever you originally used.

This process in MacOS is shown in the following picture.

![](/files/9b0c797dfa70a1b80c35f34b52b64d25b027916f)

**CryptoProviderKey**

`CryptoProviderKey` is a secret key you may use to encrypt data before storing it in the database.

{% hint style="warning" %}
If you are using OAuth instead of our API and Shared keys to authenticate, you must define `CryptoProviderKey` to ensure your data is securely encrypted.

If you are using API/Shared keys for Authentication, then you do not need to specify `CryptoProviderKey`, and the database will use the `SharedKey` for encryption instead.
{% endhint %}

#### Server Configuration

The **server** section defines the server’s port and log verbosity. You can keep the default values unless changes are needed, but do not remove these fields, they are required.

* **Port**: The network port the server listens on.
* **Verbose**: Controls the amount of logging detail. We recommend setting this to true in development for more detailed output, and to false in production.
* **DisableUserAuth**: If set to true, the floating server will not require users to acquire management user credentials in order to register to a license. The same goes for unregistration, feature register/unregister, consumption and feature consumption. We recommend using this mode only for tests. More on this on the section related to user management.

#### Cloud Configuration

The **cloud** section depends on your authentication method:

* If using **API and Shared keys**, fill out APIKey and SharedKey.
* If using **OAuth**, set UseOAuth to true and provide ClientId and ClientSecret.
* When using OAuth:
  * Update the database section with UseOAuth: true.
  * Provide a CryptoProviderKey. This key encrypts data stored in the database.
  * If not using OAuth, the SharedKey handles encryption.

If you are using a **BaseURL** or **APIPrefix** different from the default, specify them in the cloud section. In this case, **you must also provide the server’s public key as shown in the sample config file above.** In this format:

```yaml
ServerPublicKey: |
  -----BEGIN PUBLIC KEY-----
  (your public key here)
  -----END PUBLIC KEY-----
```

{% endstep %}

{% step %}

### Provision the server

Before starting the floating server, you **must provision it**. This step ensures that only legitimate instances of the server are used and prevents unauthorized replicas from running.

#### Generate a Key Pair

First, create a private–public key pair locally. This will be used to generate a Certificate Signing Request (CSR):

```bash
openssl genrsa -out private.key 2048
```

#### Provision via LS Platform

1. Open the **LS Platform** in your browser.
2. Navigate to one of your **Enterprise Companies** → go to **Licenses** → **Floating Servers**.
3. Click the **Provision the Floating Server** button.

![](/files/3773e5cdf0e9854775b63e008fb76eb44f18a7db)

* Choose **Certificate** as the authentication type.
* Enter a name for your floating server and optionally set an expiration date for the certificate.
* Follow the on-screen instructions to generate a **CSR (Certificate Signing Request)** locally.
* Copy the contents of the generated request.csr file and paste it into the form.
* Click Confirm.

![](/files/221a91fb2eade216302c13a99444b404e26a6ce1)

#### Download and Save Certificates

* Download the issued **certificate** and save it locally (e.g., certificate.crt).
* Also download the **CA chain certificate** (e.g., chain.crt).
* Make sure your previously generated **private key** is also accessible.

#### Update Configuration

In your configuration file `default.yaml`, under the cloud section, provide the paths to your key and certificate files:

```yaml
cloud:
  UseHardwareKey: false # choose provisioning method
  PrivateKeyPath: "" # ignore if using hardware key
  CertificatePath: "" # ignore if using hardware key
  CACertificatePath: "" # path to CA certificate, in both provision methods
```

{% endstep %}

{% step %}

### Run the Floating Server

Prior to running the floating server for the first time, please ensure the configuration file is setup correctly, and that the data folder exists and is located at the path specified in the configuration file.

There are currently two options for running the server:

* Executable (recommended if you don’t want Docker)

  * Download the executable file that matches your operating system from [here](https://floating-server.s3.eu-central-1.amazonaws.com/index.html).
    * [floating-server-linux-amd-2.0.0-beta.1.zip](https://s3.eu-central-1.amazonaws.com/floating-server/floating-server-linux-amd-2.0.0-beta.1.zip)
    * [floating-server-windows-amd-2.0.0-beta.1.zip](https://s3.eu-central-1.amazonaws.com/floating-server/floating-server-windows-amd-2.0.0-beta.1.zip)
  * Run the executable directly.

  <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>A Docker Image is currently being prepared and will be made available soon.</p></div>
* Docker
  * Pull the image from Docker Hub.
  * Run the container from the pulled image.
  * The configuration file and provisioning steps are the same for both methods. The only difference is that in the Docker case, you must mount the configuration and provisioning files so that the container can access them (details below).

#### Start the Server — Executable

Run the executable that matches your OS:

> ./floating-server

#### Start the Server — Docker

1. Pull the image:

> docker pull licensespring/floating-server-v2:v2.0.0-beta.1

2. Set up PostgreSQL
   * Start a PostgreSQL instance (local or containerized).
   * Note down the `host`, `port`, `username`, `password`, and `database` name.
   * Update the configuration file with these PostgreSQL connection details.
3. Prepare configuration and certificates
   * Place your server configuration file in a local directory.
   * Place your certificates in another directory.
4. Run the container — mount both config and cert directories:

> docker run -d\
> \--name fsv2\
> \--network fsnet\
> -v /path/to/config:/app/config\
> -v /path/to/certs\:/app/certs\
> -p 8080:8080\
> licensespring/floating-server-v2:v2.0.0-beta.1

* Replace `/path/to/config` with the directory containing your config file.
* Replace `/path/to/certs` with the directory containing your certificates.
* Adjust the `-p` mapping if you want to expose the server on a different port.

#### Option: docker-compose

A `docker-compose.yml` file is shipped with the documentation. Running this file will automatically set up both a PostgreSQL container and the Floating Server container together. This is the quickest way to get everything running with a single command.
{% endstep %}
{% endstepper %}

### First-time Admin Setup

When the Floating Server starts for the first time, there are no users or admins configured. The first required step is to set a password for the initial admin account. Once set, you can log in using the username `admin` and the chosen password. After logging in as the admin, you will have the ability to add additional users.

This initial password setup can be done either through the UI or by calling the API endpoint:

> POST /api/v5/auth/initial-password

If you are using the UI and navigate to the Floating Server’s URL before setting up an admin account, you will automatically be redirected to the setup page for creating the initial admin password. This page is shown in the image below.

![](/files/0bffd714d51060eec800dc88b08e094375af4819)

{% hint style="info" %}
When running the Floating server for the first time, the initial `Username` that you are setting the password for is `admin`
{% endhint %}

Once logged in, you should see the admin panel to the floating server:

![](/files/fa9612a46a8adb2d9986de2537669844d0d1965f)


---

# Agent Instructions: 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:

```
GET https://docs.licensespring.com/floating-server/floating-server-v2/setting-up-the-floating-server-v2.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
