Cron is required for Moodle to:
Send reminder emails.
Mark lessons as completed.
Update learner status.
Run the following command: sudo crontab -u www-data -e in PowerShell.
This command opens the crontab file for the www-data user using an editor (usually nano).
If this is your first time using crontab, it will ask you to choose an editor:
Enter 1 and press Enter.
After the editor opens, move to the last empty line and paste the following line:
*/1 * * * * /usr/bin/php /var/www/html/moodle/admin/cli/cron.php >/dev/null 2>&1
Press Ctrl + O → then Enter to save the file, then Ctrl + X to exit.
After adding the cron job, you can test it manually with: sudo -u www-data php /var/www/html/moodle/admin/cli/cron.php