# התקנת Discourse על אינטרנט ביתי באמצעות Cloudflare Tunnel

**URL:** https://meta.discourse.org/t/install-discourse-on-a-residential-internet-with-cloudflare-tunnel/211297
**Category:** Sysadmins
**Tags:** arm, how-to, raspberry-pi, install
**Created:** [7 בדצמבר,‏ 2021,‏ 2:02pm UTC](https://meta.discourse.org/t/install-discourse-on-a-residential-internet-with-cloudflare-tunnel/211297 "2021-12-07T14:02:07Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [7 בדצמבר,‏ 2021,‏ 2:02pm UTC](https://meta.discourse.org/t/install-discourse-on-a-residential-internet-with-cloudflare-tunnel/211297/1 "2021-12-07T14:02:07Z")

</div>

Since [Discourse now has support for running on a Raspberry Pi](https://blog.discourse.org/2021/12/2021-12-07-discourse-on-a-raspberry-pi/), running a small instance in your home lab will become a common use case. However, many residential ISPs block incoming traffic to the ports 80/443 that Discourse need.

For our demo site at [https://discourse-on-a-pi.falco.dev/](https://discourse-on-a-pi.falco.dev/) we used [Cloudflare Tunnel](https://blog.cloudflare.com/tunnel-for-everyone/) to work around this, and you can do it too!

### Setup your tunnel

First, follow the following guide:

> **[Cloudflare Tunnel](https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/)**
>
> How Cloudflare Tunnel works in Zero Trust networking.

The only change you need is changing the URL from `url: http://localhost:8000` to `url: http://localhost:80`. Leave the tunnel running the background already.

### Disable Rocket Loader

You must disable Cloudfalre Rocket Loader for Discourse to work properly.

[https://community.cloudflare.com/t/how-can-i-remove-the-rocket-loader-script-from-the-header-tag-on-my-website/4229/2](https://community.cloudflare.com/t/how-can-i-remove-the-rocket-loader-script-from-the-header-tag-on-my-website/4229/2)

### Install Discourse

Follow [How to install Discourse in production](https://meta.discourse.org/t/how-to-install-discourse-in-production/142537), but hit CTRL+C after it creates the the app.yml file gives you a 5 seconds count-down.

Now edit the file first few lines so it looks like this:

```yaml
templates:
  - "templates/postgres.template.yml"
  - "templates/redis.template.yml"
  - "templates/web.template.yml"
  - "templates/cloudflare.template.yml"
# - "templates/web.ratelimited.template.yml"
## Uncomment these two lines if you wish to add Lets Encrypt (https)
# - "templates/web.ssl.template.yml"
# - "templates/web.letsencrypt.ssl.template.yml"

```

and add the following line under the `env:` section:

```yaml
DISCOURSE_FORCE_HTTPS: true

```

And then run `./launcher rebuild app`.

While you are waiting, install a page rule to always redirect to HTTPS like this:

 ![image](https://global.discourse-cdn.com/meta/original/4X/f/0/1/f01367ac5b19d9db3c7fa69de2afaa7c6d4638c3.png)

In a few minutes your new Discourse instance will be available on the domain you used in the tunnel/discourse configuration 🎉.

---

_[View the full topic](https://meta.discourse.org/t/install-discourse-on-a-residential-internet-with-cloudflare-tunnel/211297)._
