• 8 months ago
Looking for a self-hosted Twitch alternative with live video streaming and chat room functionality? Join me for a look at Owncast, a turn-key solution with fediverse authentication options.

Follow along with the commands from this video here: https://nerdonthestreet.com/wiki?find=Install+an+Owncast+Streaming+Server

Get Owncast here: https://owncast.online

Need a server? Get one at https://digitalocean.nots.co or https://linode.nots.co. Need a domain name? Register one at https://hover.nots.co. When you use these affiliate links, NOTS gets on-platform credit, and you get discounts.
---
Join the Nerd Club: http://nerdclub.nots.co
Official website: https://nerdonthestreet.com
Discord server: https://discord.nots.co
Subreddit: https://reddit.com/r/nerdonthestreet
Facebook page: https://facebook.com/NerdOnTheStreet
Twitter feed: https://twitter.com/NOTS_Network
E-Mail: jacob@nerdonthestreet.com
Transcript
00:00 Hello everyone, I'm Jacob Kaufman, I'm the Nerd on the Street, and today we're taking a look at Owncast.
00:04 All right everyone, in the past I've done videos about how to live stream to your website without
00:16 going through any of the major live streaming platforms like Twitch or YouTube or I guess
00:21 Kik these days. I made a video about setting up an HLS streaming server with Nginx, and that's
00:26 still the system that I use at nerdonthestreet.com when I live stream. In the past I've also had
00:31 experience setting up live stream chat rooms from scratch. I've done that with IRC, and I never did
00:37 a complete start to finish video about that one, but I did talk about it in some of the other tech
00:41 videos I've made in the past as well. So it's definitely possible to stream to your own website,
00:46 but it's not super easy to set up using the technology that I've shown before. Nginx isn't
00:50 that bad to set up, but especially on the chat side of things, you know, IRC servers are not
00:55 super simple to set up, especially if you want to have moderation capabilities. And then you have to
00:59 deal with finding a web client to embed into your website, and it's just a very large project if you
01:05 actually want to build your own streaming website from scratch, from the bottom up. Owncast is a
01:10 dedicated application that you can host on your server that's basically going to give you a turn
01:15 key solution for live streaming to your own website through your own server. So it's got
01:20 basically all the advantages of the stuff I've shown in the past, the HLS setup, the self-hosted
01:25 chat, you're on your own platform, but it takes care of a lot of the software setup and configuration
01:30 to actually get that running. And the best part is it's still free and open source software too.
01:34 Now the Owncast developers actually reached out to me a couple of years ago. It was really bad
01:39 timing. They reached out to me in early 2022, I think it was April 2022, and it was right before
01:45 I decided to take my six-month sabbatical that year to finish my master's degree. And then after
01:51 that sabbatical, I never really returned my content to the same schedule so far as what I used to
01:56 make. So it kind of slipped into the wayside, even though back then I thought it was a cool project
02:00 when I saw it. Fast forward to now, I wanted to get a tech video out this weekend, but I don't
02:04 have a ton of time. I pulled up my list of possible tech videos and I saw it in there,
02:08 and I was like, "Oh yeah, wasn't that supposed to make live streaming setup a whole lot faster?
02:12 That'll probably be a pretty quick video to make." And I ran through the setup and it is indeed
02:16 pretty quick. So if you're wanting to stream to your own website, feel free to follow along.
02:20 I'm going to put a link in the description of this video with all the commands that I'm running,
02:23 so you can copy and paste them straight from there. And you'll also want to check out the
02:26 official documentation for customization and more in-depth coverage of all the features that
02:31 this software has. But for now, we're going to set it up. So let's go ahead and cut to the desktop.
02:34 All right, and here we are on the desktop. So like I said, this is the webpage that's going to have
02:38 all the commands I'm about to run. I'll put the link to that in the description. Also, if you need
02:42 any additional documentation, you can go to owncast.online, that is Owncast's official website.
02:47 Now, the first place I'm going to go here is DigitalOcean, and I'm going to spin up a server
02:51 for us to do this on. You obviously just want your server to have good network connectivity
02:55 for something like streaming. I'm going to use a Debian server. I'm going to use Debian 12,
02:59 that's the latest version. And this really doesn't have to be super powerful. I'm just going to go
03:03 with their $6 a month plan. That's going to give us one gigabyte of RAM, 25 gigs of disk space,
03:08 and only a single CPU core. We're not going to do anything too crazy in terms of transcoding here.
03:12 I'm just showing you the basic setup. You may want a more powerful server if you're going to
03:16 be doing things like offering multiple resolutions when you get into actually configuring Owncast.
03:21 I'll select my SSH key there. If you don't have one, you can just use a password.
03:24 And for the hostname here, I'm going to make this owncast-server. And we'll just create that. If you
03:30 don't have your own server, you can go to digitalocean.knots.co or linode.knots.co,
03:34 get a few bucks off of one for a couple months. And as soon as we have an IP address here,
03:38 I'm going to copy that, and I'm going to head over to my DNS configuration panel.
03:42 Now, technically, Owncast does not need a domain name to run. If you want to run it on HTTP with
03:47 just an IP address, you can do that. However, if you want to use SSL/TLS with Let's Encrypt,
03:51 like I'm going to show you here, you will need a domain name for that. So I'm just going to
03:55 create a new subdomain. We're going to use example.nernethestreet.com. I'll paste my IP
04:00 address in there. And I'll save that. We'll go ahead and connect to the server with the IP address,
04:04 but that way the DNS record will be propagated later when we need it.
04:07 So now I'm going to bring a terminal up here, and I'm going to SSH into our new server root at
04:12 that IP address. All right. And the first thing I'm going to do is just a quick apt update. I'm
04:17 going to do an apt full upgrade. I like to make sure my servers are fully up to date before I
04:20 even start. As you can see, there's 60 packages upgradeable here, and we don't want to be trying
04:25 to do this tutorial on an outdated server where we might have bugs or security issues. So we'll
04:29 just go ahead and install all of those. I'll just hit enter here on this prompt.
04:36 All right. And once that's done running, you could see we had a kernel update. We also had
04:40 a Dbus update here. So we are going to want to just reboot the server with a systemctl reboot.
04:44 By the way, I am logged into the server as root. Obviously, if you're doing this on a different
04:49 user, you'll just want to put in sudo for the majority of these commands, since we are installing
04:53 packages, editing system-wide configuration files, and that kind of stuff. All right. So I've given
04:58 it a few moments. I'll go ahead and SSH back in here. There we go. And now we can actually start
05:03 the setup for owncast itself. This is where you'll be jumping off from if you actually had a fully
05:07 up-to-date server before beginning. So I am going to apt install a few new packages. And this is
05:12 everything you need on a Debian 12 installation that's not installed by default to get this
05:17 running, at least from the DigitalOcean image. We're going to install unzip. We're going to use
05:21 that to unzip owncast when we download it here. We're going to install ffmpeg, and that is a
05:26 requirement for owncast to do its video processing stuff. We'll install Apache 2. That's going to be
05:31 used not as the primary web server for this, because owncast actually serves itself, but this
05:36 will be used as a proxy server. We're going to use certbot that we use to get TLS for the website.
05:41 And then since we're using Apache, I'll also put in python3 certbot apache to make that a little
05:46 bit easier. Since we're just using Apache as a reverse proxy, you can absolutely do this with
05:52 nginx if you want to. If you're choosing to use that instead of Apache, I assume you know how to
05:56 set up a reverse proxy with it. But if you don't know anything, if you need it from scratch, just
06:00 use Apache like I'm doing right here. All right, and that's complete. So like I mentioned, owncast
06:05 is not a normal web application that we're going to serve using Apache. A lot of the tutorials I
06:11 do on this channel, we put things in the Apache directories under /var/www.html, but that is not
06:17 what we're going to do for owncast, because owncast actually includes its own web server,
06:20 and that's what it's going to use to actually serve the files and the web pages as well as
06:24 the video that you're streaming. So owncast is actually going to be a separate application from
06:28 Apache that we're running on this system. And it is not in the Debian repositories. Even if it was,
06:33 it would probably be a little bit out of date, but it's not in there at all. And there is no PPA
06:37 or Debian repository that I'm aware of for this application. They actually do have operating
06:42 system packages for Arch Linux, FreeBSD, and NixOS, but not for any Debian or Red Hat based
06:48 distros out there. So we are going to download the application onto the server kind of manually.
06:53 First, we need to make a directory where we're going to keep it. I'm going to make that in
06:57 opt, and I'm going to call it owncast. The /opt directory is a default directory on a lot of
07:03 Linux distributions. Now, opt is not technically part of the Linux file system hierarchy standard,
07:08 even though it is in a lot of distros. It's in there mainly for historical reasons. As you can
07:12 see, if I do an ls -alh on /opt, there's not really anything else in there other than DigitalOcean is
07:18 using it, it looks like, to keep some of their cloud hosting tools on here. This is basically
07:22 a directory that's not going to be managed by apt. It's not managed by the package manager,
07:26 and for that reason, I like to put extra applications that I'm installing out of tree
07:30 here in /opt, just to keep them organized and out of the way of the rest of the system. If you have
07:34 another directory you want to do this in, you can absolutely put this wherever you want, it really
07:38 doesn't matter. But I'm going to cd into /opt/owncast that I just created, that's where we're going to
07:44 install it here. Next, we're going to download owncast. So I'm going to do that with wgit,
07:48 which should be installed by default. If you get a command not found for wgit, you can just apt
07:52 install wgit. And we need to grab the link for the latest owncast release. So you can find that by
07:58 going to github.com/owncast/owncast/releases/latest. I'll have this linked in my guide, I'm going to
08:07 hit enter here, that will redirect you to the latest release of owncast on GitHub. If you want
08:11 to find that without going through my guide on owncast's official website, you can click get
08:15 started. I want to manually install owncast myself, I want to download a release of owncast,
08:20 and if you click on that, they'll send you over to their manual install page, where they link you to
08:24 the releases section of their GitHub, which is the exact same thing, the latest release will be there
08:29 at the top. So once you're on this latest release page, you can just scroll down to the bottom there
08:33 and we're going to find the Linux-64bit zip file. Right click on that, click copy link address.
08:39 And then back here in our terminal, I'll just right click and paste that in. And we'll hit enter
08:43 and download that zip file. So if I do an ls alh, you can see that's right there. Next, we need to
08:48 unzip it. That is why we downloaded unzip earlier, I'll run unzip on owncast. You can just type the
08:53 first few letters and press tab to auto complete it. As you can see, it only inflated one file,
08:58 that is the executable application owncast. So this is just a binary. Once again, this is an
09:03 open source application, we downloaded it from GitHub. And if you go back up to the root repository
09:08 here, the source code that you're running is absolutely open source. So you're not running
09:12 blindly an executable that you don't know what it does. This is, you know, a semi trusted thing.
09:17 So we've got that executable there, I'm going to go ahead and remove the owncast zip file here,
09:21 just because we don't need it anymore. And in the future, whenever you want to update owncast,
09:26 all you're going to do is just come right in here and repeat that process, download the zip file,
09:30 extract it, it should overwrite this owncast file, and then you'll want to restart the service that
09:35 we're about to set up. So at this point, we could actually run owncast just by typing in
09:39 ./owncast. And that would start owncast here. Of course, it would be tied to our terminal. So
09:44 once I xed out of this terminal, it would stop running. That's not what we want. We want to run
09:47 it as a background service on the system. We also want to do that so we can have it start up
09:51 automatically when we boot. And we're going to do that with a systemd service, we're going to set it
09:55 up by hand right now. And it's super easy, we're just going to type in nano etsy systemd system,
10:02 and we're going to name the file owncast.service. So you're going to have to type in this trailing
10:06 slash and then type in owncast.service. It will not auto complete because we're creating it from
10:11 scratch. If you want to use a different text editor like V or something, you're welcome to,
10:15 I'm going to use nano. And this systemd service file, I'm going to paste this in here. This is
10:20 in my guide, but I based it off of the official owncast documentation. They've got a couple
10:24 different options for systemd service files you can use. We're just telling systemd here that
10:28 this is a unit, the description is owncast streaming server, you can type in whatever
10:31 you want for the description. This is a service, the type is simple, which means it's just a plain
10:36 old executable, we want systemd to start it and stop it for us when we tell it to. The working
10:40 directory, we want to specify opt owncast or wherever you just extracted the owncast binary
10:45 before. The exec start line, this is just the path right to that owncast file. So opt owncast
10:51 owncast for us. We want to restart this on failure so that if it crashes, systemd will restart it. We
10:56 want to give it a five second delay just so it's not spamming the system trying to restart if
11:00 there's actually something wrong. In the install section here, wanted by, we're going to put
11:04 multiuser.target just to make sure that when we configure it to start up on boot, it's going to
11:08 wait until all the prerequisite stuff like networking and everything else that might need
11:12 is ready to go before it tries to run. So we're going to go ahead, I'll hit Ctrl X, Y and Enter
11:17 to save that. Now after you create a new systemd unit, or after you edit an existing unit, we need
11:23 to tell systemd that we updated its configuration with systemctl daemon reload. So I'll run that.
11:29 And now we should be able to run a systemctl enable --now owncast. So this enable command
11:36 is going to say start up owncast the service whenever we start the system up. So that's going
11:41 to start on boot. The --now is basically just going to also start it right now so I don't have
11:46 to reboot the system. If you don't run --now, you could instead do systemctl start owncast
11:51 to do it in two commands instead of one. But I'm going to run that. You can see it created
11:55 this symlink. That's going to ensure that it is started on boot. And now if I run a systemctl
12:00 status owncast.service, if I hit tab, it will autocomplete out there. You can see it is enabled.
12:06 That means it'll start on boot, but it is also active and running since 12 seconds ago when I
12:11 hit enter on that command. So we've got a couple of different log messages here, hitting the arrow
12:15 key to the right to scroll over. And as you can see, this seems to be working. Owncast is logging
12:21 and it says configure this server by visiting /admin. So this really wasn't too bad at all.
12:25 If I go back to a web browser here, if I just type in the IP address of our server, well, that's
12:32 going to be Apache on the default port 80. Now, if I type in colon 8080 at the end of that IP
12:38 address, that's going to be owncast. So owncast by default, as you can see, it was in the log
12:43 telling me right here, web server is listening on port 8080. Owncast is going to use a slightly
12:48 different port than default web server ports just because it knows it's not a full-fledged web
12:52 server and it doesn't want to conflict with Apache or Nginx or whatever you might be running already.
12:57 But yeah, this is owncast and it is already running. You could technically start using it
13:00 right now, although it is not secure yet since we haven't set up TLS. Now, like that thing said,
13:05 in the log, if we type in /admin at the end of that URL, we get this pop-up here.
13:10 The default username for owncast is admin. The default password is abc123. So enter those in
13:16 and you'll be here in the owncast admin page. Now, there's a reason I went to this page. I
13:20 wanted to show you, like I said, right now we're running on port 8080. And in a moment, we're
13:25 going to have Apache actually act as a reverse proxy so that people going to this server don't
13:30 have to type in port 8080 when they go to it. However, you might be running owncast on another
13:34 server that's also hosting other applications. If you're doing that, one of the other apps might
13:38 already be using port 8080. So I wanted to show you under configuration here, if you go to server
13:43 setup, you can actually change the owncast port to something else. I'm going to keep it at port 8080.
13:49 But for those of you who have more advanced configurations, I wanted to show you that
13:52 this is where you would change that. Do not change the admin password yet. We obviously want to
13:56 change that from the default. But we're going to set up TLS first so that you're not sending your
14:01 new password unencrypted over the internet. The ports the only thing that you should really be
14:05 changing right now. So once you've got that all set, like I said, I'm just going to keep it at
14:08 port 8080. We're going to go back here to the terminal and we're going to set up that reverse
14:12 proxy with Apache now. So to do that, I'm going to nano into Etsy, Apache two sites available.
14:18 And I'm going to create a new virtual host configuration file called owncast.conf. I've
14:23 done a whole video just about virtual host configuration in Apache before. So you can go
14:28 and check that out if you want more information on what all of this configuration means. Once again,
14:32 you can copy and paste this straight from my guide. Now this is the HTTP virtual host that
14:37 I'm putting in here. I'm saying the server name that needs to be whatever you want your domain
14:41 name to be that you've got forwarded to this IP address. The server admin email address doesn't
14:45 really do anything. And then this is the default error and access log for Apache. You'll notice I'm
14:50 not putting in any sort of directory here because Apache is not going to serve any files itself.
14:56 Once again, we are only using Apache to proxy traffic, but we're not going to configure that
15:00 here. We're going to configure it after we set up TLS. So we're just going to save this super
15:04 simple skeleton virtual host. The only thing that's in here really is the domain name. I'll hit enter
15:10 and that is saved. I'm going to a2insite owncast to enable that. And then we'll do a systemctl
15:16 reload Apache two, and that's going to apply that configuration. Now we're going to run certbot
15:22 dash dash Apache. And this is going to use let's encrypt to set up a free TLS certificate to
15:26 secure this website. So we're going to put in your admin email address, and it will notify you when
15:31 your certificates about to expire just in case there's any configuration error on your server
15:35 in the future. We'll accept the terms of service. I'm not going to subscribe to the EFF email list
15:40 right now. And as you can see here, this is why we just set up that virtual host because it picked
15:44 that out of the configuration we just made example.nernethestreet.com is the domain name that
15:48 I'm using. Now if you already had Apache on this system, you probably already know how this goes,
15:52 but you can just type in the number of the domain name. Since it's the only one here, I don't even
15:57 need to type a number, I'm just going to hit enter and it'll do all the domain names by default,
16:01 which there's only that one there. As you can see, it's requesting a certificate. And if the DNS is
16:05 propagated, it should work. It looks like it did. All right, and certbot has been set up. So now if
16:10 I do an ls -alh on /etc/apache2/sites/enabled, you can see we not only have our owncast.conf that I
16:18 created and enabled earlier, we also have the new owncastlessl.conf. And that is a symlink to this
16:24 other file and sites available. So we're going to nano into that new file /etc/apache2/sites/available/
16:31 owncastlessl.conf. Since it's a symlink, you could use enabled or available in your directory there.
16:38 It'll get you the same file. And this is what this file looks like. I'm actually going to clean it up
16:42 a little bit here. Just going to indent all of these lines by four, just to make it look a little
16:47 nicer. And in this file, this is where we're going to set up our proxy configuration. So
16:52 the other file now, if I actually save this and go back to the regular one, just to show you,
16:58 it's going to rewrite any requests coming in and forward them on to HTTPS. So if somebody goes to
17:04 your website on HTTP, that's insecure, it's going to forward it on to the secure one. And then once
17:09 they're connected securely, that's when we're going to proxy the actual traffic here. Once again,
17:13 I'm going to copy and paste all of this because it is quite a bit. And I'm just going to go through
17:17 here real quick and clean it up. I'll try to get these spaces into the guide so it's there when you
17:23 copy and paste it. When I was preparing my notes for the video, it just didn't have those leading
17:27 spaces in there yet. Okay, and this stuff, all of this configuration, it also comes from the
17:33 own cast documentation largely, it's basically only the stuff you need in addition to what Apache
17:38 put there by default from the own cast documentation. So we're telling Apache that we want
17:43 to proxy all of the traffic from anywhere, we're going to proxy it forward, and we're going to
17:47 proxy it reverse so that the traffic can get back out when the own cast application responds.
17:52 We're setting our protocols here. And down here, we also want to forward websocket traffic own cast
17:58 does not just use HTTP traffic. It also uses websockets for real time communication, particularly
18:04 for the chat, I think is the main usage of that. But just paste all of that in. And we'll go ahead
18:08 and save that file. Now we need to enable a couple of modules for Apache before we restart Apache
18:13 here. We're going to run a two in mod proxy underscore HTTP proxy underscore WS tunnel,
18:20 that's the websockets, and then headers. Those are the three Apache modules that aren't already
18:25 enabled by default on Debian 12, we need to enable them. All right, and it's telling us to activate
18:30 the new configuration. Now, since we actually enabled modules, we can't just reload Apache,
18:34 we actually need to do a full restart of Apache two. Now, if you're using a different distro,
18:38 you may get another error here. And it might be Apache telling you that you need to enable
18:42 another module. So if that's the case, just run a two in mod again, once again, these are the ones
18:46 for Debian 12. Alright, and that's actually everything we need to do for the TLS setup.
18:51 So now I can come over here. And once again, before I had to type in colon 8080 at the end of
18:56 that IP address, now I'm just going to go to example dot nerd in the street.com, just going
19:00 to leave everything else the default, as you can see, we were automatically redirected to HTTPS.
19:05 So our TLS setup is working. And as you can see, the Apache reverse proxy is working because I got
19:11 the own cast server here, even though Apache is not hosting those files itself. So now I can go
19:15 to slash admin again, and I can type in admin and ABC 123. I am just going to go here to configuration
19:22 and server setup. If you don't do anything else in your server setup, you probably want to change
19:27 the admin password. So I'm just going to type in a new admin password there, I'll click update.
19:32 And as you can see, changing your password will log you out of the admin, you may want to refresh
19:36 the page to force yourself to log back in if not prompted. So when we hit update, it disconnected
19:41 us just hit refresh, log in one more time. And the new password worked. So I know that the password
19:47 change has succeeded there. And that's everything. That's everything you need to do. And we can
19:51 actually start streaming now. So streaming if I go to home here, it's got our streaming URL,
19:56 and I can open up an application such as OBS, I'm going to do that right now. Alright, so here we
19:59 have OBS Studio, I'm just gonna resize this a little bit here. As you can see, it's doing a
20:04 desktop capture, and it's got audacity getting my audio here, that's fine. So in your OBS settings,
20:09 we're going to come in here to our stream. And this is where you're going to put in the server
20:14 URL, you can see it's already in there from when I was testing before, but you can get your server
20:18 URL right here, it's going to build it by default based on what you're connected on that URL is not
20:24 part of owncast configuration yet, but it'll pick that out of how you're connected. And it'll say
20:28 RTMP colon slash slash your domain name colon, the default RTMP port is 1935 slash live is the
20:36 default ingest point here. So you can just paste that into your server area there. And then owncast
20:41 actually works with stream keys. Now my Nginx HLS setup I did a while ago, it didn't use stream keys,
20:47 it used the ingest point as the authentication. Nginx actually use the stream key to determine
20:53 what to call the m3u8 file. owncast is a little bit more intuitive here, it's using the stream
20:58 key as a stream key. Here you can see on the homepage of your admin, we've got our streaming
21:03 keys. If you click view there, it'll send you over to your server setup where we were before.
21:07 And you can just click on the stream keys tab. Now you can click the eyeball there to see the
21:12 default key. As you can see, it's ABC 123. We don't want to use that that's insecure. We can't
21:17 remove this until we add a second one. But we'll go ahead and add a second one, it's going to
21:21 generate a random key, you can call it whatever you want, I'm going to click Add. And then we'll
21:25 delete the default one. So that now all we have left is this more secure one. I'm going to click
21:30 copy there. And that'll copy it to my clipboard, just paste it in here, just make sure that's
21:34 correct. There we go. I'll hit apply. Okay, in OBS. And now I'm going to go back to the homepage
21:41 of the owncast server here. As you can see, it says the stream is offline, be notified the next
21:46 time the server goes live. Here in OBS, I'm going to click Start streaming, I actually I want to do
21:51 this side by side here, let me make this a little bit smaller, get our terminal out of the way.
21:56 And we'll disable studio mode in OBS here. So when I click Start streaming here,
22:01 I'm going to get rid of that extra text there that I still had an OBS from a previous stream.
22:07 But as you can see, it did connect, it is dropping some frames, because the internet that I've got
22:12 right now isn't great. It's actually dropping quite a lot of frames. So I'm going to go ahead,
22:17 once again, how much you can or can't stream what quality you can stream. And it is going to depend
22:21 on the bandwidth of your server and the bandwidth of your own network. Looks like I've got this
22:26 set to 2.5 megabits per second right now. Alright, I'm just going to drop that down to
22:30 two megabits per second 2000 kilobits per second. And let me try that again. So I'll hit Start
22:35 streaming. And this time, maybe our drop frames won't be quite so abysmal. Yeah, I dropped frames,
22:41 not dropping any frames now. So I was just streaming more than my internet connection
22:45 could handle. Once again, that's the same as streaming to Twitch or YouTube or anything,
22:48 you're going to be limited by your own internet connection from where you're streaming from.
22:52 But here on the server, you can see this popped up, I can click play. And this is actually a real
22:57 live stream. If somebody went to example.nernethestreet.com, while it was recording
23:01 this at 2.15am on a Monday, then they would see the stream, the audio should be working,
23:06 we're gonna, let's see, gonna go ahead and set my microphone up here. Okay, so I've got my audio
23:14 going into OBS now. And after a few seconds, that should come over to our own cast stream
23:22 microphone up here. Okay, so all right, my audio going into OBS now. Yeah, so I'm talking over it,
23:28 I'm gonna go ahead and mute that because that's going to be annoying for you guys to listen to.
23:31 But as you could hear there, my voice was coming through the stream too. So that's everything you
23:35 need to do to get a basic setup going. And there's also a chat room here. So I can type in this is my
23:41 chat. Yeah, now just to show you a little bit, I'm not going to get way too into the weeds here in
23:45 terms of how to actually use owncast. Because you guys can go through the owncast configuration,
23:49 once you've got the setup, you know, the configuration is pretty, pretty well laid
23:53 out where it's not that hard to figure out what things do. And you can also read owncast official
23:57 documentation. As you can see on the admin page here, the default admin page, it is going to give
24:02 us some info about our stream. It's a healthy stream right now. It's my bitrate and everything
24:05 is good to go. It's telling us the inbound video stream. As you can see here, it's 2000 kilobits
24:11 per second, the outbound video stream, it's actually transcoding it down to 1200 kilobits
24:16 per second. It's taken it down to 24 FPS to also lower the amount of bandwidth your viewers will
24:21 need to have. So that's interesting. Now if we go over here to chat and users, if you click on
24:26 messages, you can see past messages that have been sent. By default, everybody's just going to be
24:31 given random usernames. People can come in here when they're watching your stream, they can click
24:36 the drop down in the top right and they can click change name. And I can type in my username,
24:41 Jacob GKAU, for instance, and it will change my name. Right there. It looks like somebody else
24:48 may have joined the chat just now. So that's interesting. It might have been one of the other
24:51 tabs I still had open from last time I was testing this that just reconnected, because nobody should
24:56 know that the server is running right now. But as you can see, when people send chat messages,
25:00 they show up here. This is sort of your moderation panel. And it's very easy to ban people from your
25:05 chat. If somebody is sending spam or causing trouble, you can just check the message, you can
25:09 hide or show multiple messages from the chat. If you click on users, it will show you the people
25:13 who are connected. As you can see, I'm only listed as one person because it kept track of when I
25:17 changed my name. Whoever that other person was has left the chat at this point. And you can ban
25:22 people here. Now the sign up and moderation flow is the one thing that I think owncast isn't quite
25:29 up to par with Twitch or something like that, because there are no accounts per se, with owncast
25:35 when somebody goes here, it's going to use their IP address and probably also a combination of
25:39 that with cookies to try and match who they are. Now if I click ban on Jacob GKAU here, which is
25:44 me, I'm going to click that it's going to remove my chat messages that actually hid chat for me,
25:50 it says chat is offline, because I just banned the user in this window. As you can see, I show up now
25:56 under banned users and under IP bans. So by default, it's going to ban them cookie wise,
26:02 however, they were being identified, it's also going to IP ban them, because obviously, it's
26:06 super easy to just open an incognito window. If I open a private window here in brave and go to
26:11 that website, chat is still going to be well, actually, it's still let me connect there. No,
26:16 it didn't. When I try to send a message, it says chat is offline. So that IP banning does work.
26:21 Obviously, if I go ahead and unban my own IP address, which I'll probably want to
26:25 censor from this video. After I do that, if I refresh the main page here, I'm still identified
26:31 by probably a cookie that I'm the person who was chatting as Jacob GKAU before, so I'm still not
26:36 allowed to connect to chat. However, since I've removed the IP ban, I can come in here in a new
26:40 tab and I can actually send messages again in that new tab. So multiple different ways here
26:45 that owncast is keeping track of viewers. Just a quick anecdote. Personally, this this seems really
26:51 loose compared to actually having people have passwords and have to put an email addresses to
26:56 authenticate themselves with. However, like I said, I have actually set up completely from scratch
27:01 live streaming chat systems with IRC before, and we never got around to setting up a real
27:06 authentication system with that. We also had a system extremely similar to this where people
27:11 just showed up every week and they entered their own name before they connected. This is actually
27:16 better than what we had because they don't have to type their name in again every time they go here.
27:19 It saves it in a cookie. But if you're a small streamer and you've got a tight knit community,
27:25 what we found in the community that I set up that IRC server for was that the community,
27:30 we built the system for them. They understood we did it so that they could chat without having to
27:35 go through Twitch or mixer at the time or any of the big tech players like that. And they did not
27:41 abuse the system. They didn't impersonate each other. We didn't have any issues with that or
27:46 really even spamming because basically if people spammed too much in the stream chat, even though
27:50 it is possible to get around bans, sort of, although it does require changing your IP address,
27:55 which is a little bit of a pain for people to have to do. That community also had a Discord
28:00 server, for instance. And we had instances where the people on stream said, "Hey, if you don't
28:04 stop spamming, we're going to remove you from the Discord server. Then you can't hang out with us
28:08 between streams." And so they stopped. Obviously, if somebody was actually trying to cause trouble,
28:13 you'd just want to ban them. And getting a new IP address isn't always trivial, depending on your
28:18 ISP. The user might have to spoof a different MAC address or something to get their ISP to give them
28:22 a new IP address on demand. So yeah, there is a system in here where you can actually set people
28:27 up to be able to authenticate. If you go to the social section of your configuration, you can
28:31 actually specify your server URL, and that will let people authenticate from your server. You
28:36 don't necessarily want to do this, but they're kind of trying to integrate with the Fediverse,
28:42 which I am not full on in the Fediverse yet. You know, federated social networking and stuff.
28:47 What they're basically trying to do is hook in with that so that people can come in here to
28:51 your chat and they can authenticate. Now, since I just set the server URL, I can type that in here,
28:57 and then it's going to ask me... Well, it's not since I've already authenticated.
29:01 So that's using IndieAuth and then FedAuth. You know, if you've got an account on Mastodon or
29:07 something, for instance, if you've got an account on a Mastodon server, you may be able to put your
29:12 accounts in here and then authenticate through that. If you do that, then OwnCast will register
29:17 that your username is only allowed to be used by people who are authenticated with that Fediverse
29:22 account. So for example, I'm connected as jacobgkau right now using IndieAuth, which was
29:27 the server itself, which basically the server itself, you're only going to want to use that
29:31 for the account of the person who owns the server because it requires the admin password. If I go to
29:36 example.nernethestreet.com here, this is what it looks like. I'm going to try to change my name to
29:41 the same thing, jacobgkau, and it's going to tell me the name jacobgkau has been already registered,
29:48 which is incorrect grammar, but it says if this is your name, please authenticate. So I come up
29:52 here, I click authenticate. I'm using IndieAuth with my OwnCast server here, example.nernethestreet.com,
29:59 but other people with their own OwnCast servers could authenticate on your server this way.
30:03 It's going to ask me to sign in with the admin account. Once I do that, then it lets me use the
30:07 name jacobgkau. So it's not actually that complicated. Once again, if, if your viewers
30:13 are on Mastodon and things, and if that integration actually works, then that's one way they can do
30:17 this or each of your viewers would have to set up an OwnCast server. You probably don't want to have
30:21 them all have to do that with IndieAuth, but FedAuth or FedAuth here with the social network
30:26 thing, I understand what they're trying to do. And it's better than having absolutely no
30:30 authentication, which once again is how I actually helped another production stream run for many
30:35 months with no issues. But you can figure out, you know, what level of tolerance you want in terms of
30:41 moderation and all of that. Here under chat, I did just want to show you real quickly, you can
30:44 turn chat on or off altogether. You can set forbidden usernames that nobody can use. And you
30:49 can also, if you type in at least 10 different options here, it won't work if you just type in
30:54 one default username, but you can specify default usernames here. By default, it's just going to
30:59 make them with random words. But if you've got a themed stream and you want to create themed
31:04 default usernames, you can do that. It seems a little cumbersome to have to type in a different
31:08 default username for every single possible option. The system that we had in IRC, we were able to
31:14 have username dash and then a couple number signs, and then it just added a random number to the end.
31:20 I actually opened up an issue on OwnCast's GitHub page about that, feeling out if they'd be
31:25 interested in having that feature. It sounds like they would be open to somebody contributing it,
31:30 but they don't think that it's super useful and they're not going to code it themselves.
31:34 So if you want to have default usernames that are custom, you're going to have to type in every
31:38 single one individually here for now. But yeah, I wanted to show you, you can do that. I'm not
31:42 going to click through every single settings page here, because you can go and do that.
31:45 The one other thing I wanted to show you here is how to embed these things into other websites.
31:50 You can go here and you can customize what all of this says. This welcome to OwnCast,
31:54 this about section, that's going to be here under general, down at the bottom here. This is your
31:59 custom page content. If I save that, then I can go back here and refresh, and it's going to show up
32:05 right there. And according to the OwnCast documentation, you can actually go into your
32:11 OwnCast directory on your server. And inside of the data directory, you can create a directory
32:17 called public, make dir public. And then in there, you can put any images or anything else that you
32:22 might want to embed in the HTML in your about section here or anywhere else on this OwnCast
32:28 site. But what if you already have another website, you've done all of the hard work,
32:31 you know, creating an HTML page or, you know, your PHP website or whatever you've got. And you want
32:37 to embed this video in this chat. You want to use it for your streaming setup, but you don't want to
32:41 use the OwnCast interface. Just to tie this together closer with those previous videos I did,
32:46 I'm going to show you how to do that real quick. There's also a page on the OwnCast documentation
32:50 about this. So just to demonstrate, I'm going to go back to Etsy Apache 2. Actually here, I'm just
32:55 going to log out of our OwnCast server just to demonstrate. I'm going to SSH into the actual
33:00 Nern in the Street server right now. Alright, so this is the actual Nern in the Street.com server
33:05 here, where Nern in the Street.com is hosted. I'm going to create a new file here, test.htm,
33:12 just for this video, and I'll remove it afterwards. So it's not going to be there if you go to it.
33:16 But this is going to be our stream test page right there. And then in the body, all we have to do
33:23 is embed an iframe in order to get our video in our chat in here. Now this is the iframe I'm going
33:29 to use for the video. I'm going to zoom out a little bit here. As you can see, I'm just using,
33:34 I'm using a style tag and I'm setting this up so it's responsive is all that I'm doing. And the
33:40 iframe itself that you're putting in here, you can specify a manual width and height if you don't
33:44 want to do all the fancy responsive stuff with CSS. But the actual place that you're embedding,
33:48 that's going to be https://the address for your owncast server/embed/video. That's what you're
33:56 going to embed. If I save that and I go here to Nern in the Street.com/ what did I just call that?
34:01 Test.htm. As you can see, that has embedded owncast in the web page here. Now in order to get the
34:09 chat in there, I'm going to come in to test.htm and I'm just going to put in some basic CSS here
34:15 so that we can get a side by side view going for our video in our chat. All right. And the iframe
34:21 source for your chat room is going to be your owncast URL/embed/chat/readwrite if you want
34:28 people to be able to actually send chats in here. You could change that to read only if you want
34:33 people to only be able to read the chat on a different web page, but not able to send it.
34:37 But readwrite is if you want people to be able to log in and send chat messages. All right. I'm
34:41 just going to put that for now /iframe to close that out. And let's see if that looks okay or if
34:47 I missed something in my styling. Okay. I'm going to go ahead and set a height that's bigger than
34:52 that in the iframe. I'm going to say height equals what? Let's do 800 should get us 800 pixels.
34:59 Refresh here. All right. So now we've got a chat here embedded next to our video. Video is playing.
35:07 Um, it does look like my, my responsive CSS there is a little bit messed up with this extra bar at
35:13 the bottom of my video player. But as you can see, I do have a chat room next to it and I can send
35:18 messages from here on my own web page. Um, and then if I go back to the actual owncast URL,
35:25 they're going to show up over there. And if I send them from the owncast page, then they will show up
35:30 over on my custom web page. So yeah, if I really wanted to get technical here, I could change my
35:35 padding a bit to try and fix that display. So that's wasting a little bit less space. And I
35:41 could go in and tweak the CSS for all the individual elements and stuff here. This is not a
35:45 web development video. I'm just showing you how you can plug this into your own web page once again,
35:49 and you should be able to take it from there. Uh, but yeah, that's all we need to do to set up
35:53 owncast on your own server. And now you have a streaming setup that you can use and you're not
35:58 going through any of the big tech companies like Twitch or YouTube or anyone else. So I hope you
36:02 found this video helpful. If you do have any additional questions about the setup, feel free
36:07 to go over to the Nerd on the Street forums and ask questions in here. Or you can leave a comment
36:10 on this video on YouTube, Dailymotion, or nerdonthestreet.com. But for now, that was our
36:14 owncast configuration. It was a little bit more off the beaten path of Linux application setup,
36:19 but it was also a little bit more turnkey in terms of the web setup than the more manual methods I've
36:23 shown in the past. So I will leave it off there. I'm Jacob Kaufman. I'm the Nerd on the Street,
36:27 and I'll see you guys in the next one. Bye.
36:34 [Music]

Recommended