> For the complete documentation index, see [llms.txt](https://docs.vega365.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vega365.com/nidhi/management-client/setting-up-a-recording-server.md).

# Setting Up a Recording Server

The setup connects a recording server to the cloud. It covers its licence, the storage and key, the folder and drive letter, the local cache and how the drive starts. It takes about 5 minutes. Then you add the cloud drive as an archive in XProtect.

Before you start:

* Nidhi is [installed](https://docs.vega365.com/nidhi/getting-started/installation.md) on the recording server.
* The site is [named](https://docs.vega365.com/nidhi/management-client/site-settings.md#name-this-site).
* You have the bucket, and a key for it (see [Cloud storage](https://docs.vega365.com/nidhi/getting-started/requirements.md#cloud-storage)), and the licence ID and password for this recording server.

## Starting the setup

On the [Dashboard](https://docs.vega365.com/nidhi/management-client/dashboard.md), open the recording server. Until it is set up, its page shows **Set up Nidhi on** *recorder* (or **Finish setting up** *recorder* once you have started) with each step and its state. Click **Start setup** (or **Continue setup** / **Finish setup**).

<figure><img src="https://1044727958-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOkTZH1L3AaRU2hwQk4Ve%2Fuploads%2Fgit-blob-381d685f4c9bb97816bd7beac2912fb29dbb2233%2Fmc-recorder-setup-card.png?alt=media" alt=""><figcaption><p>A recording server whose setup isn't finished</p></figcaption></figure>

The steps are shown across the top of the setup. To go back to an earlier step, click it.

You don't have to finish in one go. **Each step is saved when you complete it**, so you can click **Close** at any time. Next time, the setup picks up where you left off.

{% stepper %}
{% step %}

### License

Nidhi checks that the Nidhi Recorder Service answers and has a licence.

<figure><img src="https://1044727958-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOkTZH1L3AaRU2hwQk4Ve%2Fuploads%2Fgit-blob-7ecc0ce159553cce14e3add2f249642927023f67%2Fmc-setup-01-license.png?alt=media" alt=""><figcaption></figcaption></figure>

* **Activate a license for** *recorder*: click **Add a license** to start a trial or activate the annual subscription. See [License Activation](https://docs.vega365.com/nidhi/getting-started/license-activation.md).
* **Start the Nidhi Recorder Service on** *recorder*: the service doesn't answer. Start **Nidhi Recorder Service** in Windows Services (services.msc) on the recording server, then click **↻ Check again**.
* **Ready to set up Nidhi on** *recorder*: nothing to do. Click **Next**.
  {% endstep %}

{% step %}

### Where

**Where should the footage go?** Choose the provider and enter the key.

<figure><img src="https://1044727958-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOkTZH1L3AaRU2hwQk4Ve%2Fuploads%2Fgit-blob-1210f0eaf07a932ff5c96657ad47e4c89abba424%2Fmc-setup-02-where.png?alt=media" alt=""><figcaption></figcaption></figure>

| Provider                                 | Fields                                                                                                                                                                       |
| ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Amazon S3**                            | **Access key ID**, **Secret access key**, **Region** (the bucket's region). Use an IAM user's access key allowed to list, read and write the bucket.                         |
| **S3-compatible** (Wasabi, MinIO, B2...) | **Endpoint URL** (the provider's S3 endpoint, for example `https://s3.eu-central-1.wasabisys.com`), **Access key ID**, **Secret access key**, **Region (optional)**.         |
| **Google Cloud**                         | The **Access key ID** and **Secret** of an HMAC key. Create it in the Google Cloud console under **Cloud Storage > Settings > Interoperability**, for a **service account**. |

Click **Test connection**. Nidhi checks that the key opens the account and lists its buckets. If it does, you see *✓ The key opens this ... account and lists its N buckets*. What the key may do inside a bucket is tried on the next step.

If the test fails, it says why:

| The test says                       | What to do                                                                                                  |
| ----------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| The access key ID wasn't recognised | Check the access key ID, and that you chose the right provider (and endpoint).                              |
| The secret is wrong                 | Enter the secret again.                                                                                     |
| Access is denied                    | Give the key the rights to list, read and write the bucket.                                                 |
| The endpoint can't be reached       | Check the endpoint URL, and that the recording server can reach the internet on TCP 443 (through a proxy?). |
| The region doesn't match            | Choose the bucket's region (Amazon S3).                                                                     |

The exact messages are in [Status Messages](https://docs.vega365.com/nidhi/troubleshooting/status-messages.md#setup).

**Next** saves the storage and key. Once saved, the secret shows *Saved · leave blank to keep it*.
{% endstep %}

{% step %}

### Cloud folder

**Where in the cloud.** XProtect archives only to a drive, so Nidhi shows a folder in your bucket as one.

<figure><img src="https://1044727958-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOkTZH1L3AaRU2hwQk4Ve%2Fuploads%2Fgit-blob-e5bf305450f98eaa68cdaa9cad414ac75332297a%2Fmc-setup-03-cloud-folder.png?alt=media" alt=""><figcaption></figcaption></figure>

1. **Drive letter**: a free letter. **X:** is suggested.
2. **Where in the cloud**: choose the **bucket**. The folder follows from the site name: `<site folder>/<RECORDING SERVER>`.

On **Next**, Nidhi checks that the key has every right XProtect needs in that folder:

* *✓ In ... the key can ... — everything XProtect does on the drive.* Click **Next**.
* *✖ In ... the key cannot* *rename* (for example): give the key that right in the provider's console, or choose another bucket.

{% hint style="info" %}
**If the step says "The cloud drive needs its file system (WinFsp) on this recorder"**: WinFsp is the component that lets Windows show the cloud folder as a drive. It is normally installed with Nidhi, so you only see this if it is missing on the recording server.

Click **Install it now**, and Nidhi installs it on the recording server for you, without leaving this step. If that fails, the message says why. Click **Install it now** to try again, or run the Nidhi setup on the recording server itself and then reopen this step.
{% endhint %}
{% endstep %}

{% step %}

### Cache

**The local cache.** Files XProtect archives land here first and are uploaded from here. See [The local cache](https://docs.vega365.com/nidhi/how-nidhi-works.md#the-local-cache).

<figure><img src="https://1044727958-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOkTZH1L3AaRU2hwQk4Ve%2Fuploads%2Fgit-blob-98382c1d92810e13fd6e5460f6a40a84c4f3e1ab%2Fmc-setup-04-cache.png?alt=media" alt=""><figcaption></figcaption></figure>

Tell Nidhi what this recording server records, and it works out how big the cache should be:

| Field                        | What to enter                                                                                                                  |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| **Cameras on this recorder** | How many cameras record on this recording server.                                                                              |
| **Each camera records**      | The average bitrate per camera, in Mbit/s. A typical HD camera records 2–6 Mbit/s.                                             |
| **XProtect archives every**  | How often XProtect archives the storage profiles, as set in XProtect (1 hour to 1 month).                                      |
| **Cache size** (GB)          | Filled in for you, with enough for two archive runs plus 10 %, and at least 10 GB. You can type your own size instead.         |
| **Where on the recorder?**   | The **Disk** and **Folder** for the cache. Click **Browse...** to choose. The default is `C:\ProgramData\Vega\Nidhi\VfsCache`. |

The step tells you whether the disk has room for the cache with 10 GB to spare. If XProtect records to the same disk, it says *Another disk is better*. Choose a different disk if you have one.
{% endstep %}

{% step %}

### Start-up

**How the cloud drive starts.** This step makes sure the cloud drive is there before XProtect needs it. After the recording server restarts, Windows starts, Nidhi mounts the cloud drive (within 3 minutes), and only then does the Recording Server start and archive to it.

<figure><img src="https://1044727958-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOkTZH1L3AaRU2hwQk4Ve%2Fuploads%2Fgit-blob-c515d860a85e4ec194dbcf94379d949b5ebcb8ed%2Fmc-setup-05-start-up.png?alt=media" alt=""><figcaption></figcaption></figure>

All three options are ticked. Keep them unless you have a reason not to:

| Option                                                                           | What it does                                                                                                                                                                                                                 |
| -------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Show the drive as NTFS (recommended)**                                         | XProtect expects an NTFS drive for archives.                                                                                                                                                                                 |
| **Mount when Nidhi starts**                                                      | Mounts the drive whenever the Nidhi Recorder Service starts.                                                                                                                                                                 |
| **At boot, start the Recording Server after the drive is mounted (recommended)** | XProtect finds its cloud archive at start-up. It waits at most 3 minutes, then the Recording Server starts anyway. See [Restarts and power cuts](https://docs.vega365.com/nidhi/how-nidhi-works.md#restarts-and-power-cuts). |

Click **Next**. Nidhi saves the settings and mounts the drive, and the step shows *✓ Drive X: is mounted*.
{% endstep %}

{% step %}

### Archive

**Tell XProtect to use the cloud drive.** The cloud drive is now ready, but XProtect doesn't use it yet. Nidhi doesn't change XProtect's storage settings itself, so you add the drive as archive storage in XProtect. From then on, XProtect moves its recordings to the cloud on its own schedule, the same as with any other archive disk.

This step waits for you to do that in XProtect:

<figure><img src="https://1044727958-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOkTZH1L3AaRU2hwQk4Ve%2Fuploads%2Fgit-blob-332dbc88ad1a80bb11eb42398d7daa43b883a493%2Fmc-setup-06-archive.png?alt=media" alt=""><figcaption></figcaption></figure>

1. In the Management Client, open **Recording Servers >** *recorder* **> Storage**.
2. In each storage profile that should keep footage in the cloud, **add an archive** as its **last** tier:
   * **Path**: the cloud drive, in a folder named after the storage profile, for example `X:\Local Default`.
   * **Retention time**: how long the footage stays in the cloud. XProtect deletes it when this ends.
   * The **archive schedule** decides when footage moves to the cloud. Keep the interval you entered on the Cache step.
3. Save in XProtect, then come back and click **Check again**.

The step says *✓ XProtect archives to X:* (and to how many folders), or *XProtect does not archive to X: yet*. Click **Finish**.
{% endstep %}
{% endstepper %}

{% hint style="warning" %}

* **One folder per storage profile.** Two storage profiles must not archive to the same folder on the cloud drive.
* **Live retention and archive schedule.** XProtect moves footage to the archive when it is older than the live retention, on the archive schedule. Live storage holds about the live retention (at least 1 hour) plus one archive interval.
* Set the live storage's **Maximum size** with room for the time the cloud may be down. See [When the cloud is down](https://docs.vega365.com/nidhi/how-nidhi-works.md#when-the-cloud-is-down).
  {% endhint %}

## When the first footage reaches the cloud

Don't expect footage in the cloud straight away. XProtect moves a recording to the cloud only once it is older than the storage profile's live retention, at its next archive run. With a live retention of 7 days, for example, the first footage goes to the cloud about a week after the setup.

Until then, the [Recording Server Page](https://docs.vega365.com/nidhi/management-client/recording-server-page.md) says **Cloud drive ready — nothing archived yet**. That is normal. After XProtect's first archive to the cloud, it shows how much footage is safe there.

## What to set up next

Set up [Failure Alerts](https://docs.vega365.com/nidhi/management-client/failure-alerts.md), so you hear about it when a recording server's footage stops reaching the cloud. If the network is busy at certain times of day, also set an [Upload Bandwidth Schedule](https://docs.vega365.com/nidhi/management-client/recording-server-settings.md#upload-bandwidth-schedule), so uploads don't slow it down.

## Changing the storage later

| To change                                                                        | Do this                                                                                                                                                 |
| -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **The key**, keeping the same storage                                            | Use [Update Storage Key](https://docs.vega365.com/nidhi/management-client/recording-server-settings.md#update-storage-key).                             |
| **The bucket, folder, drive letter or provider**, while the setup isn't finished | Go back to that step of the setup and change it there.                                                                                                  |
| **The bucket, folder, drive letter or provider**, once the setup is finished     | Use [Reset Configuration](https://docs.vega365.com/nidhi/management-client/recording-server-settings.md#reset-configuration), then run the setup again. |

**Moving footage that is already in the cloud.** If the cloud drive already holds footage and you move it to a new location, Nidhi offers to copy that footage there first, so XProtect can still play it back.

{% hint style="warning" %}
While the footage is being copied, the cloud drive is offline, so XProtect can't archive to the cloud or play back footage from it until the copy is done. A large archive can take a long time to copy, so plan the move for a quiet time. If the recording server restarts during the copy, the copy carries on where it stopped.
{% endhint %}
