o

Cronjob.deGuides › Moodle

Setting up a Moodle cronjob – even without your own server

Moodle does almost everything important in the background and needs a regular trigger for it. If you have your own server, use the command line. On shared hosting you often do not have one – then the address-based call remains, secured with a password.

Why at all

Without cron nothing happens in Moodle

Moodle moves almost every longer-running task into the background: forum notifications and all other mail, grading of assignments and quizzes, course backups, completion tracking, reports, badges and emptying the recycle bin. Without a regular trigger all of it just sits there – the course looks fine, but nobody receives a message.

Moodle recommends the command line for this: php admin/cli/cron.php, every minute. On your own server or with a host that has cron management that is the right way, and you do not need this guide.

But many Moodle installations run on ordinary shared hosting – in schools, clubs and small training providers. There is often no cron at all there, or only a daily one. For that case Moodle knows the call via the address admin/cron.php. It is not the recommended route, but it works, and it beats a Moodle that never sends its mail.

URL to call
https://lernen.ihre-domain.de/admin/cron.php?password=IHRPASSWORT
Recommended interval
every minute
Tested with
Moodle 4.x, 5.x
Sufficient Cronjob.de plan
Moodle recommends a one-minute interval – available from Cronjob.de Plus. The free plan calls every five minutes, which is usually enough for small courses.

Setup

Step by step

The AI does it faster

You do not have to transfer any of this by hand. Paste this guide – or the one for your own system – into the assistant, and Cronjob.de fills in address, method, schedule and headers. Where something is unclear it asks instead of guessing. At the end you see what was entered and create the job with one click.

Included in the free plan at no extra cost. You will find it after signing in under "Cronjobs" → "Create with AI".

  1. Set a cron password – this is mandatory

    Open Site administration › Security › Site policies and enter a long, random password under Cron password for remote access. Without it anyone could start your cron; Moodle explicitly warns that running cron from a web browser can otherwise expose privileged information.

  2. Allow the call from a browser

    On the same page you will find Cron execution via command line only. It is enabled by default and has to be switched off, otherwise Moodle rejects the call.

  3. Assemble the address and check it once

    The address consists of your Moodle address, the path and the password as a parameter. Open it in a browser once: Moodle then lists the tasks it executed. If you get "Invalid password" or an error, one of the two steps above is not right yet.

    https://learn.your-domain.com/admin/cron.php?password=YOURPASSWORD
  4. Create an account at Cronjob.de

    Registration takes a minute and is free. Five cronjobs stay free forever, the first 14 days run on the Unlimited plan.

  5. Create the cronjob and allow a generous runtime

    Enter the address and select every minute. Moodle processes as much as it can manage per call, so a single call may occasionally take longer.

    * * * * *

    You can enter this expression at Cronjob.de exactly as it is – the schedule field understands crontab notation. But you do not have to know it: simply click the schedule together instead.

  6. Switch on notifications

    Enter an email address under notifications. If cron stops running you would otherwise only notice when participants complain about missing mail.

What the five fields of an expression like */5 * * * * mean is explained in the crontab reference – with examples and the most common pitfalls. You can build the expression in the crontab generator.

Verification

Is it actually running?

In Moodle, Site administration › Server › Scheduled tasks shows the last and next run for every task. Fresh timestamps mean it is working. The Cronjob.de call log shows status 200 and the runtime per call alongside.

FAQ

Common questions about Moodle

Moodle calls the address-based route deprecated. Can I still use it?
Yes. It is still built in and documented, and Moodle itself describes how to secure it with a password. It is true that Moodle prefers the command line and might remove the route at some point. If your host offers cron, use that – this guide is for everyone else.
Is this a security risk?
Only without a password. Then anyone can trigger cron and see the output. With a long, random cron password the call is protected. Set it before you allow browser execution, not after.
Why every minute and not less often?
Because Moodle manages the timing of its scheduled tasks itself and cron only checks what is due. A one-minute trigger keeps everything on time. At five minutes every task is delayed by two and a half minutes on average – uncritical for most courses.
The call takes very long or aborts.
That happens on the first run after a long pause, when Moodle works through a backlog. Let it run a few rounds. If it persists, a single task is usually to blame – Scheduled tasks tells you which.
I get "Invalid password".
The parameter does not match the cron password you set. Watch out for special characters: symbols such as &, + or spaces have to be encoded in the address. The simplest fix is a password of letters and digits only.
Does this apply to MoodleCloud?
No. With MoodleCloud, Moodle runs cron for you and there is nothing to set up. This guide is for self-hosted installations.
Is your server rejecting our calls? Error 403 almost always comes from a firewall, a security plugin or directory protection – not from your script. All our calls carry the fixed identifier Cronjob.de in the user agent. Ask your host for an exception for it; that is more reliable than allowing IP addresses, because ours can change. Addresses and details in the FAQ.

Create your cronjob now

Create an account, enter the address, click the schedule. Five cronjobs are free forever, the first 14 days run on the Unlimited plan.

Start for free See pricing

More guides

Official documentation of Moodle

The details about Moodle come from their own documentation, as of September 2026. Please check there whether anything has changed since. Moodle is a trademark of its respective owner. This guide comes from Cronjob.de and has no business relationship with that provider.