Strategies for deploying Shopify Apps. Focus on overcoming Vercel/Serverless timeouts, using VPS (Coolify/Dokku), and handling long-running background jobs.
Deploying Shopify apps is different from standard websites because of Webhooks, Admin API Rate Limits, and OAuth handshakes.
Vercel Serverless functions have a timeout (usually 10s-60s).
504 Gateway Timeout and broken installs.Defer in Remix to stream UI while backend works (but doesn't fix hard timeouts for the main thread).Deploying to a persistent server (Fly.io, Railway, DigitalOcean, Hetzner) eliminates timeouts.
Ensure these are set in your CI/CD or platform secrets:
SHOPIFY_API_KEYSHOPIFY_API_SECRETSCOPES (must match exactly what's in code)SHOPIFY_APP_URL (The public HTTPS URL, e.g., https://app.mytitle.com)DATABASE_URLRun migrations during the build or as a release phase command.
release_command in fly.toml.npx prisma migrate deploy in the CMD script before starting the app.Ensure you build for production:
npm run build
# Ensure this runs `remix build` and copies necessary public assets
Excellent for Shopify apps due to global regions and Docker support.
fly.toml example:
[build]
dockerfile = "Dockerfile"
[env]
PORT = "3000"
[http_service]
internal_port = 3000
force_https = true
auto_stop_machines = true
auto_start_machines = true
If you want to save money ($5/mo for a powerful VPS).
You MUST have a strategy for background jobs.
redis-bullmq skill).