Cloudflare, for reaching apps from outside

What you need

Time: 40 minutes, plus up to a day for the domain to move

  • A domain name your masjid owns.
  • The sign-in for wherever you bought the domain.
  • A free Cloudflare account.

You need this only if people outside the masjid must reach one of your apps. If everything you run is for use inside the building, skip this page.

Step 1 — Add your domain to Cloudflare

  1. Sign up at dash.cloudflare.com/sign-up.
  2. Click Add a site and enter your masjid's domain.
  3. Choose the Free plan.
  4. Cloudflare lists the DNS records it found. Check your existing website and email are in the list.
  5. Cloudflare gives you two nameservers. Copy both.
  6. Sign in where you bought the domain and replace its nameservers with those two.
Result:

Cloudflare says the domain is Pending, then Active. This usually takes under an hour and can take a day.

Step 2 — Create the tunnel

  1. In the Cloudflare dashboard, open Zero Trust.
  2. Go to Networks, then Tunnels.
  3. Click Create a tunnel, then choose Cloudflared.
  4. Name it openmasjid, then save.
Result:

An install screen appears, offering a command for several operating systems. The token is the long string inside that command.

Step 3 — Add one public hostname

  1. Open the tunnel's Public Hostnames tab.
  2. Click to add a public hostname.
  3. Set Subdomain and Domain so that together they are the address you want, such as give.yourmasjid.org.
  4. Leave Path empty.
  5. Set Type to HTTP.
  6. Set URL to localhost:80.
  7. Save.
Result:

Cloudflare creates the DNS record itself. You do not add it.

Step 4 — Give the token to OpenMasjidOS

The rest is in the dashboard. The remote access guide walks through it. You paste the hostname and the token into Settings, then Remote access (Cloudflare Tunnel), and then choose which apps are published.

Checkpoint

Cloudflare shows your domain as Active, the tunnel exists with one public hostname, and you have the token copied.

If something goes wrong

What you seeWhyWhat to do
The domain stays Pending for more than a day.The nameservers were not changed, or were changed at the wrong place.Sign in to your domain registrar and check the nameservers match the two Cloudflare gave you exactly.
The masjid stopped receiving email after the change.The mail records were not carried over.In Cloudflare DNS, add the MX records your old provider used. Ask your email provider for them.
Visitors see error 502 or a Cloudflare error page.Almost always Type set to HTTPS instead of HTTP.Edit the public hostname. Set Type to HTTP and URL to localhost:80.