502 Bad Gateway on Owncast instance

I am trying to set up an Owncast instance (using Caddy reverse proxy for SSL and Cloudflare for DNS, though I’m not entirely sure that’s relevant) and I keep getting a 502 Bad Gateway error when I try to actually access my website. Even connecting directly to the server IP does not work. Does anyone here have any advice on how to fix this?

Submit an answer

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!

Sign In or Sign Up to Answer

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.

Site Moderator
Site Moderator badge
October 23, 2023


On top of what’s already been mentioned I would like to add that Owncast is already available as one-click application in our Marketplace which is ready to use:

Hope that this helps!

Site Moderator
Site Moderator badge
October 23, 2023


A “502 Bad Gateway” error typically indicates that the web server (in your case, Caddy) is unable to communicate with the application server (Owncast) behind the reverse proxy. To diagnose and resolve this issue, you can follow these troubleshooting steps:

Check Owncast Status: First, ensure that Owncast is running and listening on the correct port. You can check Owncast’s status and logs for any error messages that might help you pinpoint the issue. Common commands to check Owncast’s status include:

systemctl status owncast

Check Caddy Logs: Check Caddy’s logs for any error messages related to proxying requests to Owncast. You can use the following command to view the Caddy logs:

journalctl -u caddy.service -n 50  # Shows the last 50 lines of Caddy logs

The logs should provide a more exact error which you can then troubleshoot.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel