> ## Documentation Index
> Fetch the complete documentation index at: https://kb.hosting.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Setting up Magento cron jobs on managed hosting

> Configure Magento cron jobs on managed hosting for optimal performance and avoid slowdowns with our easy step-by-step guide!

This article describes how to configure cron jobs for Magento installations on managed hosting accounts.

<Warning>
  **Important**

  Magento is a resource-intensive application, and your server should have at least 16GB RAM to run it, with 32GB recommended. You need either a high-end VPS or a Dedicated hosting plan to run Magento effectively. Regular shared hosting accounts do not have sufficient resources to run a full Magento web site.
</Warning>

## Configuring cron jobs in Magento 2

By default, when you install Magento 2 using Softaculous, it only configures one of Magento's cron jobs. However, Magento 2 actually has several cron jobs.

<Note>
  For more information about the cron jobs in Magento 2, please visit [http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-cron.html](http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-cron.html). Please note that the Magento documentation states that cron jobs should run every minute. However, on managed hosting accounts, cron jobs with intervals less than 15 minutes are reset automatically to 15-minute intervals for server performance and stability reasons. For more information, please see [this article](/docs/cron-jobs-reset-to-15-minute-intervals).
</Note>

To configure cron jobs for Magento 2, follow these steps:

1. Log in to cPanel.
   > 📘 Note
   >
   > If you do not know how to log in to your cPanel account, please see [this article](/docs/accessing-cpanel).

2. In the **Advanced** section of the cPanel home screen, click **Cron Jobs**.

3. Delete the Magento cron job that Softaculous installed:

* Under **Current Cron Jobs**, locate the following cron job:

```
12,18,33,54 * * * * php /home/username/public_html/bin/magento cron:run > /dev/null
```

<Note>
  The four initial numbers and username in the cron command vary by installation.
</Note>

* Click **Delete** to delete the cron job.

4. Under **Add a New Cron Job**, enter the following settings:

* In the **Minute** text box, type `*/15`.

* In the **Hour** text box, type `*`.

* In the **Day** text box, type `*`.

* In the **Month** text box, type `*`.

* In the **Weekday** text box, type `*`.

* In the **Command** text box, type the following command. Replace ***username*** with your own hosting.com account username:

```
/usr/local/bin/php /home/username/public_html/bin/magento cron:run | awk '{ print strftime("\%Y-\%m-\%d \%H:\%M:\%S"), $0; fflush(); }' 2>&1 > ~/magento_cron.log
```

<Note>
  This command assumes that Magento is installed in the document root ( *public\_html* ) directory. If you installed Magento in a different directory, use that path instead.
</Note>

* Click **Add New Cron Job**.

5. Under **Add a New Cron Job**, enter the following settings:

* In the **Minute** text box, type `*/15`.

* In the **Hour** text box, type `*`.

* In the **Day** text box, type `*`.

* In the **Month** text box, type `*`.

* In the **Weekday** text box, type `*`.

* In the **Command** text box, type the following command. Replace ***username*** with your own hosting.com account username:

```
/usr/local/bin/php /home/username/public_html/update/cron.php | awk '{ print strftime("\%Y-\%m-\%d \%H:\%M:\%S"), $0; fflush(); }' 2>&1 > ~/magento_cron.log
```

<Note>
  This command assumes that Magento is installed in the document root ( *public\_html* ) directory. If you installed Magento in a different directory, use that path instead.
</Note>

* Click **Add New Cron Job**.

6. Under **Add a New Cron Job**, enter the following settings:

* In the **Minute** text box, type `*/15`.

* In the **Hour** text box, type `*`.

* In the **Day** text box, type `*`.

* In the **Month** text box, type `*`.

* In the **Weekday** text box, type `*`.

* In the **Command** text box, type the following command. Replace ***username*** with your own hosting.com account username:

```
/usr/local/bin/php /home/username/public_html/bin/magento setup:cron:run | awk '{ print strftime("\%Y-\%m-\%d \%H:\%M:\%S"), $0; fflush(); }' 2>&1 > ~/magento_cron.log
```

<Note>
  This command assumes that Magento is installed in the document root ( *public\_html* ) directory. If you installed Magento in a different directory, use that path instead.
</Note>

* Click **Add New Cron Job**.

7. The Magento 2 cron jobs now run every 15 minutes. Any output or error messages are stored in the */home/username/magento\_cron.log* file, where ***username*** represents your own hosting.com account username.

## Configuring cron jobs in older Magento versions

In Magento versions older than 2.0, some of the cron jobs do not need to be run as frequently as the default values, particularly on managed hosting accounts. As a result, the default Magento cron job settings can lead to performance issues on servers that not only affect your account, but other accounts as well.

To optimize Magento cron jobs on a managed hosting account, follow these steps:

1. Log in to Magento using your administrator account.

2. On the top menu bar, click **System**, and then click **Configuration**.

3. In the **Configuration** pane on the left side, scroll down the page, and then under **Advanced**, click **System**.

4. Click **Cron (Scheduled Tasks)**.

5. In the **Generate Schedules Every** text box, type `1`.

6. In the **Schedule Ahead for** text box, type `1`.

7. In the **Missed if Not Run Within** text box, type `30`.

8. In the **History Cleanup Every** text box, type `120`.

9. In the **Success History Lifetime** text box, type `120`.

10. In the **Failure History Lifetime** text box, type `120`.

11. Click **Save Config**.

12. Log in to cPanel.

13. In the **Advanced** section of the cPanel home screen, click **Cron jobs**.

14. Under **Current Cron Jobs**, locate the Magento cron job, and then click **Edit**.

15. In the **Minute** text box, type `0`.

16. In the **Hour** text box, type `*/4`.
    > 📘 Note
    >
    > This sets the Magento cron job to run every four hours.

17. In the **Day**, **Month**, and **Weekday** text boxes, type `*`.

18. Click **Edit Line**. The new cron settings take effect immediately.

## More information

To view the online Magento documentation, please visit [https://support.magento.com/hc/en-us](https://support.magento.com/hc/en-us).

## Related articles

* [Magento](/docs/magento)
