No KYC · email optional · pay in Monero, Bitcoin or USDT
Language: English
Deploy a VPS

Guide · checked 2026-11-10

How do I run a Tor relay on a VPS?

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

Last updated: · 5 min read

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?

ItemValue in this guide
PlanDusk: 1 vCPU, 2 GB RAM, 40 GB NVMe, 2 TB traffic
Price$5.25 a month on 12 months, $10.50 on 1 month
Packagetor, from Debian or Ubuntu, or from the Tor Project repository
Config file/etc/tor/torrc
ORPort443 in the Tor Project example; another port is allowed
Relay typeMiddle (guard) relay with ExitRelay 0
Restart commandsystemctl restart tor@default

Prices checked on

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?.

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
apt update
apt install tor
nano /etc/tor/torrc
/etc/tor/torrc
Nickname    myNiceRelay
ContactInfo your@e-mail
ORPort      443
ExitRelay   0
SocksPort   0
Restart the relay
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)
RelayBandwidthRate 2 MBits
RelayBandwidthBurst 4 MBits

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? takes ten minutes and matters more than any Tor setting. Plans and terms are on the pricing page: 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 (2)
  1. Set up a Tor middle/guard relay on Debian/Ubuntu community.torproject.org/relay/setup/guard/debian-ubuntu — The Tor Project (checked 2026-11-10)
  2. Tor manual (ExitRelay, BridgeRelay, RelayBandwidthRate) 2019.www.torproject.org/docs/tor-manual.html.en — The Tor Project (checked 2026-11-10)

From $3.74/month · no KYC

Deploy a VPS