How to Host a TOR Node on Debian, Ubuntu, or AlmaLinux (Complete Guide)
Hosting a TOR node is one of the most effective ways to support internet privacy, anonymity, and freedom. Whether you want to run a TOR relay or a TOR exit node, this guide will walk you through everything you need to know on Debian, Ubuntu, and AlmaLinux—three of the most popular Linux distributions for secure server environments.
In this step-by-step tutorial, you’ll learn how to install TOR, configure your node, harden security, and ensure optimal performance. This guide is fully SEO-optimized to help beginners and advanced users run a TOR node safely and efficiently.
What Is a TOR Node?
A TOR node, also called a relay, is a server that helps route encrypted traffic across the Tor network. Nodes come in three types:
-
Guard (Entry) Node – The first hop in the TOR circuit
-
Middle Relay – Forwards encrypted traffic between nodes
-
Exit Node – The final hop before traffic reaches the open internet
The TOR project relies on volunteers hosting these nodes to keep the network fast, safe, and decentralized.
Prerequisites
Before you begin hosting a TOR node on Debian, Ubuntu, or AlmaLinux, make sure you have:
-
A VPS or dedicated server (1 GB RAM minimum recommended)
-
Static public IP address
-
Basic Linux command-line knowledge
-
Open ports: 9001, 9030 (relays) or default ports for exit nodes
-
At least 10 Mbps upload speed
How to Host a TOR Node on Debian and Ubuntu
Debian and Ubuntu share similar package managers, making installation simple.
Step 1: Add TOR Repository
Step 2: Install TOR and Keyring
Step 3: Configure the TOR Node
Edit the TOR configuration file:
Add the basic relay configuration:
Set
ExitRelay 0to disable exit traffic and run a safe middle relay.
Save and restart:
How to Host a TOR Node on AlmaLinux (RHEL/CentOS-Based)
TOR is not included by default in RHEL-based repositories, so we use EPEL.
Step 1: Install EPEL Repository
Step 2: Add TOR Repository
Step 3: Install TOR
Step 4: Configure TOR Relay
Open the TOR configuration file:
Recommended configuration:
Save and start TOR:
Firewall Configuration (All Linux Distros)
Allow the ORPort (9001):
ufw (Ubuntu/Debian)
firewalld (AlmaLinux)
Optimizing and Securing Your TOR Node
1. Keep Your System Updated
or
2. Monitor TOR Status
3. Check Relay Visibility
Visit:
https://metrics.torproject.org/rs.html
Search for your Nickname to confirm your relay is running.
Should You Host a TOR Exit Node?
Exit nodes carry the highest legal risk because they appear as the traffic origin. Only advanced administrators should run them after fully understanding local laws and using proper protections.
If unsure—run a middle relay instead.