# Codemagic Patch documentation > Self-hosted OTA updates for React Native and Capacitor (optional Codemagic hosting): setup, SDK, cmpatch CLI, and operations. Codemagic Patch is self-hosted over-the-air (OTA) updates for React Native (server, `cmpatch` CLI, and `@codemagic/react-native-patch` SDK). Codemagic can also host Patch on request. **Where to start** - [Docs home](https://patch.codemagic.io/docs/index.md) - [Install the Patch skill](https://patch.codemagic.io/docs/index.md) - [Try Patch locally](https://patch.codemagic.io/docs/local-quickstart.md) - [How it works](https://patch.codemagic.io/docs/introduction/how-it-works.md) - [Install for production](https://patch.codemagic.io/docs/install.md) - [Migrate from CodePush](https://patch.codemagic.io/docs/migration/migrating-from-codepush.md) - [Migrate from Expo Updates](https://patch.codemagic.io/docs/migration/migrating-from-expo-updates.md) - [CLI reference](https://patch.codemagic.io/docs/reference/cli-reference.md) - [SDK reference](https://patch.codemagic.io/docs/reference/sdk-reference.md) - [Debugging OTA issues](https://patch.codemagic.io/docs/troubleshooting.md) Sections below mirror the docs sidebar. **Optional** lists secondary pages (FAQ, troubleshooting)—skip when you need a shorter context. ## Overview - [Self-hosted OTA updates for React Native & Capacitor](https://patch.codemagic.io/docs/index.md): Docs home: React Native or Capacitor, then Local quickstart or Install. Codemagic can also host Patch. Install the Patch skill from codemagic-ci-cd/codemagic-skills (prompts in this page's markdown twin). - [Local quickstart: self-hosted OTA for React Native & Capacitor](https://patch.codemagic.io/docs/local-quickstart.md): Local Patch evaluation via cmpatch selfhost local-eval (or scripts/local-eval/up.sh from a clone), with optional cmpatch demo on a simulator or emulator, dashboard exploration, and integration with your own app. ## Introduction - [How self-hosted OTA works for React Native & Capacitor](https://patch.codemagic.io/docs/introduction/how-it-works.md): Patch architecture — server, storage, SDK flow, manifest delivery, rollback. - [OTA update core concepts for React Native & Capacitor](https://patch.codemagic.io/docs/introduction/core-concepts.md): OTA concepts — apps, deployments, binary version, payload vs native. - [React Native OTA comparison: Expo, CodePush, Hot Updater](https://patch.codemagic.io/docs/introduction/comparison.md): Patch vs CodePush forks, Expo Updates, Hot Updater — hosting, licensing, trade-offs. - [Capacitor OTA comparison: Appflow Live Updates](https://patch.codemagic.io/docs/introduction/comparison-capacitor.md): Patch vs Appflow Live Updates for Capacitor — self-host or Codemagic-hosted, licensing. - [Self-hosted & hosted OTA pricing (free to 1M MAU)](https://patch.codemagic.io/docs/introduction/pricing.md): Patch pricing: free self-host to 1M MAU, commercial self-host rates, hosted Patch via Codemagic pricing / sales@codemagic.io. - [Self-hosted OTA cost at scale (10k to 100M MAU)](https://patch.codemagic.io/docs/cost.md): Patch self-host cost model: CDN serves checks and bundles, server takes metrics; DigitalOcean sizing and totals at 10k, 1M, and 100M MAU. - [How to ship OTA releases with minimal crash risk](https://patch.codemagic.io/docs/safety.md): Patch OTA safety: native fingerprint mismatch blocking, deployment key switching for store-build tests, opt-in crash-rollback auto-disable and webhooks, Slack /patch digest. - [Support](https://patch.codemagic.io/docs/introduction/support.md): Chat on Discord or open a GitHub issue for Patch support. ## Setup - [Install self-hosted OTA for React Native & Capacitor](https://patch.codemagic.io/docs/install.md): Production install — cmpatch selfhost install, domains, TLS, OAuth sign-in, machine size, first admin. - [Self-hosted OTA server infrastructure & scaling](https://patch.codemagic.io/docs/setup/infrastructure.md): One-host install by default. Rules of thumb for a CDN, a separate Postgres, and external object storage, and what the installer leaves to you. - [Self-hosted OTA server maintenance: backups & upgrades](https://patch.codemagic.io/docs/setup/ongoing-maintenance.md): Self-host maintenance cadence: scheduled backups, cmpatch selfhost upgrade, health, disk, link to Operations reference. - [React Native & Expo OTA SDK native setup](https://patch.codemagic.io/docs/setup/native-setup.md): Create apps and deployments, then install the SDK with native config keys for bare RN or Expo. - [Capacitor & Ionic OTA plugin native setup](https://patch.codemagic.io/docs/setup/native-setup-capacitor.md): Install @codemagic/capacitor-patch and cmpatch-capacitor, create one app per platform, set capacitor.config.ts, run cap sync. - [Checking for OTA updates in React Native & Capacitor](https://patch.codemagic.io/docs/setup/checking-for-updates.md): Client update checks — Patch.wrap() / start(), sync(), readiness, foreground re-checks, progress, store fallback. - [Applying OTA updates: install modes & mandatory timing](https://patch.codemagic.io/docs/setup/applying-updates.md): Client apply timing — install modes, mandatoryInstallMode, per-deployment behavior, restart guards. - [Manual OTA update control (low-level SDK APIs)](https://patch.codemagic.io/docs/setup/manual-control.md): Low-level SDK — checkForUpdate, downloadUpdate, installUpdate, notifyAppReady. - [Testing React Native OTA updates with Jest](https://patch.codemagic.io/docs/setup/testing.md): Jest setup file for the RN SDK; installPatchFake + loadSdk seeds for OTA states; failure injection; isolation rules. - [Publish your first OTA release (React Native & Capacitor)](https://patch.codemagic.io/docs/setup/first-release.md): First OTA publish — cmpatch init + release-react (React Native) or cmpatch-capacitor release create (Capacitor), verify server processing. ## Using Patch - [Self-hosted OTA web dashboard: releases, metrics & IAM](https://patch.codemagic.io/docs/using-patch/dashboard.md): Web UI — releases, metrics, team IAM, bundle uploads, host status. - [Publishing React Native & Capacitor OTA updates](https://patch.codemagic.io/docs/using-patch/releasing-updates.md): Publish and manage OTA releases via CLI, dashboard, or CI pipelines. - [Native fingerprinting for React Native OTA updates](https://patch.codemagic.io/docs/using-patch/fingerprinting.md): Fingerprint mismatch blocking, cmpatch binary register/list/remove, which releases a registered version receives, build-time record and fingerprint --artifact. - [Capacitor OTA binary version compatibility](https://patch.codemagic.io/docs/using-patch/binary-version-capacitor.md): Capacitor: no native fingerprint; --target-binary-version scopes each release; bump the native version on native changes; releases cannot be retargeted. - [Verify a test OTA release on device or simulator](https://patch.codemagic.io/docs/using-patch/verify-test-release.md): Device OTA verification loop — native build, publish, confirm SDK pickup. - [Preparing React Native & Capacitor OTA for production](https://patch.codemagic.io/docs/using-patch/preparing-for-production.md): Pre-prod checklist — signing, sync config, Staging validation, rollout plan. - [OTA rollout, promote, rollback & disable controls](https://patch.codemagic.io/docs/using-patch/production-control.md): Rollout %, mandatory flag, promote, rollback, disable releases. - [Publish React Native & Capacitor OTA updates from CI](https://patch.codemagic.io/docs/using-patch/ci-integration.md): Automate cmpatch release-react (React Native) or cmpatch-capacitor release create (Capacitor) in GitHub Actions, GitLab CI, Codemagic, other CI. - [Signed OTA release webhooks & Slack alerts](https://patch.codemagic.io/docs/using-patch/webhooks.md): Webhooks — register a URL per team, event types, payload, verifying the Standard Webhooks signature, retries, delivery history, cmpatch webhook commands. - [OTA release analytics, metrics & crash rollbacks](https://patch.codemagic.io/docs/using-patch/analytics.md): Release metrics — downloads, ready, applied, rollback; source maps for Datadog/Sentry vs Patch storage. - [OTA security, RBAC & code signing](https://patch.codemagic.io/docs/using-patch/security.md): Auth — OAuth sign-in, API tokens, team roles, optional code signing. - [OTA release gates: promotion & CI service accounts](https://patch.codemagic.io/docs/using-patch/release-gates.md): require_promotion and require_service_account — deployment guardrails, CI service accounts. - [How OTA manifest & bundle delivery works over CDN](https://patch.codemagic.io/docs/using-patch/delivery.md): Manifest and artifact URL layout, storage paths, CDN delivery to SDK. ## Migration - [Migrate from CodePush to self-hosted React Native OTA](https://patch.codemagic.io/docs/migration/migrating-from-codepush.md): CodePush forks to Patch: SDK swap, deployment keys, server URL, CLI mapping. Self-host by default; Codemagic can host. - [Migrate from Ionic Appflow Live Updates to Capacitor OTA](https://patch.codemagic.io/docs/migration/migrating-from-appflow.md): Appflow Live Updates to Patch: SDK swap, per-platform deployment keys, start(), cmpatch-capacitor CLI mapping. Self-host by default; Codemagic can host. - [Migrate from Expo Updates (EAS) to self-hosted OTA](https://patch.codemagic.io/docs/migration/migrating-from-expo-updates.md): Expo Updates/EAS to Patch: local eval PoC on your app, then SDK swap and cutover. Self-host by default; Codemagic can host. ## Reference - [React Native & Capacitor OTA SDK API reference](https://patch.codemagic.io/docs/reference/sdk-reference.md): JS API: wrap (React Native) or start (Capacitor), sync, install modes, error codes. - [OTA CLI reference: cmpatch & cmpatch-capacitor](https://patch.codemagic.io/docs/reference/cli-reference.md): cmpatch commands and flags (init, selfhost, demo, release-react, promote, rollback, doctor), plus cmpatch-capacitor for Capacitor apps. - [Self-hosted OTA server configuration & env vars](https://patch.codemagic.io/docs/reference/configuration.md): Server env vars — DATABASE_URL, S3, OAuth, MODE, .env.selfhost fields. - [Cloudflare & CloudFront CDN settings for self-hosted OTA](https://patch.codemagic.io/docs/reference/cdn.md): Reference for Cloudflare and CloudFront on a self-hosted Patch server. Tokens, cache rules, CloudFront console values, and turning a CDN on later. - [Self-hosted OTA server operations: backup, restore & upgrade](https://patch.codemagic.io/docs/reference/operations.md): Self-host day-2 ops — backup, restore, upgrade, smoke test, Compose. ## Optional - [Troubleshooting React Native & Capacitor OTA updates](https://patch.codemagic.io/docs/troubleshooting.md): Debug OTA failures — cmpatch doctor, logs, version mismatch, SDK, bundle errors. - [Self-hosted OTA updates FAQ for React Native & Capacitor](https://patch.codemagic.io/docs/faq.md): FAQ — licensing, Expo, CodePush, self-host, hosted Patch, what can ship OTA, MCP vs Patch skill, where to debug. - [Release Notes](https://patch.codemagic.io/docs/releases/index.md): Patch release notes index: latest version per surface, a short compatibility policy, and a dated list of releases linking to the per-surface notes. - [React Native SDK](https://patch.codemagic.io/docs/releases/react-native.md): React Native SDK (@codemagic/react-native-patch) release notes by version. - [CLI](https://patch.codemagic.io/docs/releases/cli.md): cmpatch CLI (@codemagic/patch-cli) release notes by version, for app developers and self-host operators. - [Capacitor SDK](https://patch.codemagic.io/docs/releases/capacitor-sdk.md): Capacitor SDK (@codemagic/capacitor-patch) release notes by version. - [CLI for Capacitor](https://patch.codemagic.io/docs/releases/capacitor-cli.md): cmpatch-capacitor CLI (@codemagic/capacitor-patch-cli) release notes by version. - [Server and dashboard](https://patch.codemagic.io/docs/releases/server.md): Patch server and dashboard release notes by version, including migrations and upgrade notes for self-host operators. - [Roadmap](https://patch.codemagic.io/docs/roadmap.md): Patch roadmap with work in progress, planned work, and recent releases. Post feature ideas in GitHub Discussions.