Cronjob.de › Guides › Moodle
Setting up a Moodle cronjob: even without your own server
Without a command line you set up Moodle cron like this: set a cron password, switch off the "command line only" lock and have admin/cron.php?password=… called every minute. Moodle recommends the one-minute interval. Moodle itself calls the address-based route deprecated; if you have a command line, admin/cli/cron.php is the better choice.
Updated:
Why at all
Without cron nothing happens in Moodle
Moodle handles a lot of work through scheduled tasks in the background, such as forum notification emails, automated course backups and deleting activities via the recycle bin. The Moodle documentation is clear about it: without cron the site will not work properly.
The command line is recommended: php admin/cli/cron.php, every minute. On your own server or with a host that offers cron management, that is the right way.
But many Moodle installations run on shared hosting without a suitable cron, for example in schools, clubs and small training providers. For that case there is the call via admin/cron.php. The Moodle documentation also says it is perfectly fine for cron to be triggered from a different machine than the Moodle server. That is exactly what Cronjob.de does.
- URL to call
https://lernen.ihre-domain.de/admin/cron.php?password=IHRPASSWORT- Recommended interval
- every minute
- Tested with
- Moodle 4.x, 5.x (5.3)
- 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".
-
Set a cron password: this is mandatory
Open
Site administration › Security › Site security settings(older versions: "Site policies"). Enter a long, random password of letters and digits underCron password for remote access. If the field is empty, Moodle does not ask for a password. Moodle explicitly warns that running cron from a web browser can otherwise expose privileged information to anonymous users. -
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 answers "Sorry, internet access to this page has been disabled by the administrator." -
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 prints as text which tasks it runs. If you get "Sorry, you have not provided a valid password to access this page", the password in the address is wrong.
https://learn.your-domain.com/admin/cron.php?password=YOURPASSWORD
-
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.
Start for free 14 days of Unlimited included, no payment details
-
Create the cronjob, every minute
Paste the address and select every minute (from Plus) or every five minutes (free). Each call works through the tasks that are currently due and then ends. Moodle keeps track itself of when each task is due again.
* * * * *
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.
-
Switch on notifications
Enter an email address under Notifications. If cron stops running you would otherwise often only notice when participants complain about missing mail. Failure notifications by email are included from the Plus plan, and free during the first 14 days.
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. Whether you need an outside service at all is shown in the comparison of the three ways.
Verification
Is it actually running?
In Moodle, Site administration › Server › Tasks › Scheduled tasks shows "Last run" and "Next run" for every task. Fresh timestamps mean it is working. If cron runs too rarely, Moodle warns in site administration that the admin/cron.php script has not been run for a certain time. The Cronjob.de call log shows the status and run time of each call.
FAQ
Common questions about Moodle
- How often should Moodle cron run?
- Moodle recommends every minute. Moodle manages the timing of its scheduled tasks itself; cron only checks what is due. At five minutes a task is delayed by two and a half minutes on average. For many small courses that is uncritical.
- Moodle calls the address-based route deprecated. Can I still use it?
- Yes, it is still built into Moodle 5.3. The Moodle documentation says, however, that the route is deprecated and may be removed in a future version. If you have a choice, do not run cron from the browser. If your host offers cron with a command line, use that. This guide is for everyone else.
- Is Moodle cron by address a security risk?
- Without a password, yes: anyone can then trigger cron, and Moodle warns that privileged information may become visible. With a long, random cron password the call is protected. Set it before you allow browser execution, and only call the address over https.
- The call takes very long or aborts.
- After a long pause Moodle often works through a backlog first. Let it run a few rounds. Our call waits 45 seconds (free) or 60 seconds (Plus and Unlimited). If runs regularly take longer, check under Scheduled tasks which task uses the time.
- I get "you have not provided a valid 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 hosted Moodle offerings?
- This guide is for self-hosted installations. With a hosted offering, ask the provider whether cron is already running before you set up a second one.
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.
Other errors such as 401, 404 or 500 are explained in the troubleshooting guide.
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 pricingMore guides
- Webspace
- Windows
- WordPress
- Nextcloud
- Contao
- Drupal
- Joomla
- All-Inkl (KAS)
- STRATO
- IONOS
- Matomo
- Dolibarr
- phpList
- SuperWebMailer
- Firefly III
- Host Europe
- Hetzner Webhosting
- Gambio
- Shopware
- JTL-Shop
- PrestaShop
- WooCommerce
- WP All Import
- Doofinder
- GitHub Actions
- MySQLDumper
Official documentation of Moodle
The details about Moodle come from their own documentation, as of October 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.
By Joscha Schultze, operator of Cronjob.de · Written with AI assistance, provider details checked against their official pages.