Free managed migration on every plan — we move your sites the same day. All systems operational +91 74091 34231

How-tocPanel

How to set up a cron job in cPanel

Reading time
5 min
Last updated
25 Sep 2026

A cron job runs a command on a schedule: process a mail queue every five minutes, clear old files at night, run a Laravel scheduler, or replace WordPress's visitor-triggered cron with a real one. cPanel sets them up without touching the command line.

  1. 01

    Open Cron Jobs

    In cPanel, go to Advanced → Cron Jobs. The Cron Email box at the top is where the output of every job is sent. Clear it to stop all of those emails, or silence jobs one at a time (step 4).

  2. 02

    Choose when it runs

    Under Add New Cron Job, pick a schedule from Common Settings, for example Once Per Five Minutes. It fills in the five fields for you: Minute, Hour, Day, Month and Weekday. You can also type them yourself; the schedules below are ready to copy.

    Cron runs on the server's clock, which may not be IST. Check it by running date in cPanel's Terminal before you schedule anything for a particular hour.

  3. 03

    Write the command with full paths

    Cron starts in your home directory with a minimal environment, so spell every path out in full. To run a PHP script:

    /usr/local/bin/php /home/cpuser/public_html/cron.php

    Replace cpuser with your cPanel username. To trigger a URL instead:

    curl -s https://example.in/tasks/run

    Run the exact command in Terminal first. If it fails there, it will fail in cron, where you cannot see the error.

  4. 04

    Silence it or keep a log

    Each run's output is emailed to the Cron Email address, which adds up quickly for a job that runs every five minutes. Append this to discard the output:

    >/dev/null 2>&1

    Or keep it in a log file you can check later, making sure the logs folder exists first:

    >> /home/cpuser/logs/cron.log 2>&1
  5. 05

    Add it and check it ran

    Click Add New Cron Job. It appears under Current Cron Jobs, where you can edit or delete it. After the next scheduled time, check the log file or the email. Leave enough time between runs for the job to finish; cPanel will start the next one even if the last is still running.

Common schedules, ready to copy

The five fields are minute (0–59), hour (0–23), day of the month (1–31), month (1–12) and day of the week (0–6, with 0 as Sunday). * means "every", and */5 means "every fifth".

  • */5 * * * *: every 5 minutes
  • */15 * * * *: every 15 minutes
  • 0 * * * *: every hour, on the hour
  • 30 2 * * *: every day at 2:30 am, server time
  • 0 6 * * 1: every Monday at 6 am
  • 0 0 1 * *: at midnight on the first day of each month

WordPress and Laravel

WordPress runs its scheduled tasks only when someone visits the site, so on a quiet site a scheduled post can go out late, and on a busy one the check runs far more often than it needs to. Add this line to wp-config.php, above the line that says to stop editing:

define('DISABLE_WP_CRON', true);

Then add a cron job every 5 minutes:

cd /home/cpuser/public_html && /usr/local/bin/php wp-cron.php >/dev/null 2>&1

Laravel expects its scheduler to be called every minute, with the schedule * * * * *:

cd /home/cpuser/app && /usr/local/bin/php artisan schedule:run >/dev/null 2>&1

Common questions

Choose Once Per Five Minutes from Common Settings, or type */5 in the Minute field and * in the other four. The finished schedule reads */5 * * * *.
Most often a path problem: cron starts in your home directory with a minimal environment, so use full paths to PHP and to the script. Run the exact command in Terminal first, and read the job's email or log for the error.
The server's clock. Run date in cPanel's Terminal to see it, and adjust the hour if it differs from IST.
Clear the Cron Email address to stop all of them, or add >/dev/null 2>&1 to the end of a single job's command.

→Read next

→Hosting for this

Plans that fit what you just read.

Every plan includes free SSL, free managed migration and a GST invoice.

cPanel Hosting cPanel on LiteSpeed and NVMe, served from Indiafrom ₹49/mo
Shared Hosting Fast, affordable hosting for your first sitefrom ₹49/mo
WordPress Hosting Managed WordPress that fliesfrom ₹99/mo

→Get started

Hosting that does this for you.

Free managed migration, free SSL, and engineers who answer in under two minutes.

See pricing Talk to an engineer

Median support reply: 1m 48s