Run the Laravel Scheduler as a Windows Service with AlwaysUp

How to Run the Laravel Scheduler as a Windows Service with AlwaysUp

Start running the Laravel Scheduler as soon as your server boots. Ensure that your Laravel scheduled tasks are launched reliably, every minute, 24/7/365

Laravel is a modern, intuitive web application framework used by thousands of developers worldwide. The framework's powerful Task Scheduler component runs PHP methods on a well-defined schedule (e.g. every 5 minutes) and is ideal for performing regular maintenance operations.


To run the Laravel Scheduler 24/7 as a Windows Service with AlwaysUp:

  1. Download and install AlwaysUp, if necessary.

  2. Start AlwaysUp.

  3. Select Application > Add to open the Add Application window:

    Add Application

  4. On the General tab:

    • In the Application field, enter the full path to your PHP executable, php.exe.

      If you don't know where the executable lives, type where php at a command prompt for assistance.

    • In the Arguments field, enter:

      "<LARAVEL PROJECT PATH>\artisan" schedule:work

      where <LARAVEL PROJECT PATH> is the full path to the folder holding your Laravel project. You should see the "artisan" PHP script in that folder.

      Be sure to enclose the artisan path in quotes if it contains a space!

    • From the Startup type dropdown, select Automatically, but shortly after the computer boots.

      This ensures that your Laravel tasks aren't run too soon, before critical supporting services (e.g. TCP/IP networking) are up and running.

    • And in the Name field, enter a suitable name for your service. We have entered Laravel Scheduler but you should add your project name if you have multiple projects and intend to run a scheduler for each one.

    Laravel Scheduler Windows Service: General Tab

  5. Move to the Logon tab. Check the box at the top and enter your username and password.

    We recommend running PHP in your regular account, so that it has access to your environment variables and user-specific configuration.

    Laravel Scheduler Windows Service: Logon Tab

  6. We're done configuring AlwaysUp to run the Laravel Scheduler so click the Save button to record your settings. In a couple of seconds, an application named Laravel Scheduler (or whatever you called it) will appear in the AlwaysUp window. It's not yet running though and the state will be Stopped:

    Laravel Scheduler Windows Service: Created

  7. To start Laravel Scheduler as a windows service, choose Application > Start "Laravel Scheduler". The state should transition to Running in a few seconds:

    Laravel Scheduler Windows Service: Running

  8. That's it! Next time your computer boots, your Laravel scheduled tasks will start running automatically — before anyone logs on.

    We encourage you to edit the entry in AlwaysUp and check out the many other settings that may be appropriate for your environment. For example, send an email alert if the artisan command fails, reboot the server weekly, send a daily summary of performance, and much more. The 70+ page user's manual (PDF) describes the full set of features.



Laravel Scheduler not working properly as a Windows Service?

  • The artisan schedule:work command was introduced in Laravel 8 (October 2020). It is not available in earlier versions of Laravel.

    For Laravel 6 or 7 sites, we recommend:

  • Consult the AlwaysUp Troubleshooter — our online tool that can help you resolve the most common problems encountered when running an application as a Windows Service.

  • From AlwaysUp, select Application > Report Activity > Today... to bring up a HTML report detailing the interaction between AlwaysUp and PHP/artisan. The AlwaysUp Event Log Messages page explains the messages that may turn up.

  • Browse the AlwaysUp FAQ for answers to commonly asked questions and troubleshooting tips.

  • Contact us and we will be happy to help!

Download & Try it Free!

Download AlwaysUp and Run as a Service Today! Version 15.5 New!

8.0 MB Installer
Our 12,000+ customers include...
Compatible with Windows 11 Compatible with Windows Server 2022 Compatible with Windows 10
Over 94,000 installations, and counting!
 
AlwaysUp is number 1! Run as a Service with AlwaysUp

Rock-solid for the past 19+ years!