Shopware reference
Reference for running Shopware 6 on TurboStack: where the files live, the command-line tool, and the scheduled jobs. For setup see Deploy Shopware on TurboStack; for tuning see Shopware best practices.
File layout
Everything lives under your system user's home directory. ~ is that home directory (for example /var/www/prod/). The base directory is ~/shopware/, which can be symlinked for release-based deployments.
For ownership and permissions, see Application file layout and permissions.
Command-line reference
Shopware ships a command-line interface (CLI) at bin/console. Run every command from the Shopware base directory ~/shopware/. The common commands are below.
To clear all caches, run the application cache and the shared caches together:
cd ~/shopware && bin/console cache:clear
tscli redis clear
tscli varnish clear
tscli redis clear and tscli varnish clear use the TurboStack CLI.
To update Shopware, update the dependencies and then finish the update:
cd ~/shopware && composer update && bin/console system:update:finish
Cron and background workers
Shopware needs its scheduled tasks run regularly. Add a cron entry for your system user - for example every 5 minutes:
*/5 * * * * cd ~/shopware && bin/console scheduled-task:run >> ~/logs/scheduled-task.log 2>&1
The message queue is processed with bin/console messenger:consume. On a busy store, run the consumer as a persistent user system service so it restarts on failure. See How to manage user system services.
Cart storage in Redis (optional)
By default Shopware stores the cart in the database. On a high-traffic store you can move the cart to Redis to reduce database writes during checkout. Point it at the persistent Redis instance (port 6378) so carts are not lost when the cache is flushed, and give it its own database index. The configuration key changed in Shopware 6.6.8.0.
On Shopware 6.6.8.0 and later, define a named connection and point the cart storage at it in config/packages/shopware.yaml:
shopware:
redis:
connections:
persistent:
dsn: 'redis://localhost:6378/3'
cart:
storage:
type: 'redis'
config:
connection: 'persistent'
On Shopware 6.5 and early 6.6 releases, use the single redis_url key instead:
shopware:
cart:
redis_url: 'redis://localhost:6378/3'
Cart lifetime is controlled by shopware.cart.expire_days (default 120). After switching the storage backend, migrate existing carts out of the database:
bin/console cart:migrate sql
Related
- Deploy Shopware on TurboStack
- Shopware best practices
- Troubleshooting Shopware
- Application file layout and permissions
- How to manage user system services