Skip to main content

Overview

Fly.io hosts and executes your Shopify extension deployments. Each generation triggers a Fly.io build that compiles your code and deploys it to Shopify.

Why Fly.io?

Zero Config

Automatic setup
  • Detects build tools
  • Configures environment
  • Manages dependencies
  • Handles secrets

Fast Builds

Quick deployments
  • Cached layers
  • Parallel builds
  • Instant rollback
  • Hot reloading

GitHub Integration

Seamless connection
  • Auto-detects pushes
  • Branch deployments
  • PR previews
  • Commit tracking

Shopify CLI

Built-in tools
  • Shopify CLI installed
  • Deploy commands
  • Extension bundling
  • Version management

Setup Process

1

Create Fly.io Account

Sign up for Fly.io:
  1. Go to fly.io
  2. Click “Start a New Project”
  3. Sign in with GitHub
  4. Authorize Fly.io app
2

Generate Fly.io Token

Create API token:
  1. Go to Account Settings → Tokens
  2. Click “Create New Token”
  3. Name it “Synapse Deployment”
  4. Copy the token
3

Add Token to Synapse

Configure in dashboard:
  1. Go to Settings → Integrations
  2. Find Fly.io section
  3. Paste API token
  4. Click “Connect Fly.io”
4

Project Created

Synapse automatically creates:
  • Fly.io project per user
  • Service per generation
  • Environment variables
  • GitHub integration

Fly.io paid planject Structure

Your Fly.io setup:

How Fly.io Builds Work

1

GitHub Push

Code pushed to repository triggers Fly.io
2

Build Detection

Fly.io uses buildpacks to detect:
  • Language (Node.js, Rust, etc.)
  • Package manager (npm, pnpm, yarn)
  • Build commands
  • Start commands
3

Dependency Install

Installs packages:
4

Extension Build

Compiles extension:
5

Shopify Deploy

Deploys to Shopify:
6

Completion

Extension live in your dev store

Environment Variables

Fly.io automatically configures:

Adding Custom Variables

Add your own environment variables:
  1. Open your Fly.io project
  2. Select service
  3. Go to Variables tab
  4. Click “New Variable”
  5. Enter name and value
  6. Click “Add”
  7. Redeploy service

buildpacks Build Configuration

Fly.io uses buildpacks for builds. Customize in fly.toml:

Viewing Logs

Monitor deployments in real-time:
  1. Open Fly.io project
  2. Select service
  3. Click “Deployments” tab
  4. Click specific deployment
  5. View build and runtime logs
Log output:

Managing Services

See all deployed services:
Each generation gets its own service for isolation
Manually restart a service:
Useful for applying new environment variables
Remove unused services:
Frees up project resources
Monitor performance:
  • CPU usage
  • Memory consumption
  • Network traffic
  • Build duration
  • Deployment frequency
Available in Fly.io dashboard under Metrics tab

Deployment Strategies

Every push triggers immediate deployment:Pros:
  • Fast feedback
  • Always up-to-date
  • No manual steps
Cons:
  • May deploy broken code
  • No review process
Best for: Development, rapid iteration

Cost Management

Fly.io pricing and optimization:

Free Tier

  • $5 free credit per month
  • Pauses after 500 hours
  • Shared resources
  • Community support

Pro Plan ($20/month)

  • $20 credit included
  • Usage-based billing
  • Dedicated resources
  • Priority support

Optimization Tips

Remove Unused Services

Delete old generation services to save resources

Use Sleep Mode

Configure services to sleep when inactive

Optimize Builds

Cache dependencies, minimize build time

Monitor Usage

Track resource consumption in dashboard

Advanced Configuration

Use custom Docker build instead of buildpacks:
Fly.io automatically detects and uses Dockerfile
Optimize image size:
Trigger actions on deployment events:
  1. Service → Settings → Webhooks
  2. Add webhook URL
  3. Select events:
    • Deployment started
    • Deployment succeeded
    • Deployment failed
  4. Receive JSON payload

Troubleshooting

Error: Build fails during npm install or compilationCauses:
  • Missing dependencies
  • Node version mismatch
  • Memory limit exceeded
Solutions:
  • Check package.json
  • Specify Node version in package.json:
  • Review build logs for specific errors
  • Upgrade to Pro plan for more resources
Error: Deployment exceeds time limitCauses:
  • Large extension bundle
  • Slow Shopify API
  • Network issues
Solutions:
  • Optimize bundle size
  • Retry deployment
  • Increase timeout in fly.toml:
Error: SHOPIFY_CLIENT_ID not foundCauses:
  • Variables not configured
  • Service not linked to project
Solutions:
  • Verify variables in dashboard
  • Re-add via Fly.io CLI:
  • Redeploy service

Next Steps

GitHub Integration

Configure GitHub connection

Deployment Pipeline

Understand the full pipeline

Debugging

Debug deployment issues

Best Practices

Optimize your workflow