Production Deployment Checklist
Before launching a ProcessWire 3 site running trk/ modules to production, walk through this operational checklist so background tasks, webhooks, media pipelines, and security boundaries run reliably.
1. System Cron & Background Queue Workers
Section titled “1. System Cron & Background Queue Workers”Several modules rely on trk/processwire-console for scheduled maintenance (AccountPruneTask, ExpireCharterHoldsTask, ContactsRetentionTask, PruneAiUsageLogsTask, Currency FX sync) and background queues (BulkTranslateQueue, DeliverHeadlessWebhookQueue, ExportProfileQueue, VectorIndexQueue, Campaign sendouts):
-
Schedule ProcessWire’s cron runner every minute:
Terminal window * * * * * cd /var/www/aegeanvoyages.example && /usr/bin/php vendor/bin/wire schedule:run >> /var/log/pw-schedule.log 2>&1 -
Run a supervised background queue worker (
systemdorsupervisord):Terminal window php vendor/bin/wire queue:work --tries=3 --sleep=3 --max-time=3600 -
Verify queue and schedule health from Setup -> Console (or via CLI):
Terminal window php vendor/bin/wire schedule:list --json
2. Runtime & PHP Extensions
Section titled “2. Runtime & PHP Extensions”| Requirement | Production Recommendation |
|---|---|
| PHP Version | 8.4+ with OPcache enabled (opcache.validate_timestamps=0 on immutable deploys). |
| Required Extensions | ext-pdo_mysql (or pdo_sqlite), ext-curl, ext-openssl, ext-mbstring, ext-bcmath (Currency), ext-intl (Currency/Payments), ext-zip (ProcessReactExportProfile/Packages). |
| Fast Image Processing | Install libvips + ext-ffi (ffi.enable=true or preload) for InterventionImage so WebP/AVIF encoding uses minimal RAM. |
Strong userAuthSalt |
Keep $config->userAuthSalt >= 32 random characters in site/config.php (used by Htmx HKDF state signing, Charter HMAC proposals, and Account). |
3. Frontend Builds & Caching
Section titled “3. Frontend Builds & Caching”-
Remove dev
hotfiles: Never deploysite/templates/hot(or any VitehotFile) to production; add it to.gitignoresoVitealways serves hashed manifest bundles. -
Keep
$config->debug = false: Disables TracyDebugger bars, stack traces, and verbose debug headers in production. -
Clear compiled caches on deploy:
Terminal window php vendor/bin/wire cache:clearphp vendor/bin/wire htmx:cache:clear --force --json
4. Security & Backup Hardening
Section titled “4. Security & Backup Hardening”| Area | Action |
|---|---|
| CORS & CSP | Replace wildcard * in Setup -> Headless -> Settings -> CORS Origins with exact production origins; pass per-request CSP nonces via vite()->copy()->useNonce($nonce). |
| Secrets | Store API keys via $env:VAR_NAME references or encrypted SecretBox / write-only fields. Verify zero leaks with php vendor/bin/wire profile:audit --json. |
| RBAC Separation | Assign least-privilege role permissions (ai-use instead of ai-admin, charter-manage instead of charter-admin, per-section wire-console-*). |
| Automated Backups | Schedule regular SQL snapshots (php vendor/bin/wire db:backup) and prune aged dumps (php vendor/bin/wire backup:purge --days=30). |
5. Installing 6-Locale Translation Packs (languages/*.csv)
Section titled “5. Installing 6-Locale Translation Packs (languages/*.csv)”Most trk/ modules ship bundled 6-locale CSV translation packs (en, tr, de, fr, es, ru) inside site/modules/<Module>/languages/:
- Install ProcessWire core LanguageSupport (Modules -> Core -> Language Support).
- Create or open your target language under Setup -> Languages -> [Language].
- Under Site Translation Files, upload or select the matching
<locale>.csvfile fromsite/modules/<Module>/languages/(for exampletr.csvorde.csv) and click Save. - Both server-rendered ProcessWire screens and React workspace interfaces immediately pick up the active user’s language.
6. Full-Page Cache & ProCache Exclusions
Section titled “6. Full-Page Cache & ProCache Exclusions”Never serve cached HTML across users for routes containing per-session CSRF tokens, signed state payloads, or authenticated member data. Exclude these URL prefixes from ProCache, Varnish, or CDN HTML caching:
| Module | Routes / Pages to Exclude From Full-Page HTML Cache |
|---|---|
Account |
/auth/*, /account/* |
Forms |
/_forms/* (or enable AJAX token fetch so FormsFrontend.js requests /_forms/token/{slug} dynamically) |
Htmx |
/hx/req (and any dynamic Component endpoints) |
Payments |
/pay/*, /_payments/* |
Packages |
/portal/*, /composer/*, /packages/api/* |
Ai |
/_ai/* |
Headless |
/api/* |
Campaign |
/_campaign/* |
7. Nginx & Apache Server Rules
Section titled “7. Nginx & Apache Server Rules”Protect private storage directories from direct HTTP downloads and forward Authorization headers to PHP-FPM/FastCGI:
# Block direct downloads of Packages release ZIPs and Media private vaultslocation ^~ /site/assets/packages/ { return 403;}location ^~ /site/assets/files/media-vault/ { return 403;}# Preserve Authorization: Bearer headers for Headless API and Packages Composer authRewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]8. Dev -> Staging -> Production Deployment Workflow
Section titled “8. Dev -> Staging -> Production Deployment Workflow”- Commit to Git: File-backed
Entriesblueprints (site/entries/*.yaml),Formsblueprints (site/forms/*.yaml),Blocksdefinitions (site/blocks/),Navigationexported JSON menus, schema migrations (site/migrations/), and compiled Vite bundles (site/templates/build/). - Keep out of Git (use
$env:VAR): API keys, webhook secrets, SMTP passwords, OAuth client secrets, and database credentials. Reference them in module settings as$env:STRIPE_SECRET_KEY,$env:OPENROUTER_API_KEY, etc. - On every deploy: Run
php vendor/bin/wire migrate --force,php vendor/bin/wire cache:clear, and your module doctor checks (entries:doctor,payments:doctor,seo:audit,ai:doctor) with--json.