# How do you run a Tor relay on a VPS?

> How to run a Tor relay on a VPS: add the Tor Project repository, set 5 torrc lines with ExitRelay 0, open ORPort 443, or run an obfs4 bridge instead.

- URL: https://buymonerovps.com/guides/how-to-run-a-tor-relay-on-a-vps/
- Last updated: 2026-11-30
- Publisher: BuyMoneroVPS (https://buymonerovps.com)

**Quick answer**

To run a Tor relay on a VPS, install tor from the Tor Project repository, set a nickname, a contact address, ORPort 443, ExitRelay 0 and SocksPort 0 in /etc/tor/torrc, then restart. A middle or guard relay needs at least 10 Mbit/s and 512 MB of RAM. **BuyMoneroVPS** allows relays and bridges on every plan.

**In brief**

- A non-exit relay (middle or guard) carries encrypted traffic between other relays; it never connects to websites for users.
- A bridge is an unlisted entry point for people whose network blocks Tor; it needs only 1 Mbit/s.
- The Tor Project asks for at least 100 GB out and 100 GB in per month, and recommends more than 2 TB.
- The ContactInfo address in torrc is published with the relay.

## Which kind of relay should you run?

**A middle or guard relay if you have traffic to give, a bridge if you want to help people on censored networks.** The Tor Project's setup guide for a guard relay sets ExitRelay 0, so the relay passes traffic only to other relays. Whether it ends up serving as a guard is decided by the network, not by a line in the file.

A bridge is not listed in the public relay directory. People receive its address through Tor's own channels and connect with an obfs4 transport that disguises the traffic. The requirements are lighter: 1 Mbit/s is enough.

Exit relays are a different job: they connect to websites on behalf of users, and the operator's IP appears in abuse complaints. BuyMoneroVPS's terms allow relays and bridges, so this guide covers those two only; read the [acceptable use policy](https://buymonerovps.com/legal/acceptable-use/ "Acceptable use policy") before anything else. The [Tor relay use case](https://buymonerovps.com/use-cases/tor-relay/ "Tor relay on a VPS paid in crypto") compares plans and cities for each kind.

## Does a small VPS meet the Tor Project's requirements?

*Tor Project relay requirements against BuyMoneroVPS Ring 1 and Ring 2, 30 November 2026*

| Requirement | Tor Project figure | Ring 1 | Ring 2 |
| --- | --- | --- | --- |
| Bandwidth | 10 Mbit/s minimum, 16 Mbit/s recommended (bridge: 1 Mbit/s) | Shared 1 Gbit/s port | Shared 1 Gbit/s port |
| Monthly traffic | 100 GB out + 100 GB in minimum; over 2 TB recommended | 2 TB | 4 TB |
| RAM | 512 MB under 40 Mbit/s; 1 GB above | 1 GB | 2 GB |
| Disk | Under 200 MB for Tor | 20 GB NVMe | 40 GB NVMe |
| IPv4 | Public, stable for 3 hours or more | 1 dedicated IPv4 | 1 dedicated IPv4 |
| Price for 30 days | — | $3.78 | $5.51 |

## How do you set up a middle or guard relay?

1. **Secure the server and turn on automatic updates** — The Tor Project's guide starts here: a relay must stay patched. Follow the hardening steps and enable unattended upgrades first.
2. **Add the Tor Project's package repository** — Install apt-transport-https, import the repository key into /usr/share/keyrings, and add the deb.torproject.org lines for your release codename.
3. **Install tor** — Run apt update, then install tor together with deb.torproject.org-keyring, which keeps the signing key current.
4. **Edit /etc/tor/torrc** — Set Nickname, ContactInfo, ORPort 443, ExitRelay 0 and SocksPort 0. Pick another ORPort if 443 is taken by a web server.
5. **Open the ORPort and restart** — Allow the ORPort in ufw, then run systemctl restart tor@default.
6. **Read the log** — Check journalctl -e -u tor@default: the log should report that the ORPort passed its reachability test from outside.

*Tor Project repository and install (Debian 13 is "trixie"; check yours with lsb_release -c)*

```bash
sudo apt install apt-transport-https
wget -qO- https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc \
  | gpg --dearmor | sudo tee /usr/share/keyrings/deb.torproject.org-keyring.gpg >/dev/null

echo "deb [signed-by=/usr/share/keyrings/deb.torproject.org-keyring.gpg] https://deb.torproject.org/torproject.org $(lsb_release -cs) main" \
  | sudo tee /etc/apt/sources.list.d/tor.list

sudo apt update
sudo apt install tor deb.torproject.org-keyring
```

*/etc/tor/torrc for a non-exit relay*

```text
Nickname    myVpsRelay
ContactInfo relay-admin@example.org
ORPort      443
ExitRelay   0
SocksPort   0
```

*Open the port, restart, check*

```bash
sudo ufw allow 443/tcp
sudo systemctl restart tor@default
sudo journalctl -e -u tor@default
```

## How do you run a bridge instead?

**Install tor and obfs4proxy, set BridgeRelay 1 and two reachable ports, then restart.** The Tor Project's bridge guide replaces the whole torrc with a short file: BridgeRelay 1, an ORPort (not 9001), a ServerTransportPlugin line pointing to /usr/bin/obfs4proxy, a ServerTransportListenAddr for obfs4 on a second port, ExtORPort auto, and an optional ContactInfo and Nickname. Both ports must be reachable from outside, so open them in ufw.

obfs4proxy is in Debian's repositories and in some Ubuntu releases; elsewhere the guide points to building Lyrebird from source. To put obfs4 on a port under 1024, such as 443, the guide grants the binary cap_net_bind_service and sets NoNewPrivileges=no in a systemd override. Start the bridge with systemctl enable --now tor.service, then look for the line "Your Tor bridge's hashed identity key fingerprint is" in the log.

*/etc/tor/torrc for an obfs4 bridge (pick two free ports)*

```text
BridgeRelay 1
ORPort 8443
ServerTransportPlugin obfs4 exec /usr/bin/obfs4proxy
ServerTransportListenAddr obfs4 0.0.0.0:8080
ExtORPort auto
ContactInfo bridge-admin@example.org
Nickname myVpsBridge
```

## What should you watch once the relay runs?

**Traffic against your plan's monthly allowance, updates, and the stability of the IP address.** A busy relay can use terabytes; the Tor Project ideally wants an unmetered plan and recommends more than 2 TB a month. Ring 1 includes 2 TB, Ring 2 4 TB and Ring 4 8 TB, so size the plan to the traffic you are willing to give.

Uptime matters too: the requirements page calls a relay that runs less than 2 hours a day of limited use, and 24/7 ideal. Renewing from your balance with auto-renew on avoids a suspension that would knock the relay offline at the end of the paid days.

According to BuyMoneroVPS's survey of 30 November 2026, Ring 2 costs $5.51 where Servers.Guru charges €4.99 ($5.47) for its nearest plan. Before installing, run through [how to secure a new Linux VPS](https://buymonerovps.com/guides/how-to-secure-a-new-linux-vps/ "How to secure a new Linux VPS") and the [ufw firewall guide](https://buymonerovps.com/guides/how-to-set-up-a-ufw-firewall/ "How to set up a UFW firewall").

## Frequently asked questions

### Is running a Tor relay allowed at BuyMoneroVPS?

Yes. BuyMoneroVPS allows Tor relays and bridges. Exit relays are outside that permission; read the acceptable use policy or ask support before considering one.

### Will my relay's IP address be public?

A middle or guard relay is listed in the public Tor directory with its IP, nickname and ContactInfo. A bridge is not listed publicly, which is the point of a bridge.

### How much RAM does a relay need?

The Tor Project asks for 512 MB for a non-exit relay under 40 Mbit/s and 1 GB above that. Ring 1 has 1 GB, Ring 2 has 2 GB.

### Why use the Tor Project's repository instead of Debian's package?

The relay guide asks for it, so the relay runs a current tor release. The deb.torproject.org-keyring package keeps the signing key up to date.

### Can I run a relay and a Monero node on the same VPS?

Yes, if the disk and traffic allow it: a pruned node needs about 105 GiB and the relay shares the monthly traffic. Ring 8 or larger fits both.

**Verdict**

- A non-exit relay on Ring 1 or Ring 2 meets every Tor Project minimum.
- Choose a bridge when traffic is scarce and censorship is the problem you want to help with.
- Keep ExitRelay 0: BuyMoneroVPS's terms cover relays and bridges.

## Sources

1. [Relay setup, Debian/Ubuntu](https://community.torproject.org/relay/setup/guard/debian-ubuntu/) — Tor Project (read 2026-11-30)
2. [Relay requirements](https://community.torproject.org/relay/relays-requirements/) — Tor Project (read 2026-11-30)
3. [Bridge setup, Debian/Ubuntu](https://community.torproject.org/relay/setup/bridge/debian-ubuntu/) — Tor Project (read 2026-11-30)
4. [Tor Debian repository](https://support.torproject.org/apt/tor-deb-repo/) — Tor Project (read 2026-11-30)

**Host a Tor relay paid in Monero** Ring 2: 1 vCPU · 2 GB memory · 40 GB NVMe disk · 4 TB monthly transfer, a dedicated IPv4, relays and bridges allowed.

- [Deploy Ring 2 for $5.51](https://buymonerovps.com/app/checkout/?plan=ring-2&term=1m&from=guides-how-to-run-a-tor-relay-on-a-vps&lang=en)
- [Compare all plans](https://buymonerovps.com/pricing/ "BuyMoneroVPS pricing: what does a Monero VPS cost?")

---

BuyMoneroVPS: BuyMoneroVPS sells Linux KVM virtual servers paid in Monero first, and also in Bitcoin, Litecoin, Solana, Ether, USDC and USDT, with no ID check and no email required. Servers run in Amsterdam, Reykjavik, Zurich, Bucharest, New York, Dallas, Los Angeles, London, Frankfurt, from $3.78 a month. BuyMoneroVPS LLC, a New Mexico company, runs the service.
