# Installing Anon

The Anyone Relay is a critical component of the **Anyone Protocol**, which ensures anonymity and privacy in network and internet communications.

Whether you followed the instructions in [Step 1: Setting up Your Environment](https://docs.anyone.io/relay/start/prep) or want to install the anon software directly using our provided methods, continue reading..

***

## Debian and Ubuntu

> *"I am running a Debian based Operating System and want to install the anon binary!"*

<div align="left"><figure><img src="https://content.gitbook.com/content/AA9P3lN6X0LnMGWCOpyt/blobs/BLKaWVfLQzjp0IR2qOFy/image.png" alt="" width="375"><figcaption></figcaption></figure></div>

#### To kickstart the installation process, execute the following command in your terminal or visit our [APT Repository instructions](https://docs.anyone.io/relay/start/install-anon-on-linux/apt) for a more hands-on experience:

{% code title="Copy ->" overflow="wrap" fullWidth="false" %}

```bash
sudo /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/anyone-protocol/anon-install/refs/heads/main/install.sh)"
```

{% endcode %}

This command initiates the download and execution of the installation script directly from our GitHub repository. Throughout the installation, you'll be prompted to provide necessary configurations for setting up the Anon Relay on your system, ensuring a tailored and secure deployment.&#x20;

{% hint style="info" %}
You can restart the script at any time to reconfigure the relay if you made a mistake during the process or want to change anything.
{% endhint %}

Upon successful installation, you'll receive a congratulatory message, indicating that the Anon Relay has been installed and configured successfully.

{% hint style="success" %}

```
==================================================
               Congratulations!
   Anon configuration completed successfully.
            https://docs.anyone.io
==================================================
```

{% endhint %}

To make sure the Relay is reachable, refer to: [Confirm ORPort Reachability](https://docs.anyone.io/relay/troubleshooting/orport) for instructions.

***

### **Anon Relay Configuration Wizard**

During the installation you will be prompted to read and accept the [Terms and Conditions](https://anyone.io/terms).

{% hint style="info" %}

```
Please read the terms and conditions at https://www.anyone.io/terms
Do you accept the terms and conditions? [yes/no] yes
```

{% endhint %}

#### The installation script will guide you through a step-by-step configuration process.

Allowing you to configure the following:

<details>

<summary>1. <mark style="color:blue;">Nickname</mark> and <mark style="color:blue;">ContactInfo</mark><br><em>Enter the desired Nickname and Contact information for your Anon Relay.</em></summary>

**Example:**

```
- Enter the desired Nickname and Contact information for your Anon Relay
1/7 Nickname (1-19 characters, only [a-zA-Z0-9] and no spaces): nickname
1/7 Contact Information (leave empty to skip): 
```

*Sources:* [*Nickname*](https://docs.anyone.io/sdk/native-sdk/manual#nickname-name) *and* [*ContactInfo*](https://docs.anyone.io/sdk/native-sdk/manual#contactinfo-email_address)

</details>

<details>

<summary><strong>2. </strong><mark style="color:blue;"><strong>MyFamily</strong></mark><strong> setup (Optional)</strong><br><em>If you're setting up more than one relay, fingerprints have to be specified in MyFamily.</em> </summary>

**Example:**

```
- Enter a comma-separated list of fingerprints for your relay's family
2/7 MyFamily fingerprints (leave empty to skip): AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB,CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
```

*Source:* [*MyFamily*](https://docs.anyone.io/sdk/native-sdk/manual#myfamily-fingerprint-fingerprint)

</details>

<details>

<summary><strong>3. </strong><mark style="color:blue;"><strong>BandwidthRate</strong></mark><strong> and</strong> <mark style="color:blue;">BandwidthBurst</mark> <strong>(Optional)</strong><br><em><strong>Enter a number in</strong> Mbit <strong>i</strong>f you want to specify a bandwidth rate and burst.</em></summary>

**Example:**

```
- Enter BandwidthRate and BandwidthBurst in Mbit (e.g., 100 for 100 Mbit)
3/7 BandwidthRate (leave empty to skip): 100
3/7 BandwidthBurst (leave empty to skip): 120
```

*Sources:* [*BandwidthRate*](https://docs.anyone.io/sdk/native-sdk/manual#bandwidthrate-n-bytes-or-kbytes-or-mbytes-or-gbytes-or-tbytes-or-kbits-or-mbits-or-gbits-or-tbits-1) *and* [*BandwidthBurst*](https://docs.anyone.io/sdk/native-sdk/manual#bandwidthburst-n-bytes-or-kbytes-or-mbytes-or-gbytes-or-tbytes-or-kbits-or-mbits-or-gbits-or-tbits-1)

</details>

<details>

<summary>4. Customise <mark style="color:blue;"><strong>ORPort</strong></mark><strong> (Optional)</strong><br><em>Specify a custom OR port if you don't want to use the default port <code>9001</code>.</em></summary>

**Example:**

```
- Enter ORPort
4/7 ORPort [Default: 9001]: 9004
ORPort set to: 9004
```

*Source:* [*ORPort*](https://docs.anyone.io/sdk/native-sdk/manual#orport-address-port-or-auto-flags)

</details>

<details>

<summary>5. <mark style="color:blue;">Ethereum Wallet</mark> Configuration (Optional)<br><em>Provide an Ethereum EVM address to register for contribution rewards.</em></summary>

**Example**

```
- Do you want to enter an Ethereum EVM address for contribution rewards
5/7 (yes/no): yes
5/7 Enter your Ethereum wallet address: 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
```

*Source:* [*Rewards Program Registration*](https://docs.anyone.io/dashboard/register)

</details>

<details>

<summary>6. Disable or Enable the <mark style="color:blue;">Controlport</mark> (Optional)<br><em>Choose if you want the Controlport to be enabled on port <code>9051</code>. [Default: no]</em></summary>

**Example:**

```
- Should the anon.service ControlPort be enabled?
6/7 Enable ControlPort? [Default: no]: yes
```

*Source:* [*Controlport*](https://docs.anyone.io/sdk/native-sdk/manual#controlport-address-port-or-unix-path-or-auto-flags)

*Hint: It's necessary to enable this (yes) if you want to monitor your Relay through the ControlPort.*\
\
*See* [*Additional monitoring...*](#monitor-anon-service-log)

</details>

<details>

<summary><strong>7.</strong> <mark style="color:green;">*<strong>UncomplicatedFirewall</strong></mark><strong> installation (Optional)</strong><br><em>Select if you want to install 'UFW' and explicitly allow the necessary ports for operation.</em></summary>

**Example**

```
- Would you like to install UncomplicatedFirewall and allow incoming traffic on:
- ORPort 9004
- SSH port 22

7/7 Configure and enable ufw (yes/no): yes
```

*External sources:* [*Ubuntu Wiki*](https://wiki.ubuntu.com/UncomplicatedFirewall) and [Ubuntu Community Documentation on UFW](https://help.ubuntu.com/community/UFW)

</details>

{% hint style="info" %}

#### Visit the Rewards Dashboard section to read more about how to sign up!

## [www.docs.anyone.io/rewards](https://docs.anyone.io/dashboard)

{% endhint %}

### Sources and Example

REPOSITORY:\
<https://github.com/anyone-protocol/anon-install>\
BASH SCRIPT:\
<https://github.com/anyone-protocol/anon-install/blob/main/install.sh>\
README:\
<https://github.com/anyone-protocol/anon-install/blob/main/README.md>

{% code title="Example from README" %}

```
...
Configuring anon
----------------

Please read the terms and conditions at https://www.anyone.io/terms

Do you accept the terms and conditions? [yes/no] yes

...

==================================================
           ANON Installation Complete
==================================================


                                                                 /$$
                                                                |__/
  /$$$$$$  /$$$$$$$  /$$   /$$  /$$$$$$  /$$$$$$$   /$$$$$$      /$$  /$$$$$$
 |____  $$| $$__  $$| $$  | $$ /$$__  $$| $$__  $$ /$$__  $$    | $$ /$$__  $$
  /$$$$$$$| $$  \ $$| $$  | $$| $$  \ $$| $$  \ $$| $$$$$$$$    | $$| $$  \ $$
 /$$__  $$| $$  | $$| $$  | $$| $$  | $$| $$  | $$| $$_____/    | $$| $$  | $$
|  $$$$$$$| $$  | $$|  $$$$$$$|  $$$$$$/| $$  | $$|  $$$$$$$ /$$| $$|  $$$$$$/
 \_______/|__/  |__/ \____  $$ \______/ |__/  |__/ \_______/|__/|__/ \______/
                     /$$  | $$
                    |  $$$$$$/
                     \______/


==================================================
        Start Relay Configuration Wizard
  (Or abort and manually edit /etc/anon/anonrc)
==================================================

- Enter the desired Nickname and Contact information for your Anon Relay
1/7 Nickname (1-19 characters, only [a-zA-Z0-9] and no spaces): nickname
1/7 Contact Information (leave empty to skip): 

- Enter a comma-separated list of fingerprints for your relay's family
2/7 MyFamily fingerprints (leave empty to skip): AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB,CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC

- Enter BandwidthRate and BandwidthBurst in Mbit (e.g., 100 for 100 Mbit)
3/7 BandwidthRate (leave empty to skip): 100
3/7 BandwidthBurst (leave empty to skip): 120

- Enter ORPort
4/7 ORPort [Default: 9001]: 9004
ORPort set to: 9004

==================================================
         Ethereum Wallet Configuration
==================================================

- Do you want to enter an Ethereum EVM address for contribution rewards?
5/7 Ethereum Address (yes/no): yes
5/7 Enter your Ethereum wallet address: 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

==================================================
       Enable Monitoring and Control port
==================================================

- Should the anon.service ControlPort be enabled?
6/7 Enable ControlPort? [Default: no]: yes

==================================================
      Optional Local Firewall Installation
==================================================

The default firewall configuration tool for Ubuntu is ufw.
Developed to ease iptables firewall configuration, ufw provides
a user friendly way to create an IPv4 or IPv6 host-based firewall.
By default UFW is disabled.

https://help.ubuntu.com/community/UFW


- Would you like to install UncomplicatedFirewall and allow incoming traffic on:
- ORPort 9004
- SSH port 22

7/7 Configure and enable ufw (yes/no): yes
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  ufw
...

Rules updated
Rules updated (v6)
Rules updated
Rules updated (v6)
Command may disrupt existing ssh connections. Proceed with operation (y|n)? y
Firewall is active and enabled on system startup

==================================================
UFW installed and rules added for ORPort 9004 and SSH port 22.

Make sure old firewall rules are removed if they are no longer valid.
To show current UFW configuration: sudo ufw status
To remove an old rule: sudo ufw delete allow <port-number>

For improved security, consider setting up SSH key authentication.
Refer to official documentation: https://ssh.com/ssh/keygen for instructions.

Waiting for the fingerprint to be generated.
Please don't interrupt the process...

==================================================
              Anon Relay Fingerprint
     058B704D9EF0714C48125B733562657F3F471C08
==================================================

Nickname nickname
ContactInfo @anon: 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
Log notice file /var/log/anon/notices.log
ORPort 9004
ControlPort 9051
SocksPort 0
ExitRelay 0
IPv6Exit 0
ExitPolicy reject *:*
ExitPolicy reject6 *:*
BandwidthRate 100 Mbit
BandwidthBurst 120 Mbit
MyFamily AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB,CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC

==================================================
               Congratulations!
   Anon configuration completed successfully.
            https://docs.anyone.io
==================================================
```

{% endcode %}

***

## Maintenance and Monitoring

Additionally, you'll find some handy Linux Terminal commands for managing and maintaining your Anyone Relay instance. You can use [SSH for remote management](https://docs.anyone.io/relay/start/prep/ssh-setup) (Powershell) of the Linux Operating System and anon if you are on Windows. Otherwise use a regular SSH connection from another bash prompt or terminal window on on a remote machine.

### Check status for anon service

```bash
sudo systemctl status anon
```

### Start, stop and restart anon service

```sh
sudo systemctl start anon
sudo systemctl restart anon
sudo systemctl stop anon
```

### Update Anon to the latest version <a href="#update-anon-to-the-newest-version" id="update-anon-to-the-newest-version"></a>

Keep your Anyone Relay up-to-date with the latest enhancements and security patches by running

```bash
sudo apt-get update --yes
sudo apt-get install --only-upgrade anon --yes
```

### Monitor anon service log

Stay informed about the operation of your Anyone Relay by monitoring the service log with.

<pre class="language-bash"><code class="lang-bash"><strong>sudo tail -f /var/log/anon/notices.log
</strong></code></pre>

{% hint style="info" %}
Additional monitoring can be done with a third-party application called Nyx.\
[Read more about Nyx in our FAQ](https://docs.anyone.io/welcome/faq#how-to-install-nyx-for-monitoring-in-debian).
{% endhint %}

### Edit relay configuration

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

### Verify relay configuration

```bash
sudo /usr/bin/anon -f /etc/anon/anonrc --verify-config
```

### Extra User Permissions

To simplify future operations and grant monitoring permissions, it's recommended to add your user to the '`debian-anon`' group. This eliminates the need for sudo privileges when running monitoring tools like [Nyx](https://docs.anyone.io/welcome/faq#how-to-install-nyx-for-monitoring-in-debian).&#x20;

```bash
sudo usermod -a -G debian-anon $USER
```
