# Firewall Setup & Rules

### 1. Update sources and install

Update your system and install the package and dependencies using these commands

{% tabs %}
{% tab title="Debian / Ubuntu" %}

```bash
sudo apt-get update -y
sudo apt-get install ufw -y
```

{% endtab %}
{% endtabs %}

### 2. Enable firewall and add allow rules for SSH and ORport

{% tabs %}
{% tab title="Debian / Ubuntu" %}

```bash
sudo ufw allow 22
sudo ufw allow 9001
sudo ufw enable
```

When prompted with the message '`Command may disrupt existing ssh connections'`, type '**y**' and hit **ENTER**.
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.anyone.io/relay/network/firewall.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
