Zum Hauptinhalt springen
••
IT Security DownloadsGitHub Release: anthropics/claude-code v2.1.289 (04.10.2026)(04.10.2026 um 01:07 Uhr)
••••••••••
IT Security DownloadsGitHub Release: anthropics/claude-code v2.1.289 (04.10.2026)(04.10.2026 um 01:07 Uhr)
••••••••
Intelligence View
⚡ tsecurity.de Intelligence

Managing Laravel Queues with systemd (Instead of Supervisor)

If you’ve ever worked with Laravel queues, you know one thing for sure: 👉 in production, you need something to keep them running. Without a process manager, you…

Beitrag
0
Seite
0
↗ Quelle (dev.to)
Social ReaktionenReagiere als Erste:r — dein Feedback zählt!

If you’ve ever worked with Laravel queues, you know one thing for sure:



👉 in production, you need something to keep them running.



Without a process manager, your php artisan queue:work will eventually die, and you’ll be stuck restarting it manually.



For a long time, I (like many developers) defaulted to Supervisor for this job. But recently I explored another option: systemd — and honestly, it’s clean, simple, and already built into most Linux distros.



Let’s walk through how you can set up systemd to manage your Laravel queues.









Why systemd?




  • ✅ Already part of most Linux servers (no extra install needed)

  • ✅ Can automatically restart your queue worker if it crashes

  • ✅ Starts queue workers on boot

  • ✅ Built-in logging via journalctl

  • ✅ Fewer moving parts compared to Supervisor









Step 1: Create a systemd service file



We’ll create a service definition for our Laravel queue worker.




sudo nano /etc/systemd/system/laravel-queue.service






Paste in the following configuration:




[Unit]
Description=Laravel Queue Worker
After=network.target

[Service]
User=www-data
Restart=always
ExecStart=/usr/bin/php /path/to/your/laravel/artisan queue:work --tries=3 --sleep=3

[Install]
WantedBy=multi-user.target









Explanation:





  • User=www-data → Runs the queue worker under the web server user (change if needed).


  • Restart=always → Ensures the process restarts if it crashes.


  • ExecStart → The actual command that runs your queue worker. Update the path to match your Laravel app.


  • WantedBy=multi-user.target → Ensures it starts with the system at boot.









Step 2: Reload systemd and enable the service



After saving the file, reload systemd so it picks up the new service:




sudo systemctl daemon-reload
sudo systemctl enable laravel-queue
sudo systemctl start laravel-queue












Step 3: Manage your queue worker



Now you can use standard systemctl commands:




sudo systemctl status laravel-queue   # Check status
sudo systemctl restart laravel-queue # Restart worker
sudo systemctl stop laravel-queue # Stop worker






And check logs with:




journalctl -u laravel-queue -f






This will stream logs from your queue worker in real-time.









Step 4: Scale it up (Optional)



If you want multiple workers, you can use systemd templates. For example:




sudo nano /etc/systemd/system/[email protected]






Then you can run:




sudo systemctl start laravel-queue@1
sudo systemctl start laravel-queue@2
sudo systemctl start laravel-queue@3






Each one runs independently, and you can scale up as needed.









Supervisor vs systemd











































Feature Supervisor systemd
Install required ✅ Yes ❌ No (already included)
Auto restart ✅ Yes ✅ Yes
Logging ✅ Yes ✅ Yes (journalctl)
Scaling workers ✅ Easy ✅ Easy with templates
Startup on boot ✅ Yes ✅ Yes
Complexity Higher Lower


If you’re already comfortable with Supervisor, it works great. But if you want fewer dependencies and tighter integration with your OS, systemd is a solid choice.









Conclusion



Laravel queues are essential for background jobs, but keeping them alive in production is just as important.



While Supervisor has been the go-to for years, systemd provides a simpler, more native approach to managing queue workers.



Next time you’re deploying a Laravel app, give systemd a try. You might not look back. 🚀

🔍 CTI & Forensik

Cyber Threat Intelligence & Forensik

ATT&CK-Navigator · IoC-Radar · Exploit-Belege
CTI Threat Relationship Graph
Akteure · Techniken · Beziehungen
2 Knoten · 1 Relationen
CVE / Incident Threat Actor Software MITRE ATT&CK CWE Weakness IoC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Managing Laravel Queues with systemd (Instead of Supervisor)

Thematisch verwandte Begriffe: Managing, Laravel, Queues, with · 6 Treffer

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
Nächster Beitrag