Provisioning Resources
In this section, we create a virtual private server (VPS) and perform some initial configuration.
Create a VPS
Provision a VPS on your hosting provider of choice. My current VPS is a DigitalOcean droplet with 4 GB memory and 80 GB disk, running the latest release of Ubuntu Server. If you're using a different hosting provider or running a different OS, then the following setup steps will vary.
Create an admin user
You will want to have a non-root administrative user account. Some hosting providers create one automatically, and some don't. To create an admin user manually, follow your hosting provider's directions to log into root, then create the user with adduser, add appropriate permissions, and switch to it.
💡 Quiz: What's the difference between the
adduseranduseraddutility programs?
# adduser myadmin
# usermod -aG sudo myadmin
# su -l myadmin
Throughout this documentation the admin user is called myadmin, but you can call yours whatever you want. Don't worry about choosing an admin username that's obscure or hard to guess. It's more important to safeguard your password and private key.
Speaking of keys, you can now add your SSH public key(s) to the admin user. You might need to create the directory /home/myadmin/.ssh/ and file authorized_keys with appropriate permissions.
$ mkdir --mode 700 ~/.ssh
$ echo "<public key>" >> ~/.ssh/authorized_keys
$ chmod 600 ~/.ssh/authorized_keys
Verify that you can SSH into the admin user from your local terminal.
$ ssh myadmin@<server IP address>
Log out of root, and never log back into root again. From now on, all of the admin tasks are done via SSH as the admin user. If you're faced with a problem that can only be solved by logging into root directly, then it's probably safer to rebuild the VPS from scratch instead.
Optional: S3 Compatible Storage
Owncast can be configured to serve your stream to your viewers from an S3 compatible object storage service. This offloads your stream's bandwidth and storage requirements from your VPS.
Your VPS hosting provider might offer cost-effective object storage service plans that meet requirements. My current deployment on DigitalOcean uses one of their standard buckets.