o

HomeGuides › Nextcloud

Setting up a Nextcloud cronjob: webcron instead of AJAX

Nextcloud does a fair amount in the background: indexing files, generating previews, emptying the trash, syncing federated shares, sending notifications. Without system access you switch to webcron mode and have cron.php called from outside.

Why at all

AJAX depends on logged-in users

By default Nextcloud runs in AJAX mode. Background jobs then only start while somebody has the web interface open. On an instance used by two people during the day and nobody at night, jobs pile up.

You notice it in small things: previews are missing, the trash never expires, calendar reminders arrive late, and the admin area warns that the last background job was a long time ago.

One thing to know before switching: in webcron mode Nextcloud runs exactly one job per call. At one call every five minutes that is 288 jobs a day. The vendor documentation considers that sufficient only for very small installations with a handful of users. At a one-minute interval you get 1,440 jobs a day, which goes considerably further.

URL to call
https://cloud.ihre-domain.de/cron.php
Recommended interval
every 5 minutes, every minute for more than a handful of users
Tested with
Nextcloud 27 bis 35
Sufficient plan
Free for very small instances. From about five users the one-minute interval from Plus pays off, because five times as many jobs get through.

Setup

Step by step

  1. Switch on webcron mode

    Sign in as an administrator and open the administration settings, basic settings section. Under background jobs select webcron. If you have command line access you can use the following command instead.

    sudo -u www-data php occ background:webcron
  2. Check the address in a browser

    Open https://cloud.your-domain.com/cron.php once. A blank page is correct. If your Nextcloud lives in a subdirectory, that belongs in the address too.

  3. Create the cronjob at Cronjob.de

    Enter the address and pick the schedule. For the five-minute interval select minutes 0, 5, 10 and so on, for the one-minute interval select all of them.

    */5 * * * *
  4. Check the result in the admin area

    After roughly ten minutes the background jobs warning disappears from the administration settings, and the time of the last successful run is shown there.

Verification

Is it actually running?

The administration settings show when the last background job ran. If that timestamp is from the last few minutes, it works. The Cronjob.de call log additionally shows how long each call took. Values of several seconds point to a full queue, in which case a shorter interval makes sense.

FAQ

Common questions about Nextcloud

Why is only one job executed per call?
That is how webcron mode is built in Nextcloud: every call to cron.php takes exactly the next job from the queue. This limits the runtime of a single call, but it means the interval determines how much gets through overall.
Is webcron as good as a real system cron?
No, and the vendor documentation says so openly. A cron on the server itself remains the recommendation. Webcron is the documented route for everyone without that access, and perfectly sufficient for small instances.
Do I have to protect cron.php?
Nextcloud provides no key for it, the file is deliberately openly reachable. It only triggers background jobs and returns no data. If you still want to restrict it, you can limit access in the web server to our calling address.
My Nextcloud lives in a subfolder.
Then the address is for example https://your-domain.com/nextcloud/cron.php. What matters is the path under which you also reach the login page.

Create your cronjob now

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

Start for free See pricing

More guides

Official documentation of Nextcloud

The details about Nextcloud come from their own documentation, as of September 2026. Please check there whether anything has changed since.