# owncast/owncast architecture

> Architecture diagram of the GitHub repository owncast/owncast, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/owncast/owncast
- Repository: https://github.com/owncast/owncast

## Overview

Owncast is a self-hosted live-streaming and chat server. A broadcaster sends an RTMP stream to the backend, which ingests and transcodes it; viewers use the web interface to watch and chat. The repository also has distinct storage, federation, plugin, moderation, and monitoring capabilities. The README documents the product workflow, while the sampled entry point describes dependency wiring; unsampled implementation details and their connections are shown only where the README or source index supports them.

Main entry points: [`main.go`](https://github.com/owncast/owncast/blob/develop/main.go) (Owncast server), [`services/chat/server.go`](https://github.com/owncast/owncast/blob/develop/services/chat/server.go) (Live chat), [`services/rtmp`](https://github.com/owncast/owncast/tree/develop/services/rtmp) (RTMP ingest), [`services/stream/service.go`](https://github.com/owncast/owncast/blob/develop/services/stream/service.go) (Stream lifecycle)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime and ingest"]
  node_server["Owncast server<br/>[main.go]"]
  node_rtmp["RTMP ingest"]
  node_stream["Stream lifecycle<br/>[service.go]"]
  node_transcoder["Transcoder<br/>[transcoder.go]"]
  node_storage["Stream storage"]
end

subgraph group_audience["Viewer experience"]
  node_web["Web interface<br/>[Main.tsx]"]
  node_player["Video player<br/>[OwncastPlayer.tsx]"]
end

subgraph group_community["Community features"]
  node_chat["Live chat<br/>[server.go]"]
  node_federation["ActivityPub"]
  node_webhooks["Webhooks<br/>[webhooks.go]"]
end

subgraph group_platform["Platform services"]
  node_plugins["Plugins<br/>[manager.go]"]
  node_database[("Database access<br/>[db.go]")]
  node_auth["Authentication<br/>[auth.go]"]
  node_notifications["Notifications<br/>[service.go]"]
end

subgraph group_operations["Administration"]
  node_metrics["Metrics<br/>[metrics.go]"]
  node_admin["Admin interface<br/>[webhooks.tsx]"]
  node_config["Configuration<br/>[config.go]"]
end

node_broadcaster(("Broadcaster"))
node_viewer(("Viewer"))

node_broadcaster -->|"sends RTMP"| node_server
node_server -.->|"accepts stream"| node_rtmp
node_rtmp -->|"drives ingest"| node_stream
node_stream -.->|"starts transcoding"| node_transcoder
node_transcoder -.->|"writes segments"| node_storage
node_viewer -->|"opens interface"| node_web
node_web -->|"renders playback"| node_player
node_viewer -.->|"joins chat"| node_chat
node_server -->|"constructs service"| node_chat
node_server -->|"constructs service"| node_federation
node_server -->|"constructs service"| node_plugins
node_server -->|"constructs service"| node_auth
node_server -->|"initializes service"| node_notifications
node_server -->|"constructs service"| node_metrics
node_server -->|"loads configuration"| node_config
node_server -->|"constructs repositories"| node_database
node_admin -.->|"updates settings"| node_server
node_chat -->|"dispatches events"| node_webhooks

click node_server "https://github.com/owncast/owncast/blob/develop/main.go"
click node_rtmp "https://github.com/owncast/owncast/tree/develop/services/rtmp"
click node_stream "https://github.com/owncast/owncast/blob/develop/services/stream/service.go"
click node_transcoder "https://github.com/owncast/owncast/blob/develop/services/transcoder/transcoder.go"
click node_storage "https://github.com/owncast/owncast/tree/develop/services/storage"
click node_web "https://github.com/owncast/owncast/blob/develop/web/components/layouts/Main/Main.tsx"
click node_player "https://github.com/owncast/owncast/blob/develop/web/components/video/OwncastPlayer/OwncastPlayer.tsx"
click node_chat "https://github.com/owncast/owncast/blob/develop/services/chat/server.go"
click node_federation "https://github.com/owncast/owncast/tree/develop/services/activitypub"
click node_webhooks "https://github.com/owncast/owncast/blob/develop/services/webhooks/webhooks.go"
click node_plugins "https://github.com/owncast/owncast/blob/develop/services/plugins/manager.go"
click node_database "https://github.com/owncast/owncast/blob/develop/db/db.go"
click node_auth "https://github.com/owncast/owncast/blob/develop/auth/auth.go"
click node_notifications "https://github.com/owncast/owncast/blob/develop/services/notifications/service.go"
click node_metrics "https://github.com/owncast/owncast/blob/develop/metrics/metrics.go"
click node_admin "https://github.com/owncast/owncast/blob/develop/web/pages/admin/webhooks.tsx"
click node_config "https://github.com/owncast/owncast/blob/develop/config/config.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_server,node_rtmp,node_stream,node_transcoder,node_storage,node_viewer toneBlue
class node_web,node_player toneAmber
class node_chat,node_federation,node_webhooks toneMint
class node_plugins,node_database,node_auth,node_notifications toneRose
class node_metrics,node_admin,node_config,node_broadcaster toneIndigo
```

## Components

### Runtime and ingest

- [Owncast server](https://github.com/owncast/owncast/blob/develop/main.go): `main.go`
- [RTMP ingest](https://github.com/owncast/owncast/tree/develop/services/rtmp): `services/rtmp`
- [Stream lifecycle](https://github.com/owncast/owncast/blob/develop/services/stream/service.go): `services/stream/service.go`
- [Transcoder](https://github.com/owncast/owncast/blob/develop/services/transcoder/transcoder.go): `services/transcoder/transcoder.go`
- [Stream storage](https://github.com/owncast/owncast/tree/develop/services/storage): `services/storage`

### Viewer experience

- [Web interface](https://github.com/owncast/owncast/blob/develop/web/components/layouts/Main/Main.tsx): `web/components/layouts/Main/Main.tsx`
- [Video player](https://github.com/owncast/owncast/blob/develop/web/components/video/OwncastPlayer/OwncastPlayer.tsx): `web/components/video/OwncastPlayer/OwncastPlayer.tsx`

### Community features

- [Live chat](https://github.com/owncast/owncast/blob/develop/services/chat/server.go): `services/chat/server.go`
- [ActivityPub](https://github.com/owncast/owncast/tree/develop/services/activitypub): `services/activitypub`
- [Webhooks](https://github.com/owncast/owncast/blob/develop/services/webhooks/webhooks.go): `services/webhooks/webhooks.go`

### Platform services

- [Plugins](https://github.com/owncast/owncast/blob/develop/services/plugins/manager.go): `services/plugins/manager.go`
- [Database access](https://github.com/owncast/owncast/blob/develop/db/db.go): `db/db.go`
- [Authentication](https://github.com/owncast/owncast/blob/develop/auth/auth.go): `auth/auth.go`
- [Notifications](https://github.com/owncast/owncast/blob/develop/services/notifications/service.go): `services/notifications/service.go`

### Administration

- [Metrics](https://github.com/owncast/owncast/blob/develop/metrics/metrics.go): `metrics/metrics.go`
- [Admin interface](https://github.com/owncast/owncast/blob/develop/web/pages/admin/webhooks.tsx): `web/pages/admin/webhooks.tsx`
- [Configuration](https://github.com/owncast/owncast/blob/develop/config/config.go): `config/config.go`

### Other components

- **Broadcaster**
- **Viewer**

## Connections

- Broadcaster → Owncast server: sends RTMP (evidence: `README.md`)
- Owncast server → RTMP ingest: accepts stream (evidence: `main.go`)
- RTMP ingest → Stream lifecycle: drives ingest
- Stream lifecycle → Transcoder: starts transcoding
- Transcoder → Stream storage: writes segments
- Viewer → Web interface: opens interface (evidence: `README.md`)
- Web interface → Video player: renders playback (evidence: `web/components/layouts/Main/Main.tsx`)
- Viewer → Live chat: joins chat
- Owncast server → Live chat: constructs service (evidence: `main.go`)
- Owncast server → ActivityPub: constructs service (evidence: `main.go`)
- Owncast server → Plugins: constructs service (evidence: `main.go`)
- Owncast server → Authentication: constructs service (evidence: `main.go`)
- Owncast server → Notifications: initializes service (evidence: `main.go`)
- Owncast server → Metrics: constructs service (evidence: `main.go`)
- Owncast server → Configuration: loads configuration (evidence: `main.go`)
- Owncast server → Database access: constructs repositories (evidence: `main.go`)
- Admin interface → Owncast server: updates settings
- Live chat → Webhooks: dispatches events (evidence: `services/chat/server.go`)
