o

Cronjob.deGuides › Webspace

Setting up a cronjob on shared web space: no SSH, no crontab

On a server of your own you put a cronjob into the crontab. On shared web space that almost never works: you have FTP and a control panel, but no command line. This guide shows the approach that works with every host: your script becomes callable through an address, and a service calls that address on a schedule.

Why at all

Why it gets stuck on shared web space

Shared web space means sharing a server with many other customers. That is why hosts give you no access to the crontab there, and usually no SSH either. What you get instead depends on your package.

Some hosts offer a cron manager of their own. Often, though, it only comes with larger packages, knows only coarse intervals such as daily or hourly, or aborts scripts after a few minutes. What that looks like at individual hosts is covered in our guides for STRATO, IONOS, All-Inkl and Host Europe.

The stopgap many systems use is a cron that piggybacks on page visits, such as WP-Cron in WordPress. But it only runs while somebody happens to open the site. At night, on quiet sites or behind a page cache the work is left undone, and with many visitors it slows the site down.

URL to call
https://ihre-domain.de/cron.php?key=…
Recommended interval
as often as needed, usually every 5 minutes
Tested with
PHP 7 und 8
Sufficient Cronjob.de plan
The free plan covers five cronjobs in five-minute steps. Minute-precise starts with Cronjob.de Plus.

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. Check whether your system already has an address

    Many systems ship a ready-made file that works through their scheduled tasks, such as wp-cron.php in WordPress or cron.php in Nextcloud. In that case you do not need a script of your own and can go straight to the step "Test in the browser". The addresses of common systems are listed in the guide overview.

  2. Put your own script into a file

    For tasks of your own, upload a PHP file to your web space via FTP, for example cron.php. Its first line checks a secret key so that not every visitor can trigger the work. Your actual code follows after that.

    <?php
    // cron.php - called on a schedule by Cronjob.de
    if (!isset($_GET['key']) || !hash_equals('A-LONG-SECRET', (string) $_GET['key'])) {
        http_response_code(403);
        exit;
    }
    ignore_user_abort(true);   // keep working even if the caller hangs up
    set_time_limit(300);
    
    // ... the actual work goes here: sync data, send mails, clean up ...
    
    echo 'OK';
  3. Choose a long key

    Replace A-LONG-SECRET with a random string of at least 30 characters, for example from your password manager. Letters and digits only, so there is nothing to encode in the address. The finished address looks like this:

    https://your-domain.com/cron.php?key=k8Qz3vN1pR7wXc2mT9bL5sHf4gJd6aYe
  4. Test in the browser

    Open the address once with the key: the correct answer is OK. Then once without the key: now you must get an empty page with error 403. If the browser asks for a password or your host shows an error page, directory protection or a firewall is in the way.

  5. 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.

  6. Create a cronjob with that address

    Enter the address including the key and choose the interval. If your script sits behind directory protection, store user name and password in the cronjob's advanced settings.

    */5 * * * *

    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.

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 the Cronjob.de call log you will see every call within a few minutes, with status, runtime and the start of the response, which for this script is OK. If a call fails, you can get an email. For the very first test you can also have the script write date and time into a file.

FAQ

Common questions about Webspace

My host has a cron manager. Do I need this anyway?
Not necessarily. If its intervals and runtimes are enough for you, use it. A call from outside pays off when you need a tighter interval, your package has no cron manager, or you want a log and a notification on errors. Which way fits when is covered in the comparison of the three ways.
Is it not dangerous for the script to be publicly reachable?
With the key check in the first line only someone who knows the key can trigger it. Use https so the address cannot be read in transit, and do not print confidential data in the script. If you want more, add directory protection with user name and password in front. Cronjob.de then signs in on every call.
What happens if my script takes longer?
We wait 45 seconds on the free plan and 60 seconds on the paid ones. After that we hang up. With ignore_user_abort(true) your script keeps working at most hosts anyway, until their own time limit kicks in. It is safer to split large jobs into chunks: for example 100 records per call, but more often.
Does this only work with PHP?
No. We call an address, and what runs behind it does not matter to us. It can be a PHP script, a route in your application, a webhook or a Python script your host runs through the web.
Can I run several tasks with different intervals?
Yes. Create a separate file or parameter per task and one cronjob with its own schedule for each. That way the log also shows separately which task ran.
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