Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add systemd installation method #25

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions content/docs/post_install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
title: Post-installation
---

# Post-installation

## Reverse-proxies

You can run Owncast behind your favorite reverse-proxy.

### Caddy

[Caddy](https://caddyserver.com/) is an open source web server with automatic HTTPS. It can be used as a reverse-proxy.
This is a basic [Caddyfile](https://caddyserver.com/docs/caddyfile-tutorial) example.

{{< highlight caddyfile >}}
stream.myserver.org {
header -Server
push
encode zstd gzip
reverse_proxy * 127.0.0.1:8081 # your local Owncast instance
}
{{</ highlight >}}

## systemd

1. Install Owncast as described in the [quickstart](/docs/quickstart) section
1. Create `owncast` system user
{{< highlight bash >}}
sudo adduser \
--system \
--gecos "Owncast" \
--group \
--disabled-password \
--no-create-home \
--disabled-login \
owncast
{{</ highlight >}}
1. Create the systemd unit file at `/etc/systemd/system/owncast.service`
{{< highlight systemd >}}
[Unit]
Description=Owncast
# If you are using Owncast behind a reverse proxy,
# you can specify the related service here to ensure that it is up and running
# before launching the owncast service.
# After=caddy.service
# After=nginx.service
# After=httpd.service

[Service]
Type=simple
Restart=always
RestartSec=2
User=owncast
Group=owncast
WorkingDirectory=/path/to/owncast/directory
ExecStart=/path/to/owncast/directory/owncast

[Install]
WantedBy=multi-user.target
{{</ highlight >}}
1. Ensure that the `owncast` user has the appropriate rights to `/path/to/owncast/directory`.
{{< highlight bash >}}
sudo chown -R owncast:owncast /path/to/owncast/directory
{{</ highlight >}}
1. Enable and start the `owncast` service
{{< highlight bash >}}
sudo systemctl daemon-reload
sudo systemctl enable owncast
sudo systemctl start owncast
{{</ highlight >}}
1. See if `owncast` is runing
{{< highlight bash >}}
sudo systemctl status owncast
{{</ highlight >}}
5 changes: 4 additions & 1 deletion content/docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ If you would prefer to download a release manually or use Docker you have some o

## Manually download and run a release

You can choose between downloading a zip file of Owncast, or using Docker.
You can choose between
- downloading a zip file of Owncast and run it as standalone binary
- downloading a zip file of Owncast and run it as systemd unit file
Copy link
Member

@gabek gabek Dec 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we want to talk about systemd in the Quickstart. systemd is not required to download and run Owncast and should be treated as optional additional information. I almost think we should have a separate document with things you can learn about after you have Owncast running, like systemd, reverse proxies (for SSL), etc. But given that none of that has anything to do with actually downloading and running Owncast I don't want to make it sound like there's more steps and tools you have to learn. What are your thoughts @jeyemwey @gingervitis ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm certain that we should not put this into our Quickstart guide. Like Gabe said, another page with example configurations for other applications (nginx, apache2, caddy, systemd right here) would be great. Not sure how we could call this, but this PR will be a good start.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand and agree with that. Indeed, "quick start" is no longer as "quick" and easy to handle with this... What do you think about a "Post-install" section ?

- using Docker

### Download and run a release

Expand Down
1 change: 1 addition & 0 deletions content/menu/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ headless: true
- [Embedding](/docs/embed/)
- [API Reference](/docs/api/)
- [Broadcasting Software](/docs/broadcasting/)
- [Post-install](/docs/post_install/)
- [Encoding](/docs/encoding/)
- [External Storage (S3)](/docs/s3/)
- [Building from Source](/docs/building/)
Expand Down