Automated deployment of Anyone Protocol Anon Relay nodes via Docker using Ansible. This playbook simplifies the setup and management of privacy-focused relay infrastructure that contributes to the decentralized Anyone network.
Anyone Protocol (formerly ATOR) is a decentralized, privacy-first relay network that provides censorship-resistant, anonymous internet routing through onion routing. Relay operators contribute bandwidth and computing power to the network and earn ANYONE tokens as rewards.
- π Privacy-First: Anonymous routing through encrypted relay nodes
- π° Token Incentivized: Earn ANYONE tokens for running relays
- π Decentralized: No central authority controls the network
- π³ Docker-Based: Containerized for easy deployment and management
- π§ Automated: This playbook handles the entire setup process
- Prerequisites
- Quick Start
- Installation
- Configuration
- Usage
- Project Structure
- Documentation
- Troubleshooting
- Contributing
- License
- Ansible: 8.5.0 or higher (includes ansible-core 2.15+)
- Python: 3.8 or higher
- SSH Client: OpenSSH
- Operating System:
- Ubuntu 20.04 LTS or higher
- Debian 10 or higher
- Fedora 35 or higher
- Architecture: amd64 or arm64 (including Raspberry Pi)
- RAM: Minimum 512MB (1GB+ recommended)
- Disk Space: Minimum 5GB free
- Network:
- Public IP address
- Open ports: 9001 (OR port), 9030 (Dir port)
- Access: SSH access with sudo privileges
- Docker CE 20.10+
- Docker Compose V2
- Nyx monitoring tool (optional)
git clone https://github.com/yourusername/anon-relay-ansible-deployment.git
cd anon-relay-ansible-deploymentansible-galaxy collection install -r requirements.yml# Edit inventory file with your server details
nano inventory.iniAdd your relay server(s):
[relays]
relay1.example.com ansible_user=ubuntu ansible_ssh_private_key_file=~/.ssh/id_rsa
[relays:vars]
ansible_python_interpreter=/usr/bin/python3# Edit relay configuration
nano group_vars/relays.ymlMinimum required configuration:
anon_relay_nickname: "MyAnonRelay"
anon_relay_contact: "operator@example.com"
anon_accept_terms: true # Required for v0.4.9.7-live+# Dry run (check mode)
ansible-playbook -i inventory.ini site.yml --check
# Full deployment
ansible-playbook -i inventory.ini site.yml# Check relay status
ansible relays -i inventory.ini -m shell -a "docker ps | grep anon-relay"
# View logs
ansible relays -i inventory.ini -m shell -a "docker logs anon-relay"# Clone repository
git clone https://github.com/yourusername/anon-relay-ansible-deployment.git
cd anon-relay-ansible-deployment
# Install Ansible (if not already installed)
# On Ubuntu/Debian:
sudo apt update
sudo apt install ansible
# On Fedora:
sudo dnf install ansible
# On macOS:
brew install ansible
# Install required Ansible collections
ansible-galaxy collection install -r requirements.yml# Will be available after initial release
ansible-galaxy role install anon_relay_deploy# inventory.ini
[relays]
relay1.example.com ansible_user=ubuntu# inventory.ini
[relays]
relay1.example.com ansible_user=ubuntu
relay2.example.com ansible_user=ubuntu
relay3.example.com ansible_user=debian
[relays:vars]
ansible_python_interpreter=/usr/bin/python3Variables can be set at multiple levels:
---
# Docker Configuration
docker_edition: 'ce'
docker_compose_version: "latest"
# Base Directories
anon_base_dir: "/opt/anon"
compose_dir: "/opt/compose-files"
# User Configuration
anon_user: "anond"
anon_uid: 100
anon_gid: 101---
# === REQUIRED CONFIGURATION ===
# Relay nickname (max 19 characters, alphanumeric)
anon_relay_nickname: "MyAnonRelay"
# Contact email (publicly visible)
anon_relay_contact: "operator@example.com"
# Terms acceptance (required for v0.4.9.7-live+)
anon_accept_terms: true
# === OPTIONAL CONFIGURATION ===
# Bandwidth limits
anon_relay_bandwidth_rate: "100 MBytes"
anon_relay_bandwidth_burst: "200 MBytes"
# Port configuration
anon_relay_or_port: 9001
anon_relay_dir_port: 9030
# Docker image version
anon_docker_image: "svforte/anon:latest"---
# Override for specific host
anon_relay_nickname: "Relay1Custom"
anon_relay_bandwidth_rate: "200 MBytes"Store sensitive data securely using Ansible Vault:
# Create encrypted vault file
ansible-vault create group_vars/all/vault.yml
# Add encrypted variables
vault_relay_contact: "secret@example.com"
vault_api_key: "your-secret-key"
# Reference in group_vars/relays.yml
anon_relay_contact: "{{ vault_relay_contact }}"Run playbooks with vault:
ansible-playbook -i inventory.ini site.yml --ask-vault-passansible-playbook -i inventory.ini site.ymlansible-playbook -i inventory.ini site.yml --limit relay1.example.comansible-playbook -i inventory.ini site.yml --tags dockeransible-playbook -i inventory.ini update.ymlansible-playbook -i inventory.ini site.yml --checkansible-playbook -i inventory.ini site.yml -vvvansible-playbook -i inventory.ini remove.yml# Install Nyx monitoring tool
ansible-playbook -i inventory.ini monitor.yml
# Access Nyx on target server
ssh relay1.example.com
sudo nyx -s /opt/anon/run/anon/controlanon-relay-ansible-deployment/
βββ .github/
β βββ workflows/
β βββ ci.yml # CI/CD pipeline
βββ .gitignore # Git ignore patterns
βββ AGENTS.md # AI agent instructions
βββ CLAUDE.md # Claude-specific rules
βββ COPILOT.md # Copilot instructions
βββ DEVELOPMENT_PLAN.md # Project roadmap
βββ README.md # This file
βββ CONTRIBUTING.md # Contribution guide
βββ SECURITY.md # Security policy
βββ CHANGELOG.md # Version history
βββ LICENSE # MIT License
βββ ansible.cfg # Ansible configuration
βββ requirements.yml # Galaxy dependencies
βββ inventory.ini # Inventory example
βββ site.yml # Main playbook
βββ deploy.yml # Deployment playbook
βββ update.yml # Update playbook
βββ remove.yml # Cleanup playbook
βββ monitor.yml # Monitoring setup
βββ group_vars/
β βββ all.yml # Global variables
β βββ relays.yml # Relay variables
βββ host_vars/ # Host-specific vars
βββ roles/
β βββ docker_setup/ # Docker installation
β βββ anon_relay_deploy/ # Relay deployment
β βββ anon_relay_monitor/ # Monitoring setup
βββ examples/ # Example configs
βββ docs/ # Documentation
βββ tests/ # Test files
- AGENTS.md - Universal AI coding agent instructions
- CLAUDE.md - Claude-specific configuration
- DEVELOPMENT_PLAN.md - Project development roadmap
- CONTRIBUTING.md - Contribution guidelines
- SECURITY.md - Security policies
- docs/architecture.md - System architecture overview
- docs/configuration.md - Detailed configuration guide
- docs/troubleshooting.md - Common issues and solutions
- docs/faq.md - Frequently asked questions
- roles/docker_setup/README.md - Docker installation role
- roles/anon_relay_deploy/README.md - Relay deployment role
- roles/anon_relay_monitor/README.md - Monitoring role
Solution: Ensure the user has sudo privileges
# Add user to sudoers
sudo usermod -aG sudo ubuntu
# Or configure passwordless sudo
echo "ubuntu ALL=(ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/ubuntuSolution: Install required Ansible collections
ansible-galaxy collection install community.docker
# Or install all requirements
ansible-galaxy collection install -r requirements.ymlSolution: Check Docker logs and configuration
# View container logs
docker logs anon-relay
# Check container status
docker ps -a | grep anon
# Verify configuration
cat /opt/anon/etc/anon/anonrcSolution: Configure firewall
# Ubuntu/Debian (UFW)
sudo ufw allow 9001/tcp
sudo ufw allow 9030/tcp
sudo ufw reload
# Fedora (firewalld)
sudo firewall-cmd --permanent --add-port=9001/tcp
sudo firewall-cmd --permanent --add-port=9030/tcp
sudo firewall-cmd --reloadSolution: Set anon_accept_terms: true in variables
# group_vars/relays.yml
anon_accept_terms: true# Run with maximum verbosity
ansible-playbook -i inventory.ini site.yml -vvvv
# Check Ansible facts
ansible all -i inventory.ini -m setup
# Test connectivity
ansible all -i inventory.ini -m ping- Check docs/troubleshooting.md for detailed solutions
- Review docs/faq.md for common questions
- Open an issue on GitHub Issues
- Join the Anyone Protocol Discord
We welcome contributions! Please see CONTRIBUTING.md for details on:
- Code of Conduct
- Development workflow
- Coding standards
- Testing requirements
- Pull request process
# Fork and clone
git clone https://github.com/yourusername/anon-relay-ansible-deployment.git
# Create feature branch
git checkout -b feature/your-feature-name
# Make changes and test
ansible-playbook site.yml --syntax-check
ansible-lint site.yml
# Commit with conventional commits format
git commit -m "feat(role): add new feature"
# Push and create pull request
git push origin feature/your-feature-name- Phase 1: Project structure and documentation
- Phase 2: Docker installation role
- Phase 3: Anon relay deployment role
- Phase 4: Monitoring and management role
- Phase 5: Main playbooks and inventory
- Phase 6: Comprehensive testing
- Phase 7: Complete documentation
- Phase 8: Security hardening
See DEVELOPMENT_PLAN.md for detailed roadmap.
# Syntax check
ansible-playbook site.yml --syntax-check
# Linting
ansible-lint site.yml
yamllint .
# Molecule tests (if available)
molecule test
# Integration tests
cd tests
ansible-playbook -i inventory/test_hosts.ini test.ymlThis project uses GitHub Actions for continuous integration. Tests run automatically on:
- Every push to main/develop branches
- Every pull request
- Nightly builds
This project is licensed under the MIT License - see the LICENSE file for details.
- Elvis Nuno - Initial work - @enuno
See the list of contributors who participated in this project.
- Anyone Protocol team for creating the decentralized relay network
- Ansible community for excellent automation tools
- All contributors and relay operators
- Anyone Protocol: https://anyone.io
- Documentation: https://docs.anyone.io
- GitHub: https://github.com/anyone-protocol
- Discord: https://discord.gg/anyone
- Twitter: @anyone_protocol
- Documentation: Start with this README and explore docs/
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: support@example.com
- Discord: Anyone Protocol Discord
If this project helped you, please consider:
- β Starring the repository
- π Reporting bugs or suggesting features
- π Contributing code or documentation
- π’ Sharing with others who might benefit
Current Version: 1.0.0 (In Development)
Status: Active Development
Stability: Alpha
Made with β€οΈ for the Anyone Protocol community
Help us build a more private, decentralized internet.