How to setup cron jobs in Magento 2 with Cpanel and SSH

In this tutorial, we will guide you how to setup cron jobs in Magento 2 with Cpanel and Command line ( using SSH access)

Setup Cron jobs in Magento 2 with Cpanel

Step1 : Login your Cpanel and go to Advanced -> Cron Jobs, you will see the list of cron jobs on your server.

Step 2: You need to add following commands one by one and make them run once per minute.

YOUR_MAGENTO2_PATH is the absolute path of your magento 2 installation directory.

Setup cron jobs in Magento 2 with Cpanel

Step 3: This is an example when you added all commands exactly.

Setup cron jobs in Magento 2 with Cpanel

 

Setup Cron job in Magento 2 with command line ( using SSH access )

Step 1: Login ssh with your Magento 2 directory owner then execute command:

or if you logged in as root access you can use this command

magento_directory_owner is the owner of Magento 2 directory.

Step 2: You will be able to add cron jobs for this user, add following lines:

If you want to edit crontab with nano, you can execute this command instead:

Step 3: After saving crontab, you need to restart cron service on your server, use this command:

That’s how to setup cron jobs in Magento 2 with Cpanel or SSH access. Hope that it will be helpful.

If you have any question, please leave a comment. 

One thought on “How to setup cron jobs in Magento 2 with Cpanel and SSH

Leave a Reply

Your email address will not be published.