Install Anon in Docker Docker Setup and Deployment
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.
Type all the commands
in a terminal window. Each code block can be pasted in full.
1. Add Docker repository
Debian / Ubuntu Fedora
Copy 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
Copy sudo dnf -y install dnf-plugins-core
sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo -y
2. Install the Docker packages
Debian / Ubuntu Fedora
Copy sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
Copy sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
sudo systemctl enable --now docker
3. Prepare directories and fetch files
Copy 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/ATOR-Development/anon-install/main/docker/anon-relay/relay.yaml
sudo wget -O /opt/anon/etc/anon/anonrc https://raw.githubusercontent.com/ATOR-Development/anon-install/main/docker/anon-relay/anonrc
sudo wget -O /root/.nyx/config https://raw.githubusercontent.com/ATOR-Development/anon-install/main/docker/anon-relay/config
4. Create and start the Docker container
Copy sudo docker compose -f /opt/compose-files/relay.yaml up -d
Done!
Commands for updating, testing and monitoring:
Edit relay configuration
Copy sudo nano /opt/anon/etc/anon/anonrc
Update relay to run latest version
Copy sudo docker container rm --force anon-relay
sudo docker pull svforte/anon:latest
sudo docker compose -f /opt/compose-files/relay.yaml up -d
Install Nyx monitor
Debian / Ubuntu Fedora
Copy sudo apt-get install nyx
Monitor relay with Nyx
Copy sudo nyx -s /opt/anon/run/anon/control
Check status for containers
Start, stop and restart the relay container
Copy sudo docker start anon-relay
sudo docker restart anon-relay
sudo docker stop anon-relay
Check systemctl logs for anon service
Copy sudo docker logs anon-relay
Monitor anon log
Copy sudo tail -f /opt/anon/etc/anon/notices.log
Remove the relay container
Copy sudo docker rm anon-relay --force