How to Set Up a Queue Worker for Laravel Applications

Updated November 22, 2026 · 4 min read

Summarize with:
Share:

A queue worker runs your Laravel app’s background jobs, such as sending emails or processing uploads, so your pages keep responding quickly while that work runs. In xCloud you add and manage queue workers from the Laravel Queue card of your Laravel site, and xCloud keeps each worker running for you.

Follow these steps to set up a queue worker for a Laravel application. If your Laravel app isn’t on xCloud yet, start with how to deploy Laravel applications.

Step 1: Open your Laravel site’s Application page

Log in to xCloud and open Sites, then select your Laravel site. In the site menu, go to ‘Laravel’ → ‘Application’. The Laravel Queue card shows “Not Configured” until you add a worker. Click ‘Add Queue Worker’.

Click ‘Add Queue Worker’ on the Laravel Queue card under Laravel → Application

Step 2: Add a queue worker

The Add Queue Worker form opens. Fill in these fields:

  1. Connection: the queue connection your app uses, for example database or redis.
  2. Queue: the queue name(s) to process, for example default.
  3. Maximum Seconds Per Job: how long one job may run before it stops. 0 means no time limit.
  4. Maximum Memory (Optional): the memory limit for the worker, in MB.
  5. Number of Processes: how many worker processes run side by side.

Click ‘Add Queue Worker’ to create the worker.

Fill in the Add Queue Worker form and click ‘Add Queue Worker’

Step 3: Check and manage the queue worker

The worker appears in the Laravel Queue table with its connection, queue, timeout, number of processes and status. When its Status shows Running, it is processing jobs. Use the icons under Actions to manage it:

  • Edit Process: opens the worker’s settings on the server’s Supervisor page, where you change them and save.
  • Restart Process: restart the worker.
  • View Output: read the worker’s recent output, useful when jobs fail.
  • Delete: stop the worker and remove it.

The Actions icons for a running queue worker on the Laravel Queue card

If the status doesn’t turn Running, click the refresh icon next to it, then open View Output to see why the worker stopped. A wrong connection or queue name is the usual cause: fix it with Edit Process.

Want to watch your queues on a dashboard? See the Laravel Horizon setup guide to install and configure Horizon.

Restart workers after each deployment

A running worker keeps the code it started with. To make it pick up new code after each deployment, add this command to the Deploy Script field on your site’s Git page, then click Save and deploy:

$XCLOUD_PHP artisan queue:restart

Each worker finishes its current job and then restarts with the new code. If you run your queues through Horizon instead, use $XCLOUD_PHP artisan horizon:terminate.

Read the official Laravel documentation for more on queue workers and deployments.

Manage queue workers from an AI assistant (MCP)

An AI assistant connected over xCloud MCP can add, change and stop the queue workers of your Laravel sites, not only list them. You ask in plain words, for example “Add a queue worker for the emails queue on example.com with 2 processes”, and the assistant does the rest after you confirm.

Every change waits for your yes. Before anything runs, the assistant shows a preview that names the site, the worker and the exact settings it will use (connection, queue, time limit, memory and number of processes). The change runs once, only after you confirm that preview. To make the same change again, the assistant asks for a new preview, so one approval never runs twice.

To use it, all of these must be true:

  • Two-factor authentication is on for your xCloud account. See how to set up two-factor authentication.
  • Your team role allows running commands on the site and changing its settings. A team owner or admin sets this in team roles and permissions.
  • The connection can make changes. With a browser sign-in, approve it with Full access — read & write. With an API key, tick commands:run and mcp:invoke on the key: Full Access alone includes neither. See how to access the xCloud API.

If one of these is missing, xCloud refuses the change and nothing on the server changes. A connection approved as Read-only can still list your queue workers but can’t change them. To connect your assistant, follow how to connect xCloud MCP to an AI agent.

If the server rejects a confirmed change, the worker stays on the Laravel Queue card so you can fix it from the dashboard: a failed edit keeps the old settings, and a failed start keeps the new worker listed so you can edit, restart or delete it.

To make a copy of your Laravel app for staging or on another server, see how to clone a Laravel app with xCloud.

Frequently asked questions

Can an AI assistant start or stop my queue workers?

Yes. An assistant connected over xCloud MCP can add, change and stop the queue workers of a Laravel site. Each change first shows a preview naming the site, the worker and its settings, and runs once only after you confirm it.

Why does my AI assistant get refused when it tries to change a queue worker?

Check four things: two-factor authentication is on for your account, your team role allows running commands on the site, an API key has both commands:run and mcp:invoke ticked (Full Access alone includes neither), and a browser sign-in was approved with Full access — read & write rather than Read-only.

What happens if a queue worker change fails on the server?

The worker stays listed on the Laravel Queue card so you can fix it. A failed change keeps the worker’s old settings, and a failed start keeps the new worker in the list so you can edit, restart or delete it.

If you run into any issues with your queue workers, feel free to reach out to our support team.