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

> Run a Tor middle relay on a VPS in 5 steps on Debian 13. Dusk, 2 GB RAM and 2 TB of traffic, costs $5.25 a month on the 12-month term.

- URL: https://gloamport.com/guides/how-to-run-a-tor-relay-on-a-vps/
- Last updated: 2026-11-10
- Publisher: Gloamport (https://gloamport.com)

A non-exit relay carries encrypted Tor traffic between other relays. This guide sets one up on Debian 13 or Ubuntu 24.04.

**Quick answer — How do I run a Tor relay on a VPS?**

To run a Tor relay on a VPS, install the tor package, write five lines in /etc/tor/torrc (Nickname, ContactInfo, ORPort, ExitRelay 0, SocksPort 0) and restart tor@default. A Gloamport Dusk plan, 1 vCPU, 2 GB RAM, 40 GB NVMe, 2 TB traffic, runs a middle relay for $5.25 a month on 12 months.

## What does a middle relay need from a VPS?

| Item | Value in this guide |
| --- | --- |
| Plan | Dusk: 1 vCPU, 2 GB RAM, 40 GB NVMe, 2 TB traffic |
| Price | $5.25 a month on 12 months, $10.50 on 1 month |
| Package | `tor`, from Debian or Ubuntu, or from the Tor Project repository |
| Config file | `/etc/tor/torrc` |
| ORPort | 443 in the Tor Project example; another port is allowed |
| Relay type | Middle (guard) relay with `ExitRelay 0` |
| Restart command | `systemctl restart tor@default` |

*Prices checked on November 10, 2026.*

Config keys from the Tor Project relay guide and the Tor manual.

## What does a Tor relay do, and which kind should I run?

A Tor relay forwards encrypted traffic from one Tor node to the next, so no single node sees both who connects and where to. The Tor Project's relay guide for Debian and Ubuntu sets up a middle (guard) relay, and its sample configuration disables the other kind with `ExitRelay 0`. A bridge is a relay that is not listed publicly; the Tor manual says `BridgeRelay 1` publishes its descriptor to the bridge database instead of the public directory.

This guide covers the middle relay. On Gloamport, Tor relays may run on any plan, exit relays included, and so may bridges and onion services. The rules for all of this are laid out in [How does Gloamport work?](https://gloamport.com/how-it-works/ "How does a Gloamport VPS order work, and what rules apply?").

## Which Gloamport plan runs a Tor relay?

Dusk is the plan Gloamport pairs with a Tor relay: its description reads "A VPN plus a Tor relay or an onion site". It has 1 vCPU, 2 GB of RAM and 2 TB of monthly traffic, and the traffic of a plan counts outgoing data only.

According to Gloamport's survey of 10 November 2026, the median monthly price of a 1 vCPU, 2 GB VPS across 32 hosts was $18.91. A relay uses bandwidth steadily, so cap it with the `RelayBandwidthRate` option if you want to stay under the monthly traffic of your plan.

## How do I run a Tor relay on a VPS, step by step?

Five steps from a fresh server to a running middle relay.

1. **Keep the system updated** — Install security updates on time, ideally automatically. The Tor Project asks relay operators to do this first.
2. **Install tor** — Run apt update and apt install tor. The Tor Project recommends its own repository for newer versions; its support site has the steps.
3. **Write the torrc** — Set a Nickname, a ContactInfo address, an ORPort, ExitRelay 0 and SocksPort 0. The ContactInfo line is published.
4. **Restart tor** — Run systemctl restart tor@default, then read the log for a message that the ORPort is reachable.
5. **Open the ORPort** — Allow the TCP port you chose in the firewall you run on the VPS.

## How do I install tor and write the torrc?

Install the package, then replace the contents of `/etc/tor/torrc` with the five lines below. `ExitRelay 0` blocks all exit traffic, and `SocksPort 0` stops the relay from also offering a local proxy. Change the nickname and use an address you read in public, because the Tor Project warns that ContactInfo "will be published".

*Install and edit*

```bash
apt update
apt install tor
nano /etc/tor/torrc
```

*/etc/tor/torrc*

```text
Nickname    myNiceRelay
ContactInfo your@e-mail
ORPort      443
ExitRelay   0
SocksPort   0
```

*Restart the relay*

```bash
systemctl restart tor@default
```

## How do I limit the bandwidth my relay uses?

Add `RelayBandwidthRate` and `RelayBandwidthBurst` to the torrc. The Tor manual defines `RelayBandwidthRate` as a token bucket that limits the average incoming and outgoing relayed traffic to the given rate, and the default of 0 means no separate limit. Pick a value in a unit the manual accepts, such as KBytes or MBits, that fits the monthly traffic of your plan.

*Example limit (adjust the numbers)*

```text
RelayBandwidthRate 2 MBits
RelayBandwidthBurst 4 MBits
```

> **A relay is not an onion site** A relay carries other people's traffic. An onion service publishes your own site inside Tor. They use different torrc keys and can run on the same VPS: see How do I host an onion site on a VPS?.

## How do I check that my Tor relay works?

Read the tor log and wait: a new relay takes time to appear in the public relay list, and its traffic grows slowly. Use `journalctl -u tor@default` to read the log; look for a line saying the ORPort is reachable from outside.

Keep the VPS itself tidy while the relay runs. [How do I harden SSH on a new VPS?](https://gloamport.com/guides/how-to-harden-ssh-on-a-vps/ "How do I harden SSH on a new VPS?") takes ten minutes and matters more than any Tor setting. Plans and terms are on [the pricing page](https://gloamport.com/pricing/ "How much does a Gloamport VPS cost?"): Dusk is $10.50 a month, or $5.25 a month on 12 months.

**In summary**

- Install `tor` with apt, then edit `/etc/tor/torrc`.
- The middle relay config is Nickname, ContactInfo, ORPort, `ExitRelay 0`, `SocksPort 0`.
- Restart with `systemctl restart tor@default`.
- ContactInfo is published, so use an address you do not mind showing.
- `RelayBandwidthRate` caps the average relayed traffic.
- Dusk (1 vCPU, 2 GB RAM, 40 GB NVMe, 2 TB traffic) costs $5.25 a month on 12 months.

## Running a Tor relay on a VPS: common questions

### Which port should the relay listen on?

The Tor Project example uses ORPort 443, and says you can pick a different port. Whatever you choose, allow it in your firewall.

### What does ExitRelay 0 do?

It makes the relay a middle relay. The Tor manual says it blocks all exit traffic and that the ExitPolicy is then ignored.

### What is a Tor bridge?

A bridge is a relay set with `BridgeRelay 1` that publishes to the bridge database rather than the public directory, so censored users can find it. The manual also warns not to add MyFamily lines in bridge mode.

### How much traffic will a relay use?

It depends on the bandwidth you give it. Set `RelayBandwidthRate` below what your plan's 2 TB monthly traffic allows.

### Can I run an onion service on the same VPS?

Yes. A relay and an onion service use different torrc keys, and Dusk is described as fitting "a VPN plus a Tor relay or an onion site".

## Sources

1. [Set up a Tor middle/guard relay on Debian/Ubuntu](https://community.torproject.org/relay/setup/guard/debian-ubuntu/) — The Tor Project (checked 2026-11-10)
2. [Tor manual (ExitRelay, BridgeRelay, RelayBandwidthRate)](https://2019.www.torproject.org/docs/tor-manual.html.en) — The Tor Project (checked 2026-11-10)

---

Gloamport: Gloamport is a VPS provider that sells Linux KVM servers with no KYC, ordered with an account number and paid in crypto, Monero first; it is operated by DomaineGoat LLC, a Panama-registered company. An order asks for a plan, a coin and, only if you want one, an email address: no name, no postal address, no phone and no identity document. On the 12-month term, each plan is priced at least 25% under a named comparable plan from a survey of 38 no-KYC crypto VPS hosts read on 10 November 2026.
