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.
-
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).
-
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
datein cPanel's Terminal before you schedule anything for a particular hour. -
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.phpReplace
cpuserwith your cPanel username. To trigger a URL instead:curl -s https://example.in/tasks/runRun the exact command in Terminal first. If it fails there, it will fail in cron, where you cannot see the error.
-
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>&1Or keep it in a log file you can check later, making sure the
logsfolder exists first:>> /home/cpuser/logs/cron.log 2>&1 -
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 minutes0 * * * *: every hour, on the hour30 2 * * *: every day at 2:30 am, server time0 6 * * 1: every Monday at 6 am0 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>&1Laravel 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
→Read next
→Hosting for this
Plans that fit what you just read.
Every plan includes free SSL, free managed migration and a GST invoice.
→Get started
Hosting that does this for you.
Free managed migration, free SSL, and engineers who answer in under two minutes.