# Installation within a Docker container

{% tabs %}
{% tab title="Docker Desktop (manual)" %}

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

1. Download the **GitProtect Management Service** [**Docker** image](https://xopero.com/download/xopero_one/latest/management-image.tar) to your device. Open **cmd** console and pull **Management Service** **Docker** image using the following command:

```docker
docker load -i <docker_name>.tar
```

{% hint style="danger" %}
Replace `<docker_name>.tar` with the name of your **Management Service Docker** image file.
{% endhint %}

2. Once the **Docker** image is imported, use the following command to create a container:

```docker
docker run -d \
  --name <container_name> \
  -p <xms_port>:80 \
  -v <database_location_outside_container>:/app/Xopero \
  xopero/xopero-one-service
```

{% hint style="warning" %}
In the above command, replace **drive\_location\_database** with the location to mount the database on (from the container to the local directory) — <mark style="color:red;">**this is important for upgrading the container later**</mark>. In place of **container\_name**, enter the name of your container and in place of **service\_port**, enter the service port which will be used by **GitProtect** (by default, **Management Service** port is set to 28555).
{% endhint %}

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

```docker
docker run -d \
  --name xone \
  -p 28555:80 \
  -v C:\database_docker\xone:/app/Xopero \
  xopero/xopero-one-service
```

{% endcode %}

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-d599b13a4f3931300468b50347d6e09be6e5abcf%2Fimage%20(601).png?alt=media" alt=""><figcaption></figcaption></figure>

3. Next, use the following command to view the list of containers (or view the list in **Docker Desktop**):

```docker
docker ps -a
```

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-ae5cd2bd15f5abdd78c4fe7b98f80caa5664ec3f%2Fimage%20(723).png?alt=media" alt="viewing the container list"><figcaption></figcaption></figure>

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-48618cf95dc1285a4bffccbeb8d9e86c1293311b%2Fimage%20(538).png?alt=media" alt="Docker GUI"><figcaption></figcaption></figure>

4. If you see no errors, that means the **Management Service** implementation was done correctly. You can open the **GitProtect Management Service** web panel using the following address:

```http
http://<DockerHostAddress>:28555
```

5. Before you start using **Management Service** you must create an administrator account and assign a license to your unit.
   {% endtab %}

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

<p align="center"><a href="#pre-qnap" class="button primary" data-icon="circle-1">Prerequisites</a> <a href="#env-qnap" class="button primary" data-icon="circle-2">Environment setup</a> <a href="#dep-qnap" class="button primary" data-icon="circle-3">Deployment</a></p>

### Prerequisites <a href="#pre-qnap" id="pre-qnap"></a>

**QNAP** with:

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

***

### Environment setup <a href="#env-qnap" id="env-qnap"></a>

1. Login to your **QNAP** web panel and open the **App Center** application. Go to **QNAP Store** > **All Apps** and search for **Container Station**.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-fd71316d720f8b606cf3715acc7599d388b990a4%2Fimage%20(725).png?alt=media" alt="Selecting Container Station"><figcaption></figcaption></figure>

2. Download the **Container Station** application. Once downloaded, open the app and select the path you'll be using as your **Docker** container data directory.
3. Click **Start Now** to proceed.

***

### Deployment <a href="#dep-qnap" id="dep-qnap"></a>

1. In the **Container Station** application, open the **Containers** menu option, and click the **Create** button.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-d0040a60c19c9d1bcbe9f75e21ba9e16d6d45623%2Fimage%20(811).png?alt=media" alt=""><figcaption></figcaption></figure>

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

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

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

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2FEoOPCE4lZ5WvmE05HU2p%2Fimage.png?alt=media&#x26;token=50f0bab2-3cfd-4697-886a-106f80369672" alt="" width="563"><figcaption></figcaption></figure>

4. In the **Configure Container** tab, configure the **GitProtect Docker** container and hit **Next** to continue.

> **Name** — set a custom name for the container
>
> **Auto start** — defines if the container should startup automatically (i.e., in case of **QNAP** restart)
>
> **Publish network ports** — enter a port number in the **Host** field— this will be the port used to connect to **GitProtect** service on the container on port 80 (the recommended host port number is 28555)

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-0451c228cf9dc3dc664a24d40a23a63bee3720ec%2Fimage%20(813).png?alt=media" alt=""><figcaption></figcaption></figure>

5. Double-check your configuration settings and hit **Finish**.
6. **Container Station** will download the latest **GitProtect** image and create the container based on it.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-3b3de7b2507b05ce4a75a6e4705e14cab57859bb%2Fimage%20(815).png?alt=media" alt="" width="375"><figcaption></figcaption></figure>

7. Once the container creation process is completed, your new container will be available in the **Container Station** application (under **Containers** menu option).

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-d0f042510efd333fb700788321a457f2ab56bda5%2Fimage%20(421).png?alt=media" alt=""><figcaption></figcaption></figure>

8. Connect to **GitProtect** using your web URL address in the following format (you can find it under **Container Details** > **General** > **Web URL**):

> `http://<QNAPaddress>:<port>`

9. To finish the **XMS** setup, create a new administrative account, provide the license code, and select data to protect.
   {% endtab %}

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

<p align="center"><a href="#pre-qnap2" class="button primary" data-icon="circle-1">Prerequisites</a> <a href="#env-qnap2" class="button primary" data-icon="circle-2">Environment setup</a> <a href="#dep-qnap2" class="button primary" data-icon="circle-3">Deployment</a></p>

### Prerequisites <a href="#pre-qnap2" id="pre-qnap2"></a>

**QNAP** with:

* [x] x86 or x64 CPU (ARM is <mark style="color:red;">**not supported**</mark>)
* [x] minimum 2GB of RAM
* [x] **Container Station** app from the **App Center**

***

### Environment setup <a href="#env-qnap2" id="env-qnap2"></a>

1. Login to your **QNAP** web panel and open the **App Center** application. Go to **QNAP Store** > **All Apps** and search for **Container Station**.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-fd71316d720f8b606cf3715acc7599d388b990a4%2Fimage%20(725).png?alt=media" alt="Selecting Container Station"><figcaption></figcaption></figure>

2. Download the **Container Station** application. Once downloaded, open the app and select the path you'll be using as your **Docker** container data directory.
3. Click **Start Now** to proceed.

***

### Deployment <a href="#dep-qnap2" id="dep-qnap2"></a>

1. Open the **Container Station** application and click ➕ **Create** in the left-hand side menu.
2. Copy and paste `xopero/gitprotect-service` in the search field and hit **Enter** to search for the **Management Service Docker** image (it should be the first search result in **Docker Hub** tab).
3. Click the **Install** button next to the **Docker** image to start the container creation process.
4. Select the latest image version and click **Next** to continue.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-6ae407c154a6543f502db48e329afc2b2ad7ef40%2Fimage%20(558).png?alt=media" alt="Selecting GitProtect version"><figcaption></figcaption></figure>

5. In the **Create Container** window, configure the **GitProtect Docker** container.

> **Name** — set a custom name for the container
>
> **Auto start** — defines if the container should startup automatically (i.e., in case of **QNAP** restart)
>
> **CPU Limit** — allows you to set the CPU percentage usage available for the container
>
> **Memory Limit** — RAM memory allocated to the container

6. Scroll down a little and click the ⚙️ **Advanced Settings>>**
7. In the ⚙️ **Advanced Settings>>** go to **Network** and click the **Add** button on the right. Enter a port number in the **Host** field under the **Port Forwarding** section— this will be the port used to connect to **GitProtect** service (the recommended, default port number is **28555**).

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-6b16f4d2dda725da10d046ce388b90d45b0d8309%2Fimage%20(565).png?alt=media" alt="Creating contener - network tab"><figcaption></figcaption></figure>

8. Click the **Create** button— this will display the setup summary. Double-check your configuration and click **OK** to create the container.
9. Once the container creation process is completed, your new container will be available in the **Container Station** application (under **Container** menu option).

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-8c46989a7fb4d4bf908baf00090a7b7ef7b08de4%2Fimage%20(537).png?alt=media" alt="View on running container with GitProtect"><figcaption></figcaption></figure>

10. Connect to **GitProtect Management Service** by launching it via **Container Station**, or using your web URL address in the following format:

> `http://<QNAPaddress>:<port>`

11. To finish the **Management Service** setup, create a new administrative account, provide the license code, and select data to protect.
    {% endtab %}

{% tab title="Synology NAS (Docker Hub)" %}

<p align="center"><a href="#pre-syno" class="button primary" data-icon="circle-1">Prerequisites</a> <a href="#dep-syno" class="button primary" data-icon="circle-2">Deployment</a></p>

### Prerequisites <a href="#pre-syno" id="pre-syno"></a>

**Synology** must meet the following requirements:

* [x] x86 or x64 CPU (ARM is <mark style="color:red;">**not supported**</mark>)
* [x] minimum 2 GB of RAM
* [x] **Docker** app from the **Package Center**

***

### Deployment <a href="#dep-syno" id="dep-syno"></a>

1. Open the **Docker Hub**, navigate to the **Container** menu, and click **Create** button.
2. Expand the **Image** section and select **Add image**. Then, search for `xopero/gitprotect-service`. Once located, select the image, click **Download**, and choose the version tagged as <mark style="color:red;">**latest**</mark>. Confirm the selection to proceed.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2FjRhdYiGhOsLRLPfSEzaf%2Fimage.png?alt=media&#x26;token=cff147c7-e5e8-4231-89dc-f8bdcdc6329d" alt="" width="482"><figcaption></figcaption></figure>

3. Once you download the image, select it from the **Image** drop-down menu in **General Settings**. Next, define a name for the container and enter it in the **Container Name** field. Configure container resource limits if necessary.
4. Check the **Enable auto-restart** checkbox to ensure the container automatically restarts when the device reboots, and proceed to the next step.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fs5HlaBy1VglHZ1biYP5N%2Fimage.png?alt=media&#x26;token=12fe4ece-63d9-44ff-8d2f-02f56035284b" alt="" width="549"><figcaption></figcaption></figure>

5. In **Volume Settings**, click ➕ **Add Folder** button. To ensure data persistence during container updates or maintenance operations, mount the management databases to an external directory. The databases are stored in **/app/Xopero** and should be mapped to a designated location outside the container to prevent data loss or inconsistencies.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-ea4d00ff3ab450f4ec04cbdbae1b8d0955639db8%2Fimage%20(417).png?alt=media" alt=""><figcaption></figcaption></figure>

6. In the **Environment** section, define the required variables:

> **ASPNETCORE\_URLS** — **Management Service** ports for http and https protocol (i.e., **http\://+:**<mark style="color:red;">**PORT\_NUMBER**</mark>**;https\://+:**<mark style="color:red;">**PORT\_NUMBER**</mark>)

{% hint style="warning" %}
The management console is available on port **28555** for the encrypted protocol (**https**), and on port **28556** for the unencrypted (**http**) protocol.
{% endhint %}

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-391cb786c040f70f6df678237ae00f0727262b81%2Fimage%20(418).png?alt=media" alt=""><figcaption></figcaption></figure>

7. Select **host** from the **Network** drop-down menu to enable the container to share the same network namespace as the container's host.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-5660c79fff758db4763869e8ace45d8e1777e75a%2Fimage%20(419).png?alt=media" alt=""><figcaption></figcaption></figure>

8. Confirm the configuration and click **Next**. In **Summary**, double-check the settings and hit **Done** to finish the container creation process.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-8e1a10e1e5ae74a8df9282a8b7a82046626510ab%2Fimage%20(420).png?alt=media" alt="" width="551"><figcaption></figcaption></figure>

9. Once you've created the container, you can connect to your **XMS** using one of the following addresses:

> https\://<mark style="color:red;">**yourSynologyAddress**</mark>:28555 (i.e., https\://<mark style="color:red;">**192.168.0.100**</mark>:28555)
>
> http\://<mark style="color:red;">**yourSynologyAddress**</mark>:28556 (i.e., http\://<mark style="color:red;">**192.168.0.100**</mark>:28556)
> {% endtab %}
> {% endtabs %}
