Anyone Docs
  • 🔷The Documentation For Anyone
    • About
    • FAQ
  • 🔷Relay Setup
    • Get Started
    • Installation and Usage
      • Setting Your Environment
        • Virtualization on Windows
        • Virtualization on macOS
        • Install Ubuntu Server 22.04
        • Server management with SSH in Windows and macOS
      • Install Anon on Linux
      • Install Anon using the apt repository
      • Update Anon and accept terms and conditions
      • Install Anon in Docker
      • Configure SOCKS5 Proxy for Anyone
      • Install Anyone Exit Relay
    • Troubleshooting Common Issues
      • Diagnosing CGNAT and Public IPv4
      • Confirm ORPort Reachability
    • Firewall and Network Configurations
      • Router Port Forwarding
      • Install and Configure Firewall
    • Advanced Configuration and Troubleshooting
      • Configure IPv4 and IPv6
      • DoS mitigation parameters
    • Relay Operator Standards
    • Exit Relay Guidelines
  • 🔷Hardware Setup
    • Setup Guide
    • Description and Specifications
    • Relay Control Panel
      • Home
      • Network Settings
      • Relay Settings
      • Relay Family
      • Proxy Settings BETA
      • Change Password
      • Logs
      • Update
    • Update (Using USB)
    • Update to WEB 3.2.0 (Using UI)
    • Troubleshooting and additional configuration
      • Router Port Forwarding
      • Diagnosing CGNAT and Public IPv4
    • Router Setup
  • 🔷Security and Privacy
    • VPS Hardening
  • 🔷Rewards Dashboard
    • Registering to the Rewards Program
    • Accessing the Rewards Dashboard
    • Using the Rewards Dashboard
    • Rewards Status
  • 🔷Anyone SDK
    • NPM SDK
      • Install NPM Package
      • Run as Library
        • Anon
        • AnonSocksClient
        • AnonControlClient
      • Run from CLI
      • Tutorials
        • Hello Anon World I
        • Hello Anon World II
        • Circuit Control I
        • Circuit Control II
    • Native SDK
      • Anyone Client Releases
      • MAN - Anon Manual
      • Tutorials
        • Anyone Services I
        • Anyone Services II
    • iOS SDK [Beta]
      • Manual Install - CocoaPods
  • 🔷Connect to Anyone
    • Connecting to Linux
      • [Beta] One-Click Linux Setup
    • Connecting to macOS
      • macOS with NPM
      • [Beta] One-Click macOS Setup
    • Connecting to Windows
      • [Beta] One-Click Windows Setup
    • Individual Applications with Anyone
    • Connect Through Hardware
  • 🔷Tokenomics
    • Introduction
    • Token Distribution
      • Token Outflow
      • Other Tokens
    • Relay Rewards
      • Lock Requirement
      • Lock Adjustments
      • Reward Multipliers
    • Additional Roles
      • Authorities and Staking
      • Governance Voting
    • Premium Circuits
      • Premium Circuits
      • Premium Circuits: Metrics
    • Summary
      • Value Accrual Summary
      • Rewards Case Study
    • Appendix
      • M Derivation
      • Risk Equation Derivation
  • 🔷Resources
    • Community and Customer Support
    • Links
    • Token
    • Whitepaper
    • Roadmap
    • API
      • REST
      • [Future] GraphQL
Powered by GitBook
On this page

Was this helpful?

  1. Anyone SDK
  2. Native SDK
  3. Tutorials

Anyone Services I

Setting Up Hidden Services on the Anyone Network

Last updated 6 months ago

Was this helpful?

This guide gives an example and explains how to set up hidden services on the Anyone Network. There are several options to run anon. The following tabs explain how to install it as a Debian package using our APT repository or via command line tools using the NPM package. Alternatively see the page called to find Docker instructions. Or read the page where you'll find instructions and links to examples utilizing the Anyone Protocol .

  1. Install the anyone-client with npm, edit a custom anonrc and start the client with npx.

npm install @anyone-protocol/anyone-client

For detailed instructions see:

  1. Backup any existing configuration and create a custom anonrc:

mkdir -p ./anon
[ -f ./anon/anonrc ] && mv ./anon/anonrc ./anon/anonrc_$(date +"%Y%m%d_%H%M%S").bak
touch ./anon/anonrc
  1. To be able to route traffic through anon, add some configuration to the anonrc file:

cat <<EOL | tee ./anon/anonrc
ORPort 0
ControlPort 0
SocksPort 127.0.0.1:9050
SocksPolicy accept 127.0.0.1
SocksPolicy reject *
DataDirectory ./anon/

HiddenServiceDir ./anon/anon_service/
HiddenServicePort 80 127.0.0.1:80
EOL

This directory will store hidden service data and keys. Ensure the specified directory has the correct permissions and is writable by anyone-client.

This redirects traffic from the hidden service to the local nginx server on port 80.

  1. Start the anyone-client with the custom anonrc:

npx anyone-client -f ./anon/anonrc
  1. To get your service address (open a new terminal window and) check the hostname file located in ./anon/anon_service/:

cat ./anon/anon_service/hostname

This file contains the hidden service address (your .onion address) for your hidden service.

Install the anon client as a service on Debian, edit the default anonrc and restart the anon.service.

  1. Set up the Anyone Protocol apt repository and install the anon packages:

. /etc/os-release
sudo wget -qO- https://deb.en.anyone.tech/anon.asc | sudo tee /etc/apt/trusted.gpg.d/anon.asc
sudo echo "deb [signed-by=/etc/apt/trusted.gpg.d/anon.asc] https://deb.en.anyone.tech anon-live-$VERSION_CODENAME main" | sudo tee /etc/apt/sources.list.d/anon.list
sudo apt-get update --yes
sudo apt-get install anon --yes
  1. Backup default configuration and create a custom anonrc:

[ -f /etc/anon/anonrc ] && mv /etc/anon/anonrc /etc/anon/anonrc_$(date +"%Y%m%d_%H%M%S").bak
touch /etc/anon/anonrc
  1. To be able to route traffic through anon, add some configuration to the anonrc file:

sudo cat <<EOL | sudo tee /etc/anon/anonrc
ORPort 0
ControlPort 0
SocksPort 127.0.0.1:9050
SocksPolicy accept 127.0.0.1
SocksPolicy reject *
DataDirectory /var/lib/anon/

HiddenServiceDir /var/lib/anon/anon_service/
HiddenServicePort 80 127.0.0.1:80
EOL
  1. Restart the anon service:

sudo systemctl restart anon.service
  1. To get your service address check the hostname file located in ./anon/anon_service/:

sudo cat /var/lib/anon/anon_service/hostname

This file contains the hidden service address (your .onion address) for your onion service.

Install and Configure nginx to run a web server

Install nginx:

 sudo apt update --yes
 sudo apt-get install nginx --yes

Start and Enable nginx:

sudo systemctl start nginx
sudo systemctl enable nginx

Create an index.html in /var/www/html file as a basic test:

echo "Welcome to my Anyone Anon Service" | sudo tee /var/www/html/index.html

Create a new nginx configuration file for your service:

sudo nano /etc/nginx/sites-available/anon_service

Paste the following configuration and save to route requests to your anon service:

server {
    listen 127.0.0.1:80;
    server_name localhost;

    root /var/www/html;
    index index.html;

    location / {
        try_files $uri $uri/ =404;
    }
}

Link the configuration to the sites-enabled directory:

sudo ln -s /etc/nginx/sites-available/anon_service /etc/nginx/sites-enabled/

Reload nginx to apply the changes:

sudo systemctl reload nginx

Test the rechability of the web server locally with curl:

curl "http://127.0.0.1:80"

Test the reachability of the web server's hostname, located in ./anon/anon_service/hostname, using curl --socks5-hostname:

curl --socks5-hostname 127.0.0.1:9050 "http://$(cat ./anon/anon_service/hostname)"

For detailed instructions see:

This directory will store hidden service data and keys. Ensure the specified directory has the correct permissions and is writable by the anon service. This redirects traffic from the hidden service to the local nginx server on port 80.

In this example we'll be setting up a local web server with to host some content.

🔷
Install anon on Linux
Install anon using the apt repository
Nginx
Install Anon in Docker
Anon Client Releases
GitHub Releases
Install NPM Package
Run from CLI
HiddenServiceDir
HiddenServicePort
HiddenServiceDir
HiddenServicePort