# Enterprise

> Run your own Opush server on your company's Cloudflare account, while pushes reach Apple and Google through the official push gateway.

With the Enterprise plan, your company runs its own Opush server. Accounts, monitors, status pages, and everything else live in your own Cloudflare account. Your people use the same Opush apps and web console. They just connect them to your server instead of `https://opu.sh`.

Opush is closed source. A private deployment needs an Enterprise license. To get access, contact [support@allright.dev](mailto:support@allright.dev).

## When to use a private deployment [#when-to-use-a-private-deployment]

A private deployment makes sense when:

- Your data must stay on infrastructure you control. Accounts, devices, monitors, webhooks, and history are stored in your own Cloudflare D1 database.
- You want to decide who can sign up. You can require a registration token, so only people you invite can create accounts.
- You want to put the push endpoints behind a password (Basic Auth).
- You want to use your own Twilio account for SMS and phone calls, and your own sign-in apps for Google and GitHub.

If you just want Opush for yourself or a team, the hosted service at `https://opu.sh` with a [team workspace](/docs/teams) is simpler.

## How pushes reach devices [#how-pushes-reach-devices]

Apple and Google only accept pushes signed with the app's own push keys. Those keys stay on the official Opush server. Your server doesn't have them. Instead, it hands each push to the official **push gateway**, which sends it to Apple or Google for you.

```text
Your scripts, monitors, integrations
        │
        ▼
Your Opush server (your Cloudflare account)
        │  HTTPS, with your license key
        ▼
Official push gateway (opu.sh)
        │
        ▼
Apple Push Notification service / Firebase Cloud Messaging
        │
        ▼
iPhone, Apple Watch, Mac, Android
```

All kinds of pushes go through the gateway: normal notifications, background pushes (like recalls), Live Activity updates, and call alerts.

One exception: Android phones without Google services fetch their pushes from your server on a schedule. Those pushes stay on your server and never go through the gateway.

### What the gateway sees [#what-the-gateway-sees]

For each push, your server sends the gateway only what Apple or Google need to deliver it:

| Field | What it is |
|---|---|
| `token` | The device's push token from Apple or Google |
| `environment` | `production` or `sandbox` |
| `platform` | `ios`, `watchos`, `macos`, or `android` |
| `push_type` | `alert`, `background`, `liveactivity`, or `voip` |
| `priority`, `expires_in`, `collapse_id` | Delivery settings |
| `payload` | The notification itself, within Apple's and Google's size limits (4 KB for a normal push, 5 KB for a call alert) |

The gateway forwards the push and doesn't store its content. It keeps a monthly count of pushes for each license.

The payload is what the device shows. If it's plain text, the gateway (and Apple or Google) can read the title and body. To keep content private, use [encryption](/docs/push/encryption). With end-to-end encryption, the gateway only sees ciphertext. See [Security and privacy](/docs/enterprise/security) for details.

## Compared with the hosted service [#compared-with-the-hosted-service]

Your server runs the same Opush server as `https://opu.sh`. Almost everything works the same: pushes, monitors, following, integrations, channels and on-call, status pages, notification channels, AI agents, and the web console.

What's different:

| | Hosted (`opu.sh`) | Private deployment |
|---|---|---|
| Plan | Free, Pro, or Team | Every account is on the Enterprise plan |
| Purchases | In the app and on the web | None. There's nothing to buy on your server |
| Limits | Set by the plan | You set them (see [Configuration](/docs/enterprise/configuration#limits)) |
| Who can sign up | Anyone | Anyone, or only people with your registration token |
| SMS and phone calls | Opush's Twilio account | Your own Twilio account, if you add one |
| Sign in with Google or GitHub | Built in | Your own OAuth apps, if you add them |
| Status page custom domains | Point a CNAME at Opush | Add the domain as a Custom Domain of your Worker in Cloudflare |
| Webhook notification channels | HTTPS only | HTTP is allowed too, for internal URLs |

Accounts on your server are separate from accounts on `opu.sh`. Nothing is shared between them.

## Connect apps to your server [#connect-apps-to-your-server]

People can't type a server address into the app. Instead, you give them a setup link or a QR code.

<Steps>
<Step>

### Create the setup link [#create-the-setup-link]

The link has your server's address and, if you use one, your registration token:

```text
opush://addServer?address=https://push.example.com&token=YOUR_REGISTRATION_TOKEN
```

- `address` is the full base URL of your server, including the path prefix if you set [`BASE_PATH`](/docs/enterprise/configuration#server).
- `token` is optional. Leave it out if your server doesn't use `REGISTRATION_TOKEN`.

</Step>
<Step>

### Share it [#share-it]

Send the link in a channel your people trust, or turn it into a QR code. For example, with `qrencode`:

```bash
qrencode -o opush-setup.png 'opush://addServer?address=https://push.example.com&token=YOUR_REGISTRATION_TOKEN'
```

Treat a link with a token like an invite. Anyone who has it can create an account on your server.

</Step>
<Step>

### Open it on the device [#open-it-on-the-device]

<Tabs items={["iPhone", "Android"]}>
<Tab value="iPhone">

- **New users:** on the welcome screen, tap **Use a company server**, then **Scan QR code**.
- **Existing users:** go to **Settings**, then under **Servers** tap **Add a company server**, then **Scan QR code**.
- Opening the link directly (or scanning it with the Camera app) also works.

The iPhone app can be connected to several servers at once. Following and Receive show the selected server. The Inbox shows pushes from all of them. Apple Watch uses the same server as the iPhone.

</Tab>
<Tab value="Android">

Open the link, or scan the QR code with the phone's camera. Opush asks **Use your company's server?** Tap **Use this server**.

The Android app connects to one server at a time. If it was on another server, the phone moves to yours. Its Inbox stays on the phone.

</Tab>
</Tabs>

</Step>
</Steps>

### Web console [#web-console]

Your server includes the web console at `{base}/app`, for example `https://push.example.com/app`. If you set [`CONSOLE_URL`](/docs/enterprise/configuration#server), the console runs at the root of that address instead.

People can sign up on the web too. If your server uses a registration token, the sign-up page asks for a **Registration code**.

### Scripts and tools [#scripts-and-tools]

Push URLs use your server's address. Everything in the [push docs](/docs/push) works the same way. Just replace `https://opu.sh`:

```bash
curl https://push.example.com/YOUR_KEY/Backup%20finished
```

If you turned on Basic Auth, add the user name and password:

```bash
curl -u "ops:YOUR_PASSWORD" https://push.example.com/YOUR_KEY/Backup%20finished
```

## Next steps [#next-steps]

<Cards>
  <Card title="Configuration" href="/docs/enterprise/configuration" description="Environment variables, secrets, and the Cloudflare resources your server uses." />
  <Card title="Security and privacy" href="/docs/enterprise/security" description="What's stored where, encryption, and how access is protected." />
</Cards>
