Self-Hosted Streaming Server – NGINX + RTMP – YouTube + Facebook Live

I’m writing these notes up, mainly as a reference for me in the future – but they might just help others looking to do similar.

Issue:

During the Coronavirus season, our church, like many, ventured into the world of streaming services, primarily to YouTube but with an eye to mulit-plexing to both YouTube and Facebook at the same time.

Initially, the plan was to stream from OBS Studio to an intermediate platform, restream.io

We tested with OBS sending the stream to restream and for the first week, everything worked fine.Then, the second week about 10 minutes before due to go live restream.io suffered an outage. Fortunately, we were quickly able to flip to sending our stream directly to YouTube and our broadcast worked successfully.However, for me, an issue with a shared service leaves a sour taste and so began the journey to discover what would be involved in running our own RTMP server.

It turns out the solution has been relatively straight forward….

Our solution:

Firstly, we signed up for a new VPS with vultr.comWe opted for a 1 x vCPU, 2GB RAM, High Frequency machine with 64GB SSD storage, and 2TB monthly bandwidth. Research suggested that RTMP streaming/multiplexing is not particularly CPU/RAM intensive and is more about bandwidth consumption.

Once the VPS was provisioned, we selected the Ubuntu 18.04 LTS install image. The machine was duly created and connected via SSH to it’s IP shown in the portal.

Share this:

Thanks for the simple, and step-by-step instructions, you wont believe the crap I’ve gone through trying to set this up. I’m actually streaming to Youtube, Facebook, and a JWPlayer embedded on our website. My issues were with custom build Nginx and RTMP modules. If anyone is reading and having all kinds of issues, Install as noted here, this is the mainline build, and you’ll be good as gold. Thanks, you are a God send.