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 Install Anon in Docker to find Docker instructions. Or read the Anon Client Releases page where you'll find instructions and links to examples utilizing the Anyone Protocol GitHub Releases.
Install the anyone-client with npm, edit a custom anonrc and start the client with npx.
HiddenServiceDir
This directory will store hidden service data and keys. Ensure the specified directory has the correct permissions and is writable by anyone-client.
HiddenServicePortThis redirects traffic from the hidden service to the local nginx server on port 80.
Start the anyone-client with the custom anonrc:
npxanyone-client-f./anon/anonrc
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.
Set up the Anyone Protocol apt repository and install the anon packages:
HiddenServiceDirThis directory will store hidden service data and keys. Ensure the specified directory has the correct permissions and is writable by the anon service.
HiddenServicePortThis redirects traffic from the hidden service to the local nginx server on port 80.
To get your service address check the hostname file located in ./anon/anon_service/:
sudocat/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
In this example we'll be setting up a local web server with Nginx to host some content.
Install nginx:
sudoaptupdate--yessudoapt-getinstallnginx--yes
Start and Enable nginx:
sudosystemctlstartnginxsudosystemctlenablenginx
Create an index.html in /var/www/html file as a basic test:
echo"Welcome to my Anyone Anon Service"|sudotee/var/www/html/index.html
Create a new nginx configuration file for your service:
sudonano/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: