# Installation on Linux

{% hint style="info" %}
**Setup Support 🤝**

We are happy to help you with setting up Celantur Container. Please contact your sales representative.
{% endhint %}

## Prerequisites

### Check installed prerequisites

You can check whether dependencies are already installed:

* Docker: `docker version`
* NVIDIA driver: `nvidia-smi`
* NVIDIA Docker runtime: `nvidia-container-runtime --version`

If any of the above commands returns an error, proceed with the next section or parts of it.

### Set up host machine

#### Install Docker

[Install Docker](https://docs.docker.com/engine/install/ubuntu/#install-using-the-convenience-script)

```bash
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
```

Add your user to the `docker` group. It takes effect with the next login.

```bash
sudo groupadd docker
sudo usermod -aG docker $USER
```

If you don't add your user to the `docker` group, you'll receive the following error when running the `docker` command:

{% code overflow="wrap" %}

```
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http:///var%2Frun%2Fdocker.sock/v1.40/containers/json: dial unix /var/run/docker.sock: connect: permission denied
```

{% endcode %}

#### Install NVIDIA driver

Install NVIDIA driver with `sudo apt install nvidia-driver-580` (or a different version compatible with your GPU).

#### Install Nvidia Container Runtime

Install [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html): Required to access the GPUs within the Docker containers.

```bash
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
    sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
    sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
sudo apt-get update
sudo apt-get install -y nvidia-container-toolkit

sudo systemctl restart docker
```

#### Test the setup

```bash
docker run --gpus all nvidia/cuda:12.8.1-base-ubuntu22.04 nvidia-smi
```

## Deploy Celantur Container

You'll receive a time-limited **password**  (provided by Celantur via email) to download the image from the Celantur Container Registry.

{% hint style="info" %}
If your password expired, please let us know. We're happy to send you a new one.
{% endhint %}

### Download the Container

1. Download [celantur.sh](https://celantur-web.s3.eu-central-1.amazonaws.com/scripts/celantur.sh) script.&#x20;
2. Assign the **password** to a variable: `export PASSWD=.......`
3. Optional: Set `export VERSION=...` for a specific version. Default is `latest`. You can find version numbers in the [Release Notes](https://doc.celantur.com/container/release-notes).
4. Run `bash celantur.sh --update` to download the latest release.&#x20;

### Preparation

You need a **license file** (provided by Celantur) to run Celantur Container.

The following folders  and file are necessary:

```
Celantur (root folder)
├── input/
├── licensing/
├── log/
├── output/
└── celantur.sh
```

* **`input`**: Where the original files are stored (including subfolders)&#x20;
  * See [#supported-image-formats](#supported-image-formats "mention")
  * See [#supported-video-codecs](#supported-video-codecs "mention")
* **`output`**: Folder for the anonymized images/videos. If a file exists with the same as in input folder, then processing of the file is skipped.
* **`log`**: Folder containing the logs.
* **`licensing`**: Folder containing the license key. Copy the license file `license` into this folder as `licensing/license`.

### Run the Container

1. Copy some images into the `input` directory.
2. Run `bash celantur.sh -a person -a vehicle`
3. Check the anonymized in the `output` directory.&#x20;

#### Ensure that /tmp folder within the Container is read-writeable

If you run the Container with `--read-only` flag or use readonly filesystem in Kubernetes, you need to ensure that the `/tmp` folder within the Container can be both read and written with ca. 2 GiB space.

### Anonymize your first images

Follow instructions at [#anonymize-images-and-videos](https://doc.celantur.com/getting-started#anonymize-images-and-videos "mention").

Start to integrate Celantur Container into your workflow with the various data ingestion modes:

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td></td><td><strong>Batch and Stream mode</strong></td><td></td><td><a href="../usage/batch-and-stream-mode">batch-and-stream-mode</a></td></tr><tr><td></td><td><strong>REST API mode</strong></td><td></td><td><a href="../usage/rest-api-v1-mode">rest-api-v1-mode</a></td></tr><tr><td></td><td><strong>TCP mode</strong></td><td></td><td><a href="../usage/tcp-mode">tcp-mode</a></td></tr></tbody></table>
