> For the complete documentation index, see [llms.txt](https://helpcenter.xopero.com/xopero-one-en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://helpcenter.xopero.com/xopero-one-en/deployment-and-configuration/xopero-one-agent/installation-within-a-docker-container.md).

# Installation within a Docker container

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

## Deployment  <a href="#deployment" id="deployment"></a>

1. To install the **Xopero ONE** agent within a **Docker** container, use the images available on **Docker Hub**:

```docker
docker pull xopero/gitprotect-agent:latest
```

2. Create a host directory for the **Xopero ONE Management Service** container databases (which are located at `/app/Xopero` inside the container) to store databases outside the container:

```docker
mkdir -p /opt/gitprotect-agent/data
```

3. Run the container with the correct volume mounting and environment variables using the following command:

```docker
docker run -v /host/path:/container/path -e ENV_VAR=value image_name
```

```docker
docker run -d \
  --name <container_name> \
  -e ManagementServiceUrl="<your_xopero_one_service_URL>" \
  -e XoperoOverriddenHostName="<device_name>" \
  -v /opt/gitprotect-agent/data:/app/Xopero \
  --restart unless-stopped \
  xopero/gitprotect-agent:latest
```

{% code title="Example" overflow="wrap" %}

```docker
docker run -d \
  --name xopero-agent \
  -e ManagementServiceUrl="https://192.168.1.10:28555" \
  -e XoperoOverriddenHostName="Docker_agent" \
  -v /opt/gitprotect-agent/data:/app/Xopero \
  --restart unless-stopped \
  xopero/gitprotect-agent:latest
```

{% endcode %}

4. Check if the container works correctly by using the following command:

```docker
docker ps
```

5. Once all the above steps are completed, the agent will report to the **Management Service** panel for activation.
   {% endtab %}

{% tab title="QNAP NAS (CS > 3.0)" %}

<p align="center"><a href="#prerequisites" class="button primary" data-icon="circle-1">Prerequisites</a>    <a href="#environment_setup" class="button primary" data-icon="circle-2">Environment setup</a>    <a href="#deployment-1" class="button primary" data-icon="circle-3">Deployment</a></p>

## Prerequisites <a href="#prerequisites" id="prerequisites"></a>

**QNAP** with:

* x86 or x64 CPU (<mark style="color:red;">**ARM is not supported**</mark>)
* minimum 2GB RAM
* **Container Station** app from **AppCenter**

***

## Environment setup <a href="#environment_setup" id="environment_setup"></a>

1. Download the **Container Station** app from the **App Center**.
2. Login to your **QNAP** web panel and open the **AppCenter** application. In **QNAP Store**, select **All Apps** and search for the **Container Station**.

<figure><img src="/files/W3kNQ3ctCwKrfR0Z7fLC" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/JVIBEOjXkCqeVy52gGto" alt=""><figcaption></figcaption></figure>

3. Download and open the application. Select the path that will be used as a directory for your **Docker** container data, and click **Start Now** to proceed.

***

## Deployment <a href="#deployment" id="deployment"></a>

1. Open the **Container Station** application, select the **Containers** tab, and click the **Create** button.

<figure><img src="/files/qHXLAjMkdVcMw6CiYaT4" alt=""><figcaption></figcaption></figure>

2. In **Image Configuration** choose the **Advanced mode** option. In the image type, select **Docker image**, and in the **Image** field, paste the following command:

```docker
xopero/gitprotect-agent:latest
```

3. Ensure the **Try pulling image from the registry before creating the container** option is checked, and hit **Next**.

<figure><img src="/files/j2YTfEo81n2nVGKfDVCl" alt=""><figcaption></figcaption></figure>

4. Within the **Configure Container** tab, the form contains several fields, with the most crucial being:

> **Name** — here you can set a custom name for the container
>
> **Restart policy** — defines if the container will star automatically in case of, for example, **QNAP** restart

<figure><img src="/files/F1GDH7FSToLVMvXR6BkE" alt=""><figcaption></figcaption></figure>

5. In the **Configure Container** tab, navigate to ⚙️**Advanced Settings**.
6. Go to the **Environments** section and click **Add New Variable** to add new environment variables with the following values:

{% code title="ASPNETCORE\_URLS" overflow="wrap" %}

```docker
http://+:80
```

{% endcode %}

{% code title="DOTNET\_RUNNING\_IN\_CONTAINER" overflow="wrap" %}

```docker
true
```

{% endcode %}

{% code title="ManagementServiceUrl" overflow="wrap" %}

```docker
Xopero ONE Management Service address
```

{% endcode %}

{% hint style="warning" %}
Replace `Xopero ONE Management Service address` with your **Xopero ONE Management Service** addres&#x73;**\***.
{% endhint %}

**‼️\*ManagementServiceUrl** – your **Xopero ONE Management Service** (**XMS**) address in one of the following formats (depending on the **XMS** deployment model):

1. `http://ipaddress:port`, i.e., `http://192.168.0.1:28555`&#x20;
2. `https://XMSID.ads.xopero.com`, i.e., `https://a00b0dc0-0116-0000-0000-d0000028960e.ads.xopero.com`

{% code title="XoperoOverriddenHostName" %}

```docker
your custom QNAP container name
```

{% endcode %}

<figure><img src="/files/ldXRC4Cr0W4sYzArjXr9" alt="" width="563"><figcaption><p><em>Example of correctly filled environments variables.</em></p></figcaption></figure>

7. Click **Apply** to save your changes.
8. Navigate to **Storage** tab—here you can mount your **QNAP** volumes to the **Xopero ONE** agent docker container.

{% hint style="success" %}
You can mount multiple directories to the container using **Add Volume** button and repeating the operation.
{% endhint %}

{% hint style="info" %}
To back up data from your **QNAP** device, choose **Bind Mount Host Path** under **Add Volume** drop-down menu — it lets you specify which data the **Xopero ONE** container can access. Select a directory from the host and enter the path visible inside the container in the **Container** field.
{% endhint %}

<figure><img src="/files/i3yDCXWvXwcZ3gnJQPPE" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="/files/FWccAObYA05x2abtIub9" alt="" width="563"><figcaption></figcaption></figure>

9. Next, double-check and confirm your settings, then click **Finish** to create the container.

<figure><img src="/files/7A3dQhj1n1NDNIph4wpL" alt="" width="563"><figcaption></figcaption></figure>

10. **Container Station** will download the latest **Xopero ONE** image and create the container based on that image.

<figure><img src="/files/7GliNluSCExeUcJxogyO" alt=""><figcaption></figcaption></figure>

11. Once the container creation process is completed, your new container will be visible under **Container** tab in **Container Station**.

<figure><img src="/files/IgKvJIJrAVxi3VNPFgv1" alt=""><figcaption></figcaption></figure>

12. You can now connect to your **Xopero ONE Management Service** admin panel to activate the agent.
    {% endtab %}

{% tab title="QNAP NAS (CS < 3.0)" %}

<p align="center"><a href="#prerequisites-sec" class="button primary" data-icon="circle-1">Prerequisites</a>    <a href="#environment_setup-sec" class="button primary" data-icon="circle-2">Environment setup</a>    <a href="#deployment-sec" class="button primary" data-icon="circle-3">Deployment</a></p>

## Prerequisites <a href="#prerequisites-sec" id="prerequisites-sec"></a>

**QNAP** with:

* x86 or x64 CPU (<mark style="color:red;">**ARM is not supported**</mark>)
* minimum 2GB RAM
* **Container Station** app from **AppCenter**

***

## Environment setup <a href="#environment_setup-sec" id="environment_setup-sec"></a>

1. Download the **Container Station** app from the **AppCenter**.
2. Login to your **QNAP** web panel and open the **AppCenter** application. In **QNAP Store**, select **All Apps** and search for the **Container Station**.

<figure><img src="/files/W3kNQ3ctCwKrfR0Z7fLC" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/JVIBEOjXkCqeVy52gGto" alt=""><figcaption></figcaption></figure>

3. Download and open the application. Select the path that will be used as a directory for your **Docker** container data, and click **Start Now** to proceed.
4. Once done, download the **Xopero ONE** agent **Docker** image, which is available [on our official server](https://xopero.com/download/xopero_one/latest/client-image.tar).

***

## Deployment <a href="#deployment-sec" id="deployment-sec"></a>

1. Open the **Container Station** application and navigate the **Import** tab.&#x20;
2. Click the ➕**Import** button to upload the previously downloaded **Docker** image file.

<figure><img src="/files/mznJ39ByFpph570yG2Vu" alt="Importing the docker file"><figcaption></figcaption></figure>

3. In **Create Import Task** window, select the source type and file path of the **Xopero ONE** agent **Docker** image and hit **Next** to continue.&#x20;

{% hint style="info" %}
Selecting a file from a local source enables you to choose files stored on your device. Alternatively, you can use the **NAS** option to access files directly from **QNAP**.
{% endhint %}

<figure><img src="/files/spS07xWrd4CD29v9Rvxn" alt="Creating import task" width="375"><figcaption></figcaption></figure>

4. Within the **Create Container** tab, the form contains several fields, with the most crucial being:

> **Name** — here you can set a custom name for the container
>
> **Auto start** — defines if the container will star automatically in case of, for example, **QNAP** restart
>
> **CPU Limit** — allows you to specify the percentage of CPU usage allocated for the container
>
> **Memory Limit** — RAM limit for the container

<figure><img src="/files/di4j0xuoUDxQOCxaglI0" alt="Creating container"><figcaption></figcaption></figure>

5. Click the ⚙️**Advanced Settings >>** button and navigate to the **Environment** section.

<figure><img src="/files/htwkifEIFwMwPXa0LIM7" alt=""><figcaption></figcaption></figure>

6. To add a new environment variable, click the **Add** button, name it **ManagementServiceUrl**, and set its value to your **Xopero ONE Management Service** addres&#x73;**\***.

**‼️\*ManagementServiceUrl** – your **Xopero ONE Management Service** (**XMS**) address in one of the following formats (depending on the **XMS** deployment model):

> a. `http://ipaddress:port`, i.e., `http://192.168.0.1:28555`&#x20;
>
> b. `https://XMSID.ads.xopero.com`, i.e., `https://a00b0dc0-0116-0000-0000-d0000028960e.ads.xopero.com`

<figure><img src="/files/W4IXwP8y980NRCMGOQn2" alt="create container"><figcaption></figcaption></figure>

7. Go to the **Shared Folders** section — here you can mount your **QNAP** volumes to the **Xopero ONE** agent **Docker** container.

{% hint style="success" %}
You can mount multiple directories to the container using **Add** button in **Volume from host** section and repeating the operation.
{% endhint %}

<figure><img src="/files/3DOQccJG89G4J8w8M3wq" alt="Setting shared folders"><figcaption></figcaption></figure>

8. To back up data from your **QNAP** device, choose **Add** under **Volume from host** section— it lets you specify which data the **Xopero ONE** container can access. Select a directory from the host in **Volume from host** field and enter the path visible inside the container in the **Mount Point** field.

{% hint style="info" %}
For instance, if you need to back up a directory named **Backup** inside a public shared folder, set the **Volume from the host** field to `/Public/Backup`. The **Mount Point** can be different, i.e., `/Backup`.
{% endhint %}

9. Once you're done with the above steps, click **Create** to continue.
10. In the **Summary** window double-check your settings, then click **OK** to finish the configuration.

<figure><img src="/files/kPssaRN5eYeeaBJeNFum" alt="Summary window"><figcaption></figcaption></figure>

10. You can now connect to your **Xopero ONE Management Service** admin panel to activate the agent.
    {% endtab %}

{% tab title="Synology NAS" %}

## Deployment

{% hint style="warning" %}
To deploy the **Xopero ONE** agent on a **Synology** device using **Docker**, use the **Container Manager** application. If it's not installed, download it from the **Package Center**.
{% endhint %}

1. Navigate to the **Container** tab and click the **Create** button. Expand the **Image** section and click **Add image**, then search for `xopero/gitprotect-agent` image.

<figure><img src="/files/2Fh6QIY5NpTiKh1izwih" alt="" width="563"><figcaption></figcaption></figure>

2. Select the image, click **Download**, and choose the version tagged as <mark style="color:red;">**latest**</mark>. Click **Select** to confirm.&#x20;
3. Once the image is downloaded, select it from the **Image** field drop-down menu.&#x20;
4. Next, define a custom name for the container. Additionally, configure container resource limits if needed.
5. Check the **Enable auto-restart** option to ensure the container automatically restarts when the device reboots, then click **Next** to proceed.

<figure><img src="/files/mg0COFXfUn6B2DWgDDP5" alt="" width="563"><figcaption></figcaption></figure>

6. In the **Volume Settings** section, click the ➕**Add Folder** button, and select directories that require protection. The container needs to have external directories mounted to access them while performing backups.

{% hint style="info" %}
To protect data stored in the **Public** directory, select this folder and specify <mark style="color:red;">**the same path**</mark> to ensure consistency between the host and the container's file systems.
{% endhint %}

{% hint style="success" %}
You can mount multiple directories to the container by clicking ➕ **Add Folder** and repeating the operation.
{% endhint %}

7. Additionally, to ensure data persistence during container updates or maintenance operations, mount agent databases to an external directory. These databases are located in `/app/Xopero` and should be mapped to a designated location outside the container to avoid data loss or inconsistency.

<figure><img src="/files/zmfdAkUU15YyVXj4NFwK" alt=""><figcaption></figcaption></figure>

8. Next, in the **Environment** section, define the required variables:

> **ManagementServiceUrl** — your **Xopero ONE Management Service** (**XMS**) address in one of the following formats (depending on the **XMS** deployment model):
>
> a. `http://ipaddress:port`, i.e., `http://192.168.0.1:28555`&#x20;
>
> b. `https://XMSID.ads.xopero.com`, i.e., `https://a00b0dc0-0116-0000-0000-d0000028960e.ads.xopero.com`
>
> **XoperoOverriddenHostName** — specify agent's name to facilitate identification

<figure><img src="/files/gSr8OuVqKMNjvZwG7wgU" alt=""><figcaption></figcaption></figure>

9. Click **Next** to confirm the configuration. In **Summary** window, double-check your settings and if they're all correct, hit **Done** to finalize the process.

<figure><img src="/files/IGBOafRIiBRmA5nUxWrF" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}
