Shopify CLI Production Deployment: AI-Optimized Technical Reference
Critical Failure Points
Primary Deploy Failure Causes
- Dev-to-prod transition:
shopify app dev
cannot be used for production deployment - TOML configuration errors: Mismatched
application_url
causes authentication loops (6+ hour debugging time) - Token expiry: CLI tokens expire every 60-90 days without warning, typically during critical deployments
- Missing
--force
flag: Causes 10-minute hangs in CI/CD waiting for interactive confirmation
Configuration Requirements
TOML File Structure (Production)
# shopify.app.prod.toml
name = "your-app"
client_id = "your_client_id"
application_url = "https://your-actual-domain.com" # MUST match deployment URL exactly
[build]
automatically_update_urls_on_dev = false # CRITICAL for production
[app_proxy]
url = "https://your-actual-domain.com/api/proxy"
Critical Warning: application_url
must match deployment domain exactly. Mismatches cause authentication loops.
Required Environment Variables
SHOPIFY_CLI_PARTNERS_TOKEN="shpca_abcd1234..." # Expires 60-90 days
SHOPIFY_APP_URL="https://your-actual-domain.com"
DATABASE_URL="postgresql://user:pass@host:5432/db" # SQLite resets on deploy
SESSION_SECRET="super-long-random-string-minimum-32-chars"
Database Persistence Reality
Database Type | Cost | Data Persistence | Concurrent Users | Production Viability |
---|---|---|---|---|
SQLite | Free | ❌ Wipes on deploy | Single user | Development only |
Render PostgreSQL | $7/month | ✅ Persistent | Unlimited | Production ready |
Supabase | Free tier | ✅ Persistent | Good performance | Production ready |
Critical: SQLite files are deleted on every container deployment. Use PostgreSQL for production.
Production-Ready GitHub Actions Configuration
name: Deploy to Production
on:
push:
branches: [main]
workflow_dispatch:
env:
NODE_VERSION: 20
jobs:
deploy:
name: Deploy App
runs-on: ubuntu-latest
environment: production # Enables approval gates
timeout-minutes: 15 # Prevents infinite hangs
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Install Shopify CLI
run: npm install -g @shopify/cli@3.84.1
- name: Deploy with retry logic
env:
SHOPIFY_CLI_PARTNERS_TOKEN: ${{ secrets.SHOPIFY_CLI_PARTNERS_TOKEN }}
SHOPIFY_APP_URL: ${{ secrets.SHOPIFY_APP_URL }}
run: |
for attempt in 1 2 3; do
if shopify app deploy --config=production --force --verbose; then
echo "✅ Deployment successful on attempt $attempt"
exit 0
else
echo "❌ Attempt $attempt failed, retrying in 30 seconds..."
sleep 30
fi
done
echo "💥 All deployment attempts failed"
exit 1
Required GitHub Secrets
SHOPIFY_CLI_PARTNERS_TOKEN
: Generated in Partner Dashboard, expires without warningSHOPIFY_APP_URL
: Must match TOML configuration exactlyDATABASE_URL
: PostgreSQL connection stringSESSION_SECRET
: Minimum 32 characters
Environment Protection Setup
Location: GitHub Settings > Environments > production
- Required reviewers: Minimum 1 team member for 3am emergencies
- Wait timer: 10 minutes (catches obvious errors)
- Branch protection: Only allow deployments from
main
Common Production Failures and Solutions
Authentication Failures
Error: Authentication failed
- Cause: Token expired (60-90 day lifecycle)
- Solution: Generate new token in Partner Dashboard > Settings > CLI Tokens
- Prevention: Monitor token age, maximum 2 active tokens per account
App Configuration Errors
Error: App not found
- Cause: Wrong
client_id
in TOML or token for wrong organization - Solution: Verify dev/prod apps are separate in Partner Dashboard
Error: Invalid configuration
- Cause:
application_url
mismatch between TOML and actual deployment - Solution: Update TOML to match exact deployment URL
Deployment Hangs
Error: Command hangs for 10+ minutes
- Cause: Missing
--force
flag, waiting for interactive confirmation - Solution: Always use
shopify app deploy --config=production --force
- Prevention: Set
timeout-minutes: 15
in GitHub Actions
Database Issues
Error: Data disappears after deployment
- Cause: Using SQLite in ephemeral containers
- Solution: Migrate to PostgreSQL with persistent storage
- Cost: Render PostgreSQL $7/month vs free SQLite
Emergency Rollback Process
No CLI rollback command exists
Manual Rollback Steps
- Navigate to Partner Dashboard > Apps > [Your App] > App versions
- Click "Make current" on last working version
- Wait 2-5 minutes for global propagation
- Fix issue locally and redeploy
Critical: This only rolls back Shopify configuration. Hosting platform (Render/Heroku) requires separate git-based rollback.
Rollback Preparation
- name: Tag release
run: git tag "release-$(date +%Y%m%d-%H%M%S)"
Resource Requirements
Time Investment
- Initial setup: 4-6 hours including trial-and-error
- Failed deployment debugging: 2-6 hours per incident
- Token expiry resolution: 30 minutes (if prepared)
Expertise Requirements
- Basic: Understanding of environment variables and CI/CD concepts
- Intermediate: TOML configuration and GitHub Actions workflow management
- Advanced: Database migration and rollback procedures
Financial Costs
- Minimum viable: $7/month (Render PostgreSQL)
- GitHub Actions: 2000 free minutes/month (timeout prevention critical)
- Shopify Partner: Free for development
Breaking Points and Warnings
Production Load Thresholds
- SQLite: Single concurrent user maximum
- PostgreSQL: Scales with hosting plan, generally unlimited for typical Shopify apps
Critical Dependencies
- CLI version: Pin to specific version (e.g., @shopify/cli@3.84.1) to prevent surprise breaks
- Node.js version: Use LTS versions only (Node 20 recommended)
- Token management: Maximum 2 active tokens per Partner account
Hidden Failure Modes
- Environment variable persistence:
.env
files don't deploy, must set in hosting dashboard - SSL certificate issues: Development tunneling conflicts with production SSL
- Interactive prompts: Any CLI command without
--force
will hang in CI/CD
Success Indicators
- Deployment completes in under 5 minutes
- No authentication loops after deployment
- Database persists through deployments
- Rollback process tested and documented
- Token expiry monitoring in place
Useful Links for Further Investigation
Links That Actually Helped
Link | Description |
---|---|
CI/CD Deployment Guide | Covers basics but skips the retry logic you actually need |
CLI Authentication | Token setup, read this twice because the expiry part is buried |
App Configuration | TOML file reference, bookmark this because you'll need it at 2am |
Partner Dashboard | Where you generate tokens and roll back broken deployments |
Render | PostgreSQL included, works out of the box, use this unless you have specific requirements |
GitHub Actions Docs | Environment protection setup, read before you accidentally deploy to prod |
Shopify CLI on npm | Check version updates here when CLI breaks randomly |
Shopify CLI GitHub Issues | When Google fails, check here for your exact error message |
Shopify Community Forums | Other developers sharing deployment horror stories |
Stack Overflow - Shopify CLI | The usual collection of "authentication failed" threads |
Related Tools & Recommendations
npm Threw ERESOLVE Errors Again? Here's What Actually Works
Skip the theory bullshit - these fixes work when npm breaks at the worst possible time
Major npm Supply Chain Attack Hits 18 Popular Packages
Vercel responds to cryptocurrency theft attack targeting developers
npm - The Package Manager Everyone Uses But Nobody Really Likes
It's slow, it breaks randomly, but it comes with Node.js so here we are
GitHub Desktop - Git with Training Wheels That Actually Work
Point-and-click your way through Git without memorizing 47 different commands
GitOps Integration Hell: Docker + Kubernetes + ArgoCD + Prometheus
How to Wire Together the Modern DevOps Stack Without Losing Your Sanity
AI Coding Assistants 2025 Pricing Breakdown - What You'll Actually Pay
GitHub Copilot vs Cursor vs Claude Code vs Tabnine vs Amazon Q Developer: The Real Cost Analysis
AI Systems Generate Working CVE Exploits in 10-15 Minutes - August 22, 2025
Revolutionary cybersecurity research demonstrates automated exploit creation at unprecedented speed and scale
I Ditched Vercel After a $347 Reddit Bill Destroyed My Weekend
Platforms that won't bankrupt you when shit goes viral
TensorFlow - End-to-End Machine Learning Platform
Google's ML framework that actually works in production (most of the time)
GitHub Actions Marketplace - Where CI/CD Actually Gets Easier
integrates with GitHub Actions Marketplace
GitHub Actions Alternatives That Don't Suck
integrates with GitHub Actions
GitHub Actions + Docker + ECS: Stop SSH-ing Into Servers Like It's 2015
Deploy your app without losing your mind or your weekend
VS Code 1.103 Finally Fixes the MCP Server Restart Hell
Microsoft just solved one of the most annoying problems in AI-powered development - manually restarting MCP servers every damn time
GitHub Copilot + VS Code Integration - What Actually Works
Finally, an AI coding tool that doesn't make you want to throw your laptop
Cursor AI Review: Your First AI Coding Tool? Start Here
Complete Beginner's Honest Assessment - No Technical Bullshit
Shopify Polaris - Stop Building the Same Components Over and Over
integrates with Shopify Polaris
phpMyAdmin - The MySQL Tool That Won't Die
Every hosting provider throws this at you whether you want it or not
Google NotebookLM Goes Global: Video Overviews in 80+ Languages
Google's AI research tool just became usable for non-English speakers who've been waiting months for basic multilingual support
Microsoft Windows 11 24H2 Update Causes SSD Failures - 2025-08-25
August 2025 Security Update Breaking Recovery Tools and Damaging Storage Devices
Which JavaScript Runtime Won't Make You Hate Your Life
Two years of runtime fuckery later, here's the truth nobody tells you
Recommendations combine user behavior, content similarity, research intelligence, and SEO optimization