Search code examples
laravelcronvpscoolify

How to run laravel scheduler/cron jobs on Coolify.io self hosted


I'm running a Laravel application hosted on a VPS, managed by a self-hosted Coolify.io service. I've set up the application to auto-deploy on Git commits using Nixpacks, following the documentation, and the app runs smoothly. However, I’m facing challenges with setting up cron jobs. I've configured scheduled tasks in Laravel using the scheduler, but I'm unsure how to properly configure this within the Coolify panel. I have SSH access to the VPS, but since Coolify runs the app inside a Docker container, and I rely on Nixpacks for deployment, I'm not sure how to proceed. If anyone has experience or advice on configuring cron jobs in a setup like this, I'd appreciate some guidance.


Solution

  • Project > Env > App > Configurations > Scheduled Tasks

    enter image description here

    Add your task, in your case it's php artisan schedule:run

    enter image description here

    Because coolify is built with laravel ( AFAIK ), the place-holders and examples all apply to laravel :) , so set the name to Laravel Schedule command to php artisan schedule:run and freq to every_minute or * * * * * and leave container empty if you have only one container for this project.