Report this

What is the reason for this report?

Unable to access the URL after deploying Discourse

Posted on September 24, 2025

I want to confirm the operation process. First, connect to my server and complete the corresponding steps according to the discourse prompt. Then, if you cannot access the website, you need to download nginx or apache (download any one). I installed nginx according to this operation but an error occurred. What should I do next?

https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-20-04

root@discourse:~# sudo ufw allow ‘Nginx HTTP’

Rule added

Rule added (v6)

root@discourse:~# sudo ufw allow ‘Nginx HTTPS’

Rule added

Rule added (v6)

root@discourse:~# sudo ufw status

Status: active

To Action From


22/tcp LIMIT Anywhere

80/tcp ALLOW Anywhere

443 ALLOW Anywhere

Nginx HTTP ALLOW Anywhere

Nginx HTTPS ALLOW Anywhere

22/tcp (v6) LIMIT Anywhere (v6)

80/tcp (v6) ALLOW Anywhere (v6)

443 (v6) ALLOW Anywhere (v6)

Nginx HTTP (v6) ALLOW Anywhere (v6)

Nginx HTTPS (v6) ALLOW Anywhere (v6)

root@discourse:~# systemctl status nginx

× nginx.service - A high performance web server and a reverse proxy server

Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset:>

Active: failed (Result: exit-code) since Wed 2025-09-24 19:41:30 UTC; 2min>

Docs: man:nginx(8)

CPU: 13ms

lines 1-5/5 (END)



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hey,

Looking at your output, nginx is failing to start. This is a common issue when Discourse is already using ports 80 and 443, which nginx also needs. Here’s how to diagnose and fix this:

Step 1: Check what’s using the ports

sudo netstat -tlnp | grep ':80\|:443'

or

sudo ss -tlnp | grep ':80\|:443'

Step 2: Check nginx error logs

sudo journalctl -u nginx.service -l --no-pager

or

sudo tail -f /var/log/nginx/error.log

Step 3: Check if Discourse is running

sudo docker ps

Most likely solutions:

If Discourse is already running and using ports 80/443: You don’t actually need nginx! Discourse’s built-in reverse proxy handles this. Try accessing your site directly with your domain/IP.

If you still want to use nginx as a reverse proxy:

  1. Stop Discourse temporarily:
   cd /var/discourse
   sudo ./launcher stop app
  1. Start nginx:
   sudo systemctl start nginx
   sudo systemctl status nginx
  1. Configure nginx to proxy to Discourse (running on a different port), then restart Discourse.

Quick test - try accessing your site: Before making changes, try visiting your domain in a browser. If Discourse installed correctly, it might already be working without nginx.

What do you see when you run the diagnostic commands above? This will help determine the exact issue.

If you’re unable to access the Discourse URL after deployment, check the following:

  1. DNS – Make sure your domain points to the server IP.

  2. Firewall – Open ports 80 and 443.

  3. Docker – Ensure the Discourse container is running.

  4. SSL – Check for Let’s Encrypt or SSL issues.

  5. app.yml – Verify the correct hostname is set.

  6. Resources – Ensure the server has enough RAM and disk.

  7. Logs – Run ./launcher logs app for error details.

Rebuild with:

cd /var/discourse
sudo ./launcher rebuild app

Heya, @dashan

There’s a misconfiguration or a port conflict.

You can run:

sudo journalctl -xeu nginx

That will show the error message that caused nginx to fail. Often it’s something like “bind() to 0.0.0.0:80 failed” if another process is already using port 80.

Run:

sudo nginx -t

If there’s a typo or bad directive in /etc/nginx/nginx.conf or a site config in /etc/nginx/sites-enabled/, it will tell you.

Port 80 (HTTP) or 443 (HTTPS) might already be in use by Apache, another nginx instance, or something like Discourse’s built-in web server. Check with:

sudo lsof -i :80
sudo lsof -i :443

If Apache is installed, you’ll need to stop and disable it before nginx can bind:

sudo systemctl stop apache2
sudo systemctl disable apache2

Once you resolve the conflict or config error:

sudo systemctl restart nginx
sudo systemctl status nginx

Hope that this helps!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.