Magento reference
Reference for running Magento 2 (Adobe Commerce) on TurboStack: where the files live, the command-line tool, and the scheduled jobs. For setup see Deploy Magento; for tuning see Magento best practices.
File layout
Everything lives under your system user's home directory. ~ is that home directory (for example /var/www/prod/). Run every bin/magento command from ~/public_html.
For ownership and permissions, see Application file layout and permissions.
Command-line reference
Magento ships a command-line interface (CLI) at bin/magento. Run php bin/magento list for the full list; the common commands are below.
Tip
After deploying code on a production store, run setup:upgrade --keep-generated -> setup:di:compile -> setup:static-content:deploy -> cache:flush. See Magento best practices.
Full-page cache debugging
Magento's built-in full-page cache adds an X-Magento-Cache-Debug response header: HIT means the page was served from cache, MISS means it was rendered fresh. The header appears only in developer mode (bin/magento deploy:mode:set developer) and is suppressed in production. Check it over SSH:
curl -sI https://example.com/ | grep -i x-magento-cache
With Varnish in front, use the Varnish cache headers instead.
Note
In production, static files are pre-generated with setup:static-content:deploy. You can allow on-demand generation by adding 'static_content_on_demand_in_production' => 1 to app/etc/env.php, but Adobe recommends against this on live stores because it adds latency on the first request for each uncached asset.
Cron and message-queue consumers
TurboStack installs the Magento cron entries for your system user automatically (bin/magento cron:run, setup:cron:run and the updater). These drive indexing, emails and scheduled jobs. Do not disable cron on a live store.
On a busy store, run each message-queue consumer as a persistent user system service so it restarts on failure, rather than relying on cron alone. The Magento consumer template unit and the exact systemctl --user commands are in Magento best practices.
Related
- Deploy Magento
- Magento best practices
- How to run multiple Magento store views
- Troubleshooting Magento
- Application file layout and permissions
- How to manage user system services