# Docker

This instruction will guide you how to install a Relay in Docker for different Linux distributions. The instructions are applicable to both **amd64** and **arm64** architectures, including devices such as the Raspberry Pi.

### The latest Docker image can be found here:

<https://github.com/anyone-protocol/ator-protocol/pkgs/container/ator-protocol>

{% hint style="info" %}
From Anon version 0.4.9.7-live it is required to [accept terms and conditions](/relay/maintenance/updates.md#preseed-debconf-database) to run the client.
{% endhint %}

## Step by step installation

Type all the `commands` in a terminal window. Each code block can be pasted in full.

### 1.   Add Docker repository

{% tabs %}
{% tab title="Debian / Ubuntu" %}

```bash
sudo apt-get install ca-certificates curl gnupg -y 
sudo install -m 0755 -d /etc/apt/keyrings
. /etc/os-release
sudo curl -fsSL https://download.docker.com/linux/$ID/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
sudo echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/$ID \
  $(. /etc/os-release && sudo echo "$VERSION_CODENAME") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
```

{% endtab %}

{% tab title="Fedora" %}

```bash
sudo dnf -y install dnf-plugins-core
sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo -y
```

{% endtab %}
{% endtabs %}

### 2.   Install the Docker packages

{% tabs %}
{% tab title="Debian / Ubuntu" %}

```bash
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
```

{% endtab %}

{% tab title="Fedora" %}

```bash
sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
sudo systemctl enable --now docker
```

{% endtab %}
{% endtabs %}

### 3.   Prepare directories and fetch files

<pre class="language-bash"><code class="lang-bash">sudo mkdir /opt/compose-files/
sudo mkdir -p /opt/anon/etc/anon/
sudo mkdir -p /opt/anon/run/anon/
sudo mkdir -p /root/.nyx/
sudo chmod -R 700 /opt/anon/run/anon/
sudo chown -R 100:101 /opt/anon/run/anon/
sudo touch /opt/anon/etc/anon/notices.log
sudo chown 100:101 /opt/anon/etc/anon/notices.log
sudo useradd -M anond
sudo wget -O /opt/compose-files/relay.yaml https://raw.githubusercontent.com/anyone-protocol/anon-install/refs/heads/main/docker/anon-relay/relay.yaml
<strong>sudo wget -O /opt/anon/etc/anon/anonrc https://raw.githubusercontent.com/anyone-protocol/anon-install/refs/heads/main/docker/anon-relay/anonrc
</strong>sudo wget -O /root/.nyx/config https://raw.githubusercontent.com/anyone-protocol/anon-install/refs/heads/main/docker/anon-relay/config
</code></pre>

### 4.   Create and start the Docker container

```bash
sudo docker compose -f /opt/compose-files/relay.yaml up -d
```

#### Done!

***

## Commands for updating, testing and monitoring:

#### Edit relay configuration

```bash
sudo nano /opt/anon/etc/anon/anonrc
```

#### Update relay to run latest version

```bash
sudo docker container rm --force anon-relay
sudo docker pull ghcr.io/anyone-protocol/ator-protocol:latest-manual
sudo docker compose -f /opt/compose-files/relay.yaml up -d
```

#### Install Nyx monitor

{% tabs %}
{% tab title="Debian / Ubuntu" %}

```sh
sudo apt-get install nyx
```

{% endtab %}

{% tab title="Fedora" %}

```bash
sudo dnf install nyx
```

{% endtab %}
{% endtabs %}

#### Monitor relay with Nyx

```bash
sudo nyx -s /opt/anon/run/anon/control
```

#### Check status for containers

```bash
sudo docker ps
```

#### Start, stop and restart the relay container

```bash
sudo docker start anon-relay
sudo docker restart anon-relay
sudo docker stop anon-relay
```

#### Check systemctl logs for anon service

```bash
sudo docker logs anon-relay
```

#### Monitor anon log

```bash
sudo tail -f /opt/anon/etc/anon/notices.log
```

#### Remove the relay container

```bash
sudo docker rm anon-relay --force
```


---

# 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.anyone.io/relay/start/install-anon-on-linux/docker.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.
