Self-hosting and deployment
Environment variables
Every variable in .env with its purpose and default, grouped by what it switches on.
Updated November 21, 2026
On this page+
Copy .env.example to .env. Optional variables switch a feature on when set; without them HeyOrbit degrades gracefully and the relevant screen says what isn't available. Restart the app after changing variables.
Core#
| Variable | Required | Default | Purpose |
|---|---|---|---|
| DATABASE_URL | Yes | file:./dev.db | Prisma connection string: a SQLite file or a Postgres URL (Postgres) |
| DIRECT_DATABASE_URL | No | – | Direct (unpooled) Postgres URL used for schema pushes; DATABASE_URL_UNPOOLED is also read |
| APP_URL | Yes | http://localhost:3000 | Public URL, used for sign-in callbacks, emails, share links and media URLs |
| APP_SECRET | Yes | – | 32+ random characters; signs sessions and encrypts stored credentials. Changing it signs everyone out and makes stored credentials unreadable |
| CRON_SECRET | For external cron | – | Bearer secret for /api/cron/* (cron) |
| INPROCESS_SCHEDULER | No | true | Set false to turn off the in-process 30-second timer and rely on external cron |
| MAINTENANCE_EVERY_MINUTES | No | 30 | How often background syncs run (analytics, inbox, inbox alerts, token refresh, scheduled reports, renewals); minimum 5. Publishing isn't affected |
| CHROMIUM_PATH | No | – | Chromium binary for PDF report export; without it the PDF button opens the print view |
AI#
| Variable | Default | Purpose |
|---|---|---|
| ANTHROPIC_API_KEY | – | AI captions (including reading post images), writing tools, hashtag suggestions, inbox tagging and reply drafts, and report summaries. Without it HeyOrbit writes simple offline drafts that can't see images |
| ANTHROPIC_MODEL | claude-opus-5-5 | Model id for text generation |
| REPLICATE_API_TOKEN | – | AI Images models (Flux Schnell, Flux 1.1 Pro and Ultra, Imagen 4, Ideogram 3 Turbo, Recraft V3). Without it AI Images offers only the text card |
AI features still need the AI Studio add-on, whatever is configured.
Email#
| Variable | Default | Purpose |
|---|---|---|
| SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASS | port 587 | Outgoing email: invitations, approvals, mentions, failures, inbox alerts, scheduled reports. When empty, emails are logged to the console |
| EMAIL_FROM | HeyOrbit <hello@heyorbit.tech> | Sender name and address |
| SUPPORT_EMAIL | support@heyorbit.tech | Where support tickets and contact-form messages go |
Billing#
| Variable | Purpose |
|---|---|
| STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET | Stripe checkout and subscription webhooks for US-dollar payments: account slots and the AI add-on, both monthly. Prices are set inline, so there are no Stripe products to create |
| RAZORPAY_KEY_ID, RAZORPAY_KEY_SECRET | Rupee payments through Razorpay: account slots and the AI add-on, auto-renewed monthly (Razorpay Subscriptions: UPI AutoPay, cards, bank mandates) or paid one month at a time (Orders). Plans are created automatically on first use and named "HeyOrbit — …". Both must be set for rupee checkout to show |
| RAZORPAY_WEBHOOK_SECRET | Signs Razorpay webhooks. In Razorpay → Settings → Webhooks, point a webhook at {APP_URL}/api/billing/razorpay/webhook with this secret and the events payment.captured, payment.failed, order.paid and subscription.authenticated, .activated, .charged, .pending, .halted, .cancelled, .completed, .updated. Events for objects HeyOrbit didn't create are acknowledged and ignored, so a Razorpay account shared with another business is fine. GET on the same URL answers whether the keys and secret are set (and the key's live / test mode), never their values |
| RAZORPAY_MAX_RECURRING_INR | Optional. The largest automatic monthly debit (default 15000, the RBI limit for UPI AutoPay and card mandates without the customer approving each debit). Auto-renew covers up to this amount a month; above it, customers pay month by month |
Without a payment provider, account slots and the AI add-on can't be bought online and the Billing page says so.
Social connections through Zernio (recommended)#
With ZERNIO_API_KEY set, every social platform connects through Zernio (zernio.com), a social API with its own approved app on each platform: Instagram, Facebook Pages, X, TikTok, YouTube, Pinterest, Threads, Bluesky, Google Business Profile and LinkedIn (personal profiles and company pages). Mastodon keeps its own token connect. Zernio holds the sign-ins; HeyOrbit stores only Zernio's ids, and each workspace gets its own Zernio profile on its first connection.
- Connect and reconnect open Zernio's hosted flow: the platform's sign-in, then Zernio's own picker where the platform needs one (Facebook Page, LinkedIn profile or company page, Pinterest board, Google Business location). HeyOrbit checks every account against Zernio's list before saving it. Bluesky connects with a handle and app password, which go to Zernio once.
- Publishing goes through Zernio's Posting API with each platform's options (threads, first comments, Reels and Stories, TikTok privacy and interactions, YouTube title, playlist and thumbnail, Pinterest board, Google Business buttons, events and offers). The composer hides the few options Zernio can't post and says why.
- Analytics (daily activity, followers, post metrics, Instagram, Facebook, YouTube, TikTok, Pinterest and Google Business insights) are read on the usual background sync. Numbers Zernio doesn't report show as not available, never as 0.
- Inbox: new comments, DMs and Google reviews arrive by webhook within seconds, so DM automations answer right away; replies, likes, hide and delete go back through Zernio. These accounts skip the regular inbox polling and the DM fast lane: only a safety sync runs every few hours (ZERNIO_INBOX_SAFETY_HOURS, default 6). X sends no comment or DM events, so X keeps the regular inbox sync.
- Accounts connected before (through Composio or your own apps) keep working. Their Accounts row offers "Reconnect to get instant inbox"; reconnecting moves the same account to Zernio with its history.
LinkedIn through Zernio needs the workspace owner to have a paid account slot, with the account subscription active or within the payment grace period. Without one, the LinkedIn card keeps the Composio / own-app path where this server has one. When the subscription lapses, that owner's LinkedIn accounts are removed on Zernio and marked Needs reconnect, with posts and analytics kept.
| Variable | Purpose |
|---|---|
| ZERNIO_API_KEY | Zernio API key (Zernio → Settings → API keys). Turns on Zernio for every social platform |
| ZERNIO_WEBHOOK_SECRET | Optional. HeyOrbit registers its webhook ({APP_URL}/api/webhooks/zernio, with the post, account and inbox events it handles) in Zernio by itself, signed with a secret derived from APP_SECRET. Set this to choose the secret yourself |
| ZERNIO_INBOX_SAFETY_HOURS | Optional, default 6. How often the inbox of webhook-fed accounts is read anyway, as a safety net |
In Zernio: use a plan that includes analytics and the inbox, add a card on file (X connections pass X's API costs through, and TikTok capacity is wider with a card), and set APP_URL to your public HTTPS domain so Zernio can reach the webhook and fetch media. Zernio bills per connected account: the first 2 are free, then $6 each for 3–10, $3 for 11–100 and $1 past 100, per month.
Social connections through Composio (without Zernio)#
Without ZERNIO_API_KEY, Composio can hold each account's sign-in instead, so HeyOrbit still never stores platform tokens. Every publish, analytics read and inbox call goes through Composio, so production needs a paid Composio plan; the free tier's monthly call allowance runs out quickly. Composio also serves the Canva, Google Drive and Dropbox media imports, with or without Zernio.
| Variable | Purpose |
|---|---|
| COMPOSIO_API_KEY | Turns on Composio for the media imports, and for every social platform except Bluesky and Mastodon when ZERNIO_API_KEY isn't set |
| COMPOSIO_WEBHOOK_SECRET | Signing secret for {APP_URL}/api/composio/webhook, subscribed to the connected-account expired and activated events, so HeyOrbit hears at once when a connection drops |
| COMPOSIO_AUTH_CONFIG_X, COMPOSIO_AUTH_CONFIG_TIKTOK, COMPOSIO_AUTH_CONFIG_THREADS, COMPOSIO_AUTH_CONFIG_GOOGLE_BUSINESS | Required for these four. Composio has no shared app for them, so register your own developer app in Composio and paste its auth config id (ac_…). Until set, customers see "almost ready" for that platform |
| COMPOSIO_AUTH_CONFIG_FACEBOOK, COMPOSIO_AUTH_CONFIG_INSTAGRAM, COMPOSIO_AUTH_CONFIG_LINKEDIN, COMPOSIO_AUTH_CONFIG_YOUTUBE, COMPOSIO_AUTH_CONFIG_PINTEREST | Optional. These work with Composio's shared apps out of the box; set them to use your own app instead, which is recommended before you grow (shared apps share rate limits) |
Composio has no comment or DM events for social platforms, so these accounts' inboxes are read on the regular background sync.
LinkedIn company pages without Zernio#
Composio's shared LinkedIn app can only post to personal profiles, and LinkedIn only grants company-page access to a separate app with its Community Management API product (it can't share an app with "Sign In with LinkedIn"):
- Create an app at linkedin.com/developers, linked to your company's LinkedIn page, and have a page admin verify it.
- On the app's Products tab, request the Community Management API and fill in the access form. LinkedIn reviews it (often a few days to a few weeks).
- Once approved, on the app's Auth tab add the redirect URL {APP_URL}/api/oauth/linkedin-pages/callback, then copy the Client ID and Client Secret into LINKEDIN_PAGES_CLIENT_ID and LINKEDIN_PAGES_CLIENT_SECRET and redeploy. That's all: HeyOrbit connects pages with this app directly.
(Alternatively, put the app in a custom Composio auth config with the scopes r_organization_social, w_organization_social and rw_organization_admin and set COMPOSIO_AUTH_CONFIG_LINKEDIN_PAGES.)
After that, the LinkedIn Page card on the Accounts page connects every page where the member is a Super admin or Content admin, the website and help pages start mentioning company pages, and members who pressed Notify me get a message. Until then the card explains that page access is on its way, and the regular LinkedIn card connects personal profiles.
When a platform becomes available, members who clicked Notify me get a notification during the next background sync.
Social platform apps without Zernio or Composio#
Without Zernio or Composio, you can register each platform's developer app yourself. The redirect URI for every provider is {APP_URL}/api/oauth/{provider}/callback, with provider one of x, linkedin, facebook, instagram, threads, tiktok, youtube, pinterest, google-business.
| Variable | Platform |
|---|---|
| X_CLIENT_ID, X_CLIENT_SECRET | X |
| LINKEDIN_CLIENT_ID, LINKEDIN_CLIENT_SECRET | |
| META_APP_ID, META_APP_SECRET | Facebook and Instagram (one Meta app) |
| META_WEBHOOK_VERIFY_TOKEN | Optional verify token for Meta webhooks at {APP_URL}/api/webhooks/meta, which trigger an inbox sync when comments or messages arrive (falls back to META_APP_SECRET) |
| THREADS_APP_ID, THREADS_APP_SECRET | Threads |
| TIKTOK_CLIENT_KEY, TIKTOK_CLIENT_SECRET | TikTok |
| GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET | YouTube, Google Business Profile and Google Drive imports |
| PINTEREST_APP_ID, PINTEREST_APP_SECRET |
Bluesky and Mastodon need no developer app: users connect with a handle and app password, or an instance and access token.
Media imports#
| Variable | Purpose |
|---|---|
| UNSPLASH_ACCESS_KEY | Unsplash search in the media picker and library |
| CANVA_CLIENT_ID, CANVA_CLIENT_SECRET | Canva imports |
| DROPBOX_APP_KEY | Dropbox imports |
| GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET | Google Drive imports (shared with YouTube and Google Business Profile) |
Storage#
| Variable | Purpose |
|---|---|
| AWS_ENDPOINT_URL_S3, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION, NEON_STORAGE_BUCKET | Neon Object Storage (bucket defaults to uploads) |
| R2_ACCOUNT_ID, R2_ACCESS_KEY_ID, R2_SECRET_ACCESS_KEY, R2_BUCKET, R2_PUBLIC_URL | Cloudflare R2 |
| BLOB_READ_WRITE_TOKEN | Vercel Blob |
The first configured backend wins, in that order; with none, files go to public/uploads (file storage).
Operator and demo#
| Variable | Purpose |
|---|---|
| ADMIN_USERNAME, ADMIN_PASSWORD | Sign-in for the operator console at /admin. Without a password a built-in default is used and the console shows a reminder: always set one in production |
| SEED_DEMO | true seeds the demo workspace on the first Vercel deploy when the database is empty |
| ENABLE_DEMO | true offers the Demo sandbox account in production (it's always offered in development) |
Example#
DATABASE_URL="postgresql://orbit:secret@db:5432/orbit"
APP_URL="https://social.example.com"
APP_SECRET="replace-with-32-plus-random-characters"
CRON_SECRET="another-long-random-string"
INPROCESS_SCHEDULER="false"
ANTHROPIC_API_KEY="sk-ant-..."
COMPOSIO_API_KEY="..."
ZERNIO_API_KEY="..."
SMTP_HOST="smtp.postmarkapp.com"
SMTP_PORT="587"
SMTP_USER="..."
SMTP_PASS="..."
EMAIL_FROM="Social Team <social@example.com>"