Deployment

Fly.io + Meridian

Deploy Meridian on Fly.io with secrets management, persistent volumes, and global edge routing. Zero-downtime deploys with a single fly deploy.

Prerequisites

  • flyctl installed and authenticated (fly auth login)
  • Meridian source cloned and Dockerfile present at project root
  • Fly.io account with payment method (free tier covers small apps)

Step 1 — Launch the app

fly launch \
  --name meridian \
  --region iad \
  --now

This creates fly.toml and provisions the app in the Ashburn (iad) region. Omit --now to review the generated config first.

Step 2 — Set secrets

Meridian requires several environment variables. Use fly secrets set to store them encrypted at rest.

fly secrets set \
  DATABASE_URL="postgresql://..." \
  UPSTASH_REDIS_REST_URL="https://..." \
  UPSTASH_REDIS_REST_TOKEN="..." \
  NIMBUS_LICENSE_KEY="mk-..." \
  NIMBUS_API_SECRET="..." \
  NEXT_PUBLIC_APP_URL="https://meridian.fly.dev"

Important: Secrets are immutable once set. To update a secret, use fly secrets set KEY=newvalue — it overwrites the existing value.

Step 3 — Persistent volume (optional)

If Meridian writes local state (uploads, SQLite, cache), attach a volume. Add to fly.toml:

[mounts]
  source="meridian_data"
  destination="/app/data"
fly volumes create meridian_data \
  --region iad \
  --size 1

Step 4 — Deploy

fly deploy --ha=false

Single-instance deploys use --ha=false to skip the two-machine requirement. For production, scale to 2+ machines and enable HA.

Step 5 — Verify

fly status
fly logs

Visit https://meridian.fly.dev. Check logs for any startup errors — Next.js 14 outputs the listening port on boot.

Quick reference

CommandPurpose
fly secrets listList secret names (values hidden)
fly secrets unset KEYRemove a secret
fly scale count 2Scale to 2 machines
fly regions listShow available regions
fly certs create meridian.fly.devProvision TLS certificate