# Hoe maak je een mirror in Tor met een .onion domein?

**URL:** https://meta.discourse.org/t/how-to-create-mirror-in-tor-with-onion-domain/220292
**Category:** Self-hosting
**Created:** [7 maart 2022 om 14:51 UTC](https://meta.discourse.org/t/how-to-create-mirror-in-tor-with-onion-domain/220292 "2022-03-07T14:51:15Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![GreenOWL](https://avatars.discourse-cdn.com/v4/letter/g/a9a28c/32.png) [@GreenOWL](https://meta.discourse.org/u/GreenOWL)
#### Post date: [7 maart 2022 om 14:51 UTC](https://meta.discourse.org/t/how-to-create-mirror-in-tor-with-onion-domain/220292/1 "2022-03-07T14:51:15Z")

</div>

Hello! I’m using a standard installation of Docker Discourse on Ubuntu and want to setup a forum mirror in .onion Tor network.

I have installed Tor on server and now I have myonionsite.onion address.

```plaintext
#install
apt install -y tor

#uncomment in /etc/tor/torrc
HiddenServiceDir /var/lib/tor/myonionsite/
HiddenServicePort 80 127.0.0.1:8080
HiddenServiceVersion 3

#restart
systemctl restart tor
systemctl enable tor

cat /var/lib/tor/myonionsite/hostname

```

But this address show default nginx page, not my community.

Need help 🥺 🙏

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [7 maart 2022 om 14:55 UTC](https://meta.discourse.org/t/how-to-create-mirror-in-tor-with-onion-domain/220292/2 "2022-03-07T14:55:03Z")

</div>

There is a TOR template for discourse:

> <https://github.com/discourse/discourse_docker/blob/main/templates/web.onion.template.yml>

It was last updated 6 years ago so I’m not sure if it’d still work but if it still works, this should get you going. Read the template to understand how it works.

You’ll need to include the template in your app.yml and define `DISCOURSE_ONION` link (which is your .onion address.

Further discussion: [Template for serving through an .onion address with Docker](https://meta.discourse.org/t/template-for-serving-through-an-onion-address-with-docker/41536)

---

<div class="post-metadata">

### Author: ![GreenOWL](https://avatars.discourse-cdn.com/v4/letter/g/a9a28c/32.png) [@GreenOWL](https://meta.discourse.org/u/GreenOWL)
#### Post date: [7 maart 2022 om 20:09 UTC](https://meta.discourse.org/t/how-to-create-mirror-in-tor-with-onion-domain/220292/3 "2022-03-07T20:09:59Z")

</div>

Doesn’t work or am I doing something wrong…

My steps:

1. `apt install tor`

2. edit file `/etc/tor/torrc`

```plaintext
HiddenServiceDir /var/lib/tor/hidden_service/
HiddenServicePort 80 127.0.0.1:8080
HiddenServiceVersion 3

```

1. restart

```plaintext
systemctl restart tor
systemctl enable tor

```

1. check my onion domain

```plaintext
cat /var/lib/tor/hidden_service/hostname

```

1. go to `cd /var/discourse/` and edit `app.yml`  
add templates `web.onion.template.yml`  
add `DISCOURSE_ONION` look like:

```plaintext
DISCOURSE_HOSTNAME example.com
DISCOURSE_ONION example.onion

```

1. `./launcher rebuild app`

After these settings, the forum is not available in clearnet and in Tor. Maybe I need change post? 😔

---

<div class="post-metadata">

### Author: ![GreenOWL](https://avatars.discourse-cdn.com/v4/letter/g/a9a28c/32.png) [@GreenOWL](https://meta.discourse.org/u/GreenOWL)
#### Post date: [8 maart 2022 om 08:52 UTC](https://meta.discourse.org/t/how-to-create-mirror-in-tor-with-onion-domain/220292/4 "2022-03-08T08:52:53Z")

</div>

Maybe I need install new nginx? 1. `apt install nginx tor`

---

<div class="post-metadata">

### Author: ![f1r4s](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/f1r4s/32/245347_2.png) [@f1r4s](https://meta.discourse.org/u/f1r4s)
#### Post date: [10 januari 2023 om 10:19 UTC](https://meta.discourse.org/t/how-to-create-mirror-in-tor-with-onion-domain/220292/5 "2023-01-10T10:19:41Z")

</div>

> [@itsbhanusharma](#):
>
> `DISCOURSE_ONION`

Hi mate, did you find solution to setting up TOR correctly ?

---

<div class="post-metadata">

### Author: ![rhatto](https://avatars.discourse-cdn.com/v4/letter/r/13edae/32.png) [@rhatto](https://meta.discourse.org/u/rhatto)
#### Post date: [24 januari 2023 om 20:56 UTC](https://meta.discourse.org/t/how-to-create-mirror-in-tor-with-onion-domain/220292/6 "2023-01-24T20:56:37Z")

</div>

The `web.onion.template.yml` needs some updates in order to work.

Please try [this patch](https://github.com/discourse/discourse_docker/pull/670/files).

Besides that, you probably also need to point `HiddenServicePort` to `80 127.0.0.1:80` instead of `80 127.0.0.1:8080`.

---

<div class="post-metadata">

### Author: ![satonotdead](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/satonotdead/32/447830_2.png) [@satonotdead](https://meta.discourse.org/u/satonotdead)
#### Post date: [5 oktober 2023 om 18:04 UTC](https://meta.discourse.org/t/how-to-create-mirror-in-tor-with-onion-domain/220292/7 "2023-10-05T18:04:21Z")

</div>

> [@rhatto](#):
>
> Besides that, you probably also need to point `HiddenServicePort` to `80 127.0.0.1:80` instead of `80 127.0.0.1:8080`.

How we can do it if we are not exposing Discourse directly because using aproxy like Nginx?

---

<div class="post-metadata">

### Author: ![satonotdead](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/satonotdead/32/447830_2.png) [@satonotdead](https://meta.discourse.org/u/satonotdead)
#### Post date: [22 mei 2024 om 15:14 UTC](https://meta.discourse.org/t/how-to-create-mirror-in-tor-with-onion-domain/220292/8 "2024-05-22T15:14:59Z")

</div>

Using the container IP should work? (:

---

<div class="post-metadata">

### Author: ![meglio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/meglio/32/71444_2.png) [@meglio](https://meta.discourse.org/u/meglio)
#### Post date: [29 juni 2025 om 23:41 UTC](https://meta.discourse.org/t/how-to-create-mirror-in-tor-with-onion-domain/220292/9 "2025-06-29T23:41:30Z")

</div>

Kan Discourse theoretisch dezelfde instantie onder twee domeinen bedienen (.com en .onion)?

Kan het bijvoorbeeld links genereren, afhankelijk van het domein waarvan het wordt benaderd. Wat zou de “primaire” domeinnaam zijn (bijv. voor links in e-mails). Enz.
