Setting Up the Shopware 6 Background Queue Worker (Unmanaged Server)
This article covers the setup and management of the Shopware 6 Background Queue Worker for servers at the “Unmanaged” support level. If you have ordered your Shopware server at the “Managed” support level, please refer to the following article: Setting Up the Shopware 6 Background Queue Worker (Managed Server)
Shopware 6 uses so-called Message Queue Workers to process background tasks and recurring tasks. In the default configuration of Shopware 6, these are executed by the logged-in administrator in the browser. As soon as more than one administrator is logged in, these Message Queue Workers are executed multiple times, which can lead to a very high CPU load and problems with PHP execution.
To permanently resolve this issue, Shopware 6 offers the option to move the execution of these Message Queue Workers to the background—more specifically, as a CLI command.
Disabling Frontend Message Queue Workers
To disable the Shopware 6 Message Queue Workers for logged-in administrators, you must create a zz-creoline.yaml configuration file as the system user in the Shopware directory /config/packages.
To do this, first log in as the system user:
su -l <SYSTEM USER> Now create the configuration file:
nano config/packages/zz-creoline.yaml Tip: On our Managed Shopware servers, the correct document root directory is located at the absolute path: /var/www/vhosts/my-shop-domain.de/httpdocs/
# /var/www/vhosts/my-shop-domain.de/httpdocs/config/packages/zz-creoline.yaml
shopware:
admin_worker:
enable_admin_worker: false After the config file has been created, the Shopware cache must be cleared so that the new configuration file takes effect:
bin/console cache:clear Please ensure that Shopware bin/console commands are always run as the system user.
On our Managed Shopware servers, various PHP binaries are available for running the CLI console. To clear the cache using the PHP 8.2 CLI, run the following command:
/opt/plesk/php/8.4/bin/php /var/www/vhosts/my-shop-domain.de/httpdocs/bin/console cache:clear Setting Up the Message Queue Worker as a Supervisor Service (Recommended)
Solution 1
To ensure the Message Queue Worker runs continuously, we recommend setting it up as a Supervisor service. To do this, the following files must be created:
touch /etc/supervisor/conf.d/shopware-tasks.conf # /etc/supervisor/conf.d/shopware-tasks.conf
# Copyright (C) 2025 creoline GmbH
# Supervisor Service - Shopware 6
# Version: 1.0.4
# Shopware Consumer
[program:shopware-consumer]
process_name=%(program_name)s_%(process_num)02d
numprocs=1
command=/opt/plesk/php/8.3/bin/php /var/www/vhosts/__DOMAIN__/httpdocs/bin/console messenger:consume async failed low_priority --time-limit=120 --memory-limit=512M
environment=MESSENGER_CONSUMER_NAME="shopware_consumer_%(process_num)02d"
user=__SSH_USERNAME__
autostart=true
autorestart=true
startsecs=5
startretries=10
stopwaitsecs=3600
redirect_stderr=true
stdout_logfile=/var/log/supervisor/%(program_name)s.log
# Shopware Scheduled Tasks
[program:shopware-scheduled-tasks]
process_name=%(program_name)s_%(process_num)02d
numprocs=1
command=/opt/plesk/php/8.3/bin/php /var/www/vhosts/__DOMAIN__/httpdocs/bin/console scheduled-task:run --time-limit=120 --memory-limit=512M
user=__SSH_USERNAME__
autostart=true
autorestart=true
startsecs=5
startretries=10
stopwaitsecs=3600
redirect_stderr=true
stdout_logfile=/var/log/supervisor/%(program_name)s.log Next, replace the variables __SSH_USERNAME__ and __DOMAIN__ with the SSH system user of your Shopware instance and the domain of your instance.
sed -i 's/__SSH_USERNAME__/creoline-demo-user/g' /etc/supervisor/conf.d/shopware-tasks.conf
sed -i 's/__DOMAIN__/creoline-demo.com/g' /etc/supervisor/conf.d/shopware-tasks.conf Then restart Supervisor:
systemctl restart supervisor.service Setting Up the Message Queue Worker as a systemd Service
Solution 2
To ensure that the Message Queue Worker runs continuously, you can also set it up as a systemd service. To do this, you must create two systemd service files:
touch /etc/systemd/system/shopware_consumer.service
touch /etc/systemd/system/shopware_scheduled_tasks.service Next, define the Shopware Message Queue Consumer as follows:
# /etc/systemd/system/shopware_consumer.service
[Unit]
Description=Shopware Message Queue Consumer
After=mysql.service
StartLimitIntervalSec=0
[Service]
Type=simple
User=ssh_example_user
Restart=always
RestartSec=10
ExecStart=/opt/plesk/php/8.4/bin/php /var/www/vhosts/my-shop-domain.de/httpdocs/bin/console messenger:consume async failed --time-limit=120 --memory-limit=512M
[Install]
WantedBy=multi-user.target If you are using an older version of Shopware, you must add the default receiver here instead. Example for the default receiver:
ExecStart=/opt/plesk/php/8.3/bin/php /var/www/vhosts/my-shop-domain.de/httpdocs/bin/console messenger:consume failed default --time-limit=120 --memory-limit=512MIf you have registered more than one receiver, you can list multiple receivers one after another or define a separate service for each receiver. Example for multiple receivers:
messenger:consume default receiver2 fasttrackTo edit the file, you can use the preinstalled text editor nano or vi. Example for opening and editing the file:
nano /etc/systemd/system/shopware_consumer.service Then paste the content shown above from the clipboard and save the changes using the keyboard shortcut CTRL + X. Finally, confirm the file changes by pressing Y and Enter.
Important: Make sure the directory paths and system users are specified correctly. In this example, the installation is located in the directory /var/www/vhosts/my-shop-domain.de/. This directory is for illustrative purposes only and must be adjusted to the correct path of your installation.
In addition to the Consumer Service, the service for recurring tasks is also required:
# /etc/systemd/system/shopware_scheduled_tasks.service
[Unit]
Description=Shopware Scheduled Tasks Runner
After=mysql.service
StartLimitIntervalSec=0
[Service]
Type=simple
User=ssh_example_user
Restart=always
RestartSec=10
ExecStart=/opt/plesk/php/8.3/bin/php /var/www/vhosts/my-shop-domain.de/httpdocs/bin/console scheduled-task:run --time-limit=120 --memory-limit=512M
[Install]
WantedBy=multi-user.target Important: You must also specify the correct directory and the appropriate system user for your Shopware 6 installation in the Scheduled Tasks service.
Once both services have been set up, all that’s left is to start them:
systemctl start shopware_consumer
systemctl start shopware_scheduled_tasks
systemctl enable shopware_consumer
systemctl enable shopware_scheduled_tasks Tip: If changes are made to one or more systemd services at a later time, you must run the command systemctl daemon-reload for the recent changes to take effect.