Port 443 not accessible using hostname and Port 80 also fails

AI-generated summary

User iam_best encountered persistent connection errors (ports 80 and 443) while attempting to self-host Discourse on a Raspberry Pi 5. After initially struggling with port conflicts involving RaspAP, they followed a guide for using Cloudflare Tunnels to bypass local port restrictions 1, 2. Although the Cloudflare dashboard showed the tunnel as healthy, the site remained inaccessible.

Community member Falco suggested verifying connectivity via curl and checking the app.yml configuration. iam_best shared their configuration, revealing that they had not commented out the standard port exposures and SSL templates as required by the Cloudflare guide 10. Upon correcting the app.yml by commenting out the conflicting ports and templates, the connection issue was largely resolved, though the site still displayed CSS issues and failed to enforce HTTPS 11. While NateDhaliwal speculated about potential ISP firewall restrictions or CSS problems, iam_best noted their router had limited firewall capabilities and no port restrictions other than 25 and 455. The discussion concluded with a question regarding whether Let’s Encrypt certificates are necessary when using Cloudflare Tunnels 15.

Hello, this is the first time I’m trying to self host Discourse. I followed the official GitHub Installation guide by running wget -qO- https://raw.githubusercontent.com/discourse/discourse_docker/main/install-discourse | sudo bash. Everything worked well until it came to connecting to the subdomain. After completing verification I keep getting the same errors “Port 443 of this computer does not appear to be accessible using hostname: [Discourse Subdomain] and Connection to [Discourse Subdomain] port 80) also fails”.

First the app.yml didn’t even exist so I checked online and fixed it. I changed the port to 81 and also changed 443 and tried again, same error as if I didn’t change the port at all.

I also checked if raspap might be causing issues and I saw it was using port 80. I changed it to 81 and still the same error.

What am I doing wrong? Is this because I’m using a Raspberry Pi 5? Am I supposed to open ports in my router settings? I’m lost and sorry if this is a noob question, that’s probably because I’m a noob at this.

Hmm… are you following:

Nope, but will definitely try this out because I’m sure this is going to fix the issue I’m currently having. Thank you :slight_smile:

I managed to fix the error port 80 but I still can’t figure out why 443 is still not working. I’m not sure if raspap might be still using it, but I don’t think I can change it.

After taking forever to figure out the cloudflare tunnel thing I finally managed to make it connect without any port 80 and 433 errors following this guide: Install Discourse on a residential internet with Cloudflare Tunnel

Then there was a 5 second countdown and it started doing it’s thing until it stopped. I thought maybe I’m done here so I visited the domain but it says it’s not responding. Localhost also doesn’t show anything at all. Am I starting it the wrong way? I didn’t change any configurations and even uninstalled and reinstalled everything with no luck. Rebuilding also just stops and doctor discourse says Discourse container app is running. So how do I access it on my local network to see if it’s even up on other devices?

Your can try to cURL the raspberry ip and see if it responds.

You can also check the tunnel health on the Cloudflare dashboard.

I’m getting curl: (7) Failed to connect to (IP here) port 80 after 0 ms: Could not connect to server

The cloudflare dashboard says it’s healthy.

What I forgot to mention is that I’m also hosting raspap which is a Hotspot for the Raspberry and it also hosts a web dashboard but I changed the port for it to 81.

So Discourse is supposed to be accessible from port 80 of your PI, but cURL can’t reach it from your other machine?

Can you share your app.yml file ?

I tried curl on the pi itself. I also can’t access the website on my phone but I can access the other site that I’m hosting from the Pi’s IP with port 81

Here’s my app.yml file:

templates:

  - templates/postgres.template.yml

  - templates/redis.template.yml

  - templates/web.template.yml

  - templates/web.ratelimited.template.yml

  - templates/web.ssl.template.yml

  - templates/web.letsencrypt.ssl.template.yml

expose:

  - 80:80

  - 443:443

params:

  db_default_text_search_config: pg_catalog.english

  db_shared_buffers: 4096MB

env:

  LC_ALL: en_US.UTF-8

  LANG: en_US.UTF-8

  LANGUAGE: en_US.UTF-8

  DISCOURSE_HOSTNAME: forum.iambest.net

  DISCOURSE_DEVELOPER_EMAILS: (private email)

  DISCOURSE_SKIP_EMAIL_SETUP: '1'

  UNICORN_WORKERS: 8

volumes:

  - volume:

      host: "/var/discourse/shared/standalone"

      guest: "/shared"

  - volume:

      host: "/var/discourse/shared/standalone/log/var-log"

      guest: "/var/log"

hooks:

  after_code:

    - exec:

        cd: "$home/plugins"

        cmd:

          - git clone https://github.com/discourse/docker_manager.git

run:

  - exec: echo "Beginning of custom commands"

  - exec: echo "End of custom commands"

You didn’t follow the guide at Install Discourse on a residential internet with Cloudflare Tunnel at all?

Like you didn’t comment out the ports and templates.

Oh yeah you’re right. That’s because while I was troubleshooting I removed it because I wasn’t sure if that was why it didn’t work before.

I also wasn’t sure if I was supposed to comment out the ports so I tried again without doing that and now it’s working… A little bit because this doesn’t look right

I disabled Rocket thing like the guide said as well. Issue happens on both domain and on localhost

Looks like a CSS problem, as well as a firewall problem? Do you have any firewall restrictions on your ISP?

Haven’t setup any firewall restrictions and haven’t touched the CSS either. The router I’m using is also very limited so I’m not able to change any firewall settings unfortunately.

Also, apparently there are no ports restricted except Port 25 and 455

Also looks like it’s not using HTTPS but HTTP instead for some reason. Like the guide said I did force HTTPS in the app.yml so not sure why I can’t access the site then using HTTPS

@Falco Does one need a LetsEncrypt cert when using Cloudflare Tunnels? Or is it automatic via Cloudflare?