# ClipMux > ClipMux is self-hosted video infrastructure, an open-source alternative to Mux and Cloudflare Stream: upload, encode and stream encrypted HLS from servers you own. It is one Go binary and Postgres; apps integrate through a REST API (OpenAPI 3.1), the @clipmux/node SDK, and the and elements. ## Start - [ClipMux documentation](https://clipmux.com/docs.md): ClipMux is self-hosted video infrastructure, an open-source alternative to Mux and Cloudflare Stream. ## Build - [Build with ClipMux](https://clipmux.com/docs/build.md): Add uploads, webhooks and private playback to your app, with the Node SDK or the REST API. - [Quickstart](https://clipmux.com/docs/build/quickstart.md): Add uploads, webhooks and private playback to a Next.js app in four steps. - [Your first video with curl](https://clipmux.com/docs/build/first-video.md): Upload a file, wait for it to encode and play it, using nothing but curl and jq against the API. - [AI and agents](https://clipmux.com/docs/build/ai-and-agents.md): Point a coding agent at the files that teach it ClipMux, from a one-line prompt or the agent skills to every page as Markdown. - [How ClipMux works](https://clipmux.com/docs/build/concepts/how-it-works.md): The handful of objects an app works with, from the app and its keys to the video, its outputs, playback IDs and tracks. - [A video's lifecycle](https://clipmux.com/docs/build/concepts/lifecycle.md): The five states a video moves through, what moves it, and what a re-encode does to a video that is already playing. - [Playback IDs and tokens](https://clipmux.com/docs/build/concepts/playback-ids-and-tokens.md): How a viewer reaches a video through a playback ID, why a private one needs a token your backend signs, and what revoking either does. - [What encryption does and doesn't do](https://clipmux.com/docs/build/concepts/encryption.md): Every video is stored and streamed as AES-128 encrypted HLS, which protects your storage but is not DRM. - [Choose an upload method](https://clipmux.com/docs/build/upload.md): Compare the ways a video gets into ClipMux, from a drop zone in your app to a URL import or a terminal, and pick the one that fits. - [Upload from the browser](https://clipmux.com/docs/build/upload/browser.md): Add a drop zone that sends a file straight to storage in resumable parts, with your backend deciding who may upload. - [Headless uploads and Uppy](https://clipmux.com/docs/build/upload/headless-and-uppy.md): Drive uploads from your own interface with the ClipMuxUpload class, or from any client through the upload routes. - [Import from a URL](https://clipmux.com/docs/build/upload/from-url.md): Have your ClipMux server fetch a video from a public URL and encode it, with no upload from your side. - [Upload from the command line](https://clipmux.com/docs/build/upload/command-line.md): Push files and whole folders from a terminal, with the server's clipmux binary or with npx @clipmux/node from your app's project. - [Choose renditions](https://clipmux.com/docs/build/upload/renditions.md): Pick which resolutions ClipMux encodes a video at, from 360p up to 2160p, and what the larger ones cost. - [Link videos to your records](https://clipmux.com/docs/build/upload/passthrough.md): Tag each video with your own ID through passthrough, so every webhook and lookup leads straight back to your record. - [Add the player](https://clipmux.com/docs/build/play/player.md): Play private and public videos in your pages with the clipmux-player element, which renews tokens while it plays. - [Sign playback tokens](https://clipmux.com/docs/build/play/sign-tokens.md): Let your backend decide who watches a private video, with a token it signs itself. - [Public videos](https://clipmux.com/docs/build/play/public-videos.md): Give a video a public playback ID so anyone with its URL can watch it, with no token. - [Posters and thumbnails](https://clipmux.com/docs/build/play/posters-and-thumbnails.md): Show a still of each video in your pages, lists and link previews, with a token that can fetch only the poster. - [Other players and native apps](https://clipmux.com/docs/build/play/other-players.md): Play ClipMux videos in hls.js, Safari, ExoPlayer and any other HLS player, with the token in the URL path. - [Share links](https://clipmux.com/docs/build/play/share-links.md): Send someone a link that plays one private video on a page ClipMux hosts, and revoke it when you're done. - [Subtitles and transcripts](https://clipmux.com/docs/build/captions/subtitles.md): Have ClipMux transcribe a video's speech into subtitles the player shows, and read the transcript as text with timings. - [Chapters](https://clipmux.com/docs/build/captions/chapters.md): Split a video into named chapters, written by an LLM from its transcript, and mark them on the player's time slider. - [Receive webhooks](https://clipmux.com/docs/build/webhooks.md): Keep your own records in step with each video's state, from signed webhook events and a catch-up job for any you miss. - [Verify webhook signatures](https://clipmux.com/docs/build/webhooks/verify-signatures.md): Check that a webhook came from your ClipMux server and wasn't changed or replayed, in Node, Python, Go or PHP. - [Develop locally with listen](https://clipmux.com/docs/build/webhooks/listen.md): Receive your app's webhook events on a laptop the ClipMux server can't reach, signed so your handler verifies them unchanged. - [Retries, redelivery and secret rotation](https://clipmux.com/docs/build/webhooks/retries.md): How ClipMux retries a failed webhook for 24 hours, how to send one again, and how to change a webhook secret without losing events. - [Views, watch time and unique viewers](https://clipmux.com/docs/build/analytics.md): Read how often your videos are watched, for how long and by how many people, counted by ClipMux's delivery with no player beacon. - [Next.js integration](https://clipmux.com/docs/build/frameworks/nextjs.md): Add ClipMux uploads, playback and webhooks to a Next.js App Router app with one route file and one client component. - [Express integration](https://clipmux.com/docs/build/frameworks/express.md): Mount the ClipMux handler in an Express app with toNodeListener, before any body parser. - [Hono integration](https://clipmux.com/docs/build/frameworks/hono.md): Add ClipMux uploads, playback and webhooks to a Hono app by passing its raw request to the ClipMux handler on one route. - [SvelteKit, Remix, Bun, Deno and Workers](https://clipmux.com/docs/build/frameworks/fetch-runtimes.md): Wire the ClipMux handler into any framework or runtime that speaks Fetch requests and responses. - [Any language](https://clipmux.com/docs/build/frameworks/any-language.md): Use ClipMux from Python, Go, PHP, Ruby or any backend with its REST API, an API key and two small pieces of tested code. - [Production checklist](https://clipmux.com/docs/build/going-live/production-checklist.md): Check credentials, webhooks, playback and error handling before real viewers use your ClipMux integration. - [Troubleshoot your integration](https://clipmux.com/docs/build/going-live/troubleshooting.md): What each error from the SDK, the handler, the player and the uploader means, and what to do about it. ## Self-host - [Self-host ClipMux](https://clipmux.com/docs/self-host.md): Install ClipMux on your own server, then connect storage, encoding and delivery. - [Requirements and sizing](https://clipmux.com/docs/self-host/requirements.md): The server, disk, memory and DNS names ClipMux needs, and how to size them for your library. - [Install with one line](https://clipmux.com/docs/self-host/install.md): Run the installer to start ClipMux, Postgres and Caddy on your server, and get the setup token. - [First run](https://clipmux.com/docs/self-host/first-run.md): Create the owner account, set the public and media URLs, turn on two-factor sign-in, and run the setup test. - [A tour of the dashboard](https://clipmux.com/docs/self-host/dashboard.md): What each page of the ClipMux dashboard shows and what you can do there. - [Install from source with Compose](https://clipmux.com/docs/self-host/install-options/compose-from-source.md): Build the ClipMux image from a clone of the repository and run it with Docker Compose. - [Behind your own reverse proxy](https://clipmux.com/docs/self-host/install-options/reverse-proxy.md): Run ClipMux without its bundled Caddy, behind a Caddy, nginx or Traefik you already run on ports 80 and 443. - [Upgrade and uninstall](https://clipmux.com/docs/self-host/install-options/upgrade-and-uninstall.md): Move ClipMux to a new release, pin or roll back a version, or remove it from the server. - [Where videos are stored](https://clipmux.com/docs/self-host/storage.md): Keep videos on this server's disk, in any S3-compatible bucket, or in Cloudflare R2, and move your library between them. - [Encode on this server](https://clipmux.com/docs/self-host/encoding/this-server.md): Use the built-in encoder on the ClipMux server, with its NVIDIA, AMD or Intel GPU when Docker passes one in. - [Encode on Modal](https://clipmux.com/docs/self-host/encoding/modal.md): Rent a GPU machine on Modal for each video, with a monthly spend limit, and keep this server as the fallback. - [Encode on RunPod](https://clipmux.com/docs/self-host/encoding/runpod.md): Rent a GPU pod on RunPod's Secure Cloud for each video, with a monthly spend limit, and keep this server as the fallback. - [Encode on a PC you own](https://clipmux.com/docs/self-host/encoding/your-pc.md): Connect a computer with a GPU, at home or in an office, as an encoder for your ClipMux server. - [Routing, fallback and spend limits](https://clipmux.com/docs/self-host/encoding/routing-and-limits.md): How ClipMux decides where each job runs, when it uses the fallback, and how cloud GPU spend is held under its limit. - [Encoding performance](https://clipmux.com/docs/self-host/encoding/performance.md): Measured encode and transcription times on Modal GPUs and a local AMD card, and what drives them. - [Built-in delivery](https://clipmux.com/docs/self-host/delivery/built-in.md): How your ClipMux server streams encrypted HLS itself, and when to give it its own hostname or move it to Cloudflare. - [Cloudflare edge delivery](https://clipmux.com/docs/self-host/delivery/cloudflare.md): Serve playback from Cloudflare's edge with the ClipMux Worker and an R2 bucket, connected from the dashboard with one token. - [Edge analytics](https://clipmux.com/docs/self-host/delivery/edge-analytics.md): Bring the playback the Cloudflare Worker counts into ClipMux's Analytics with a second, read-only token. - [Transcribe with whisper.cpp](https://clipmux.com/docs/self-host/captions-and-ai/whisper.md): Make subtitles and transcripts on the machines that encode your videos, with a pinned whisper.cpp model and no speech API. - [Use a speech API](https://clipmux.com/docs/self-host/captions-and-ai/speech-apis.md): Send transcriptions to an OpenAI-compatible speech API, always or only when no worker of yours can transcribe. - [Choose an LLM for chapters](https://clipmux.com/docs/self-host/captions-and-ai/chapters-llm.md): Connect Claude or any OpenAI-compatible chat API, including a keyless server on your own network, to title a video's chapters from its transcript. - [Back up and restore](https://clipmux.com/docs/self-host/operate/backups.md): Back up the database, the uploaded videos and the secrets key, check the backups, and restore them on the same server or a new one. - [Disaster recovery](https://clipmux.com/docs/self-host/operate/disaster-recovery.md): What to do, how long it should take and how to check it worked, for each way a ClipMux server can fail. - [Monitoring](https://clipmux.com/docs/self-host/operate/monitoring.md): Watch a ClipMux server with its health checks, Prometheus metrics, ready-made alerts and structured logs. - [Retention](https://clipmux.com/docs/self-host/operate/retention.md): What ClipMux keeps, for how long, and how to prune it by hand. - [Rotate keys and secrets](https://clipmux.com/docs/self-host/operate/rotate-secrets.md): Replace each key and secret ClipMux uses without stopping playback, and what to do when one leaks. - [Security checklist](https://clipmux.com/docs/self-host/operate/security-checklist.md): The settings to check before a ClipMux server faces real users and real videos. - [Troubleshoot the server](https://clipmux.com/docs/self-host/operate/troubleshooting.md): What to look at when a ClipMux server misbehaves, from a server that won't start to playback that fails at the edge. - [Security model](https://clipmux.com/docs/self-host/security-model.md): The threats ClipMux is built against and the controls that answer each one. - [Limitations](https://clipmux.com/docs/self-host/limitations.md): What ClipMux doesn't do, so you can decide before you build on it. ## Reference - [Reference](https://clipmux.com/docs/reference.md): The integration API, webhook events, errors, limits, settings, the command line and the SDKs. - [API reference](https://clipmux.com/docs/reference/api.md): Every route of the integration API, with its parameters, an example and its errors. - [Uploads API](https://clipmux.com/docs/reference/api/uploads.md): Resumable browser uploads. - [Videos API](https://clipmux.com/docs/reference/api/videos.md): A video is an asset in the API: its status, playback IDs, tracks and renditions. - [Subtitles and chapters API](https://clipmux.com/docs/reference/api/subtitles-and-chapters.md): Tracks made after a video is ready: subtitles from speech, and chapters from an LLM. - [Playback IDs API](https://clipmux.com/docs/reference/api/playback-ids.md): Each video has one or more playback IDs, public or signed, each revocable on its own. - [Share links API](https://clipmux.com/docs/reference/api/share-links.md): A share link plays one video for anyone holding its URL, until it expires or is revoked. - [App API](https://clipmux.com/docs/reference/api/app.md): The API key's own app: its URLs, scopes, token lifetime and signing keys. - [Events API](https://clipmux.com/docs/reference/api/events.md): The same events your webhook endpoints receive, read by long-polling. - [Analytics API](https://clipmux.com/docs/reference/api/analytics.md): Views, watch time, unique viewers and bytes delivered, counted at delivery. - [App pairing API](https://clipmux.com/docs/reference/api/app-pairing.md): How `npx @clipmux/node init` gets an app's credentials without anyone copying a secret. - [Delivery API](https://clipmux.com/docs/reference/api/delivery.md): Playback, from the media URL (`base_url`): HLS playlists, posters and subtitle files. - [Share page API](https://clipmux.com/docs/reference/api/share-page.md): The token endpoint behind a share link's page. - [Webhook events](https://clipmux.com/docs/reference/webhooks.md): Every event your app's webhook endpoints receive, with its headers and an example body. - [Errors](https://clipmux.com/docs/reference/errors.md): Every error code the API returns, what it means and what to do. - [Limits and defaults](https://clipmux.com/docs/reference/limits.md): Rate limits, sizes and the defaults a ClipMux instance enforces. - [Environment variables](https://clipmux.com/docs/reference/configuration.md): Every setting of the server, the worker, the CLI and your app's backend. - [Command line](https://clipmux.com/docs/reference/cli.md): The clipmux binary and the npx @clipmux/node commands, with every flag. - [Management API](https://clipmux.com/docs/reference/management-api.md): The owner routes the dashboard calls to set up the server, manage apps and keys, and run the library. - [@clipmux/node](https://clipmux.com/docs/reference/sdks/node.md): The server SDK, with its client, route handlers, token signing, webhook verification and CLI. - [@clipmux/player](https://clipmux.com/docs/reference/sdks/player.md): The player element, its attributes, properties and events, and the token-refresh helpers for other players. - [@clipmux/uploader](https://clipmux.com/docs/reference/sdks/uploader.md): The upload element, its attributes, events and styling, and the headless ClipMuxUpload class. - [Changelog](https://clipmux.com/docs/reference/changelog.md): What changed in each release of the server and the npm packages. ## Resources - [Resources](https://clipmux.com/docs/resources.md): Guides for moving from Mux or Cloudflare Stream, how ClipMux is built, common questions, and how to take part. - [Migrate from Mux](https://clipmux.com/docs/resources/migrate-from-mux.md): Map what you use in Mux to ClipMux, see what ClipMux doesn't have, and move an app across step by step. - [Migrate from Cloudflare Stream](https://clipmux.com/docs/resources/migrate-from-cloudflare-stream.md): Map what you use in Cloudflare Stream to ClipMux, see what ClipMux doesn't have, and move an app across step by step. - [Architecture overview](https://clipmux.com/docs/resources/architecture.md): The core model, the three adapters and the rules that keep ClipMux safe, on one screen. - [FAQ](https://clipmux.com/docs/resources/faq.md): Short answers about DRM, scaling, cost, the licence, Docker, live streaming and more. - [Contributing](https://clipmux.com/docs/resources/contributing.md): How to set up the repository, how changes are made, and what a pull request needs. - [Security policy](https://clipmux.com/docs/resources/security-policy.md): How to report a vulnerability privately, what is in scope, and what ClipMux defends. ## Optional - [All the docs](https://clipmux.com/llms-full.txt): every page in one file - [Build, in full](https://clipmux.com/docs/build/llms-full.txt): Adding uploads, webhooks and signed playback to an app. - [Self-host, in full](https://clipmux.com/docs/self-host/llms-full.txt): Installing and running a ClipMux server. - [Reference, in full](https://clipmux.com/docs/reference/llms-full.txt): The API, webhooks, errors, limits, settings and CLI. - [Resources, in full](https://clipmux.com/docs/resources/llms-full.txt): Migrating from Mux or Cloudflare Stream, the architecture, the FAQ and the project. - [OpenAPI spec](https://clipmux.com/openapi.json): the integration API, OpenAPI 3.1