# How to set up a cron job in cPanel

> Schedule a cron job in cPanel: choose the timing, write the command with full paths, stop the emails, and copy common schedules such as every 5 minutes.

Source: https://www.fasterhost.in/kb/set-up-a-cron-job-in-cpanel.php · cPanel · 5 min read · updated 25 September 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.

## Steps

### 1. 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. 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. 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. 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. 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

**How do I run a cron job every 5 minutes in cPanel?**

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

**Why is my cron job not running?**

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.

**Which time zone does cron use?**

The server's clock. Run date in cPanel's Terminal to see it, and adjust the hour if it differs from IST.

**How do I stop cron job emails?**

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.

## Related

- [How to change the PHP version in cPanel](https://www.fasterhost.in/kb/change-php-version-in-cpanel.php)
- [How to use the cPanel File Manager](https://www.fasterhost.in/kb/use-the-cpanel-file-manager.php)
- [cPanel Hosting](https://www.fasterhost.in/cpanel-hosting.php): cPanel on LiteSpeed and NVMe, served from India
- [Shared Hosting](https://www.fasterhost.in/shared-hosting.php): Fast, affordable hosting for your first site
- [WordPress Hosting](https://www.fasterhost.in/wordpress-hosting.php): Managed WordPress that flies
