Setup the Cronjob

General help articles for Magento® 2. We've tried our best in the preparation of this help article. If you do not find the answer you were looking for, you can always send us a message through this form.

Setup the Cronjob in Magento 2

Magento 2 relies heavily on cronjobs to run essential background tasks. From reindexing and sitemap generation to sending automated emails and updating product feeds, cronjobs keep your store running smoothly. Setting them up correctly is crucial for both performance and stability.

Why Cronjobs Are Important in Magento 2

  • Indexing – keeps your catalog, prices, and search results up to date.
  • Caching – refreshes cache and improves store performance.
  • Emails & Reports – automates sending newsletters, order confirmations, and reports.
  • Feed generation – updates and exports product feeds (e.g., Google Shopping feeds).
  • System tasks – clears logs, archives orders, and manages cleanups.

How to Setup the Cronjob in Magento 2

You can set up the Magento 2 cronjob in just a few steps. Make sure you have SSH access to your server.

1. Switch to the Magento File System Owner

su - magento_user
cd /var/www/html/magento2

2. Run the Magento Cron Command

Magento includes a handy script to automatically create the right cronjobs:

php bin/magento cron:install

This will add the required cronjob entries to the crontab of your Magento user.

3. Verify the Cron Setup

crontab -l

You should see something like:

* * * * * php /var/www/html/magento2/bin/magento cron:run | grep -v "Ran jobs by schedule" >> /var/www/html/magento2/var/log/magento.cron.log

4. Test the Cronjob

You can manually trigger the cronjob to check if everything works:

php bin/magento cron:run

Troubleshooting

Cronjob is not running?

  • Make sure the cron service is active on your server: systemctl status cron (Ubuntu/Debian) or service crond status (CentOS).
  • Check file permissions for the Magento user – cronjobs must run as the Magento filesystem owner.
  • Review the cron log in var/log/magento.cron.log for errors.

Multiple stores and environments?

Each Magento environment (production, staging, development) should have its own cron setup to avoid conflicts.

Conclusion

Correctly setting up cronjobs is essential for running Magento 2 smoothly. Without them, important processes like indexing, caching, and feed generation won’t work as expected. Once configured, cronjobs run automatically in the background, saving time and ensuring your webshop stays up to date.

Need cronjobs for product feeds? Our Google Shopping Feed plugin fully supports automatic feed generation and uploads via Magento cronjobs.

Direct Help

At Magmodules, our support team is here to help you every step of the way. If you can't find a solution in our Knowledgebase, simply fill in the form below. We are in the Central European Timezone, and all your details are securely sent to us.
The more information you provide, the better we can assist you. Trust us to guide you through any challenge and ensure a seamless experience with our products and services.
Support by e-mail contact@magmodules.eu
star star star star star
star star star star star
Matt Austin
Possibly the fastest support response times of any Magento Extension vendor. Great extensions too!
Google Last week
star star star star star
star star star star star
Jan Privé
Dankzij de heldere uitleg en snelle reactie van Magmodules kon mijn vraag, en dus mijn Magento-probleem, binnen enkele uren worden beantwoord. Doeltreffend, zonder moeilijke termen, gewoon zo als het zou moeten zijn.... Bedankt!
Google 12 days ago
star star star star star
star star star star star
Denis Metzler
To evaluate a provider, it is not enough to consider only the product offered, but also its after-sales service, such as support and troubleshooting. Magmodules has been extremely satisfactory at all levels on multiple occasions and sets the bar at the top when comparing the competition.
Google 15 days ago
star star star star star
star star star star star
Bleijenberg winkelinrichting en materialen
Goed bereikbaar, reageren snel en denken oplossingsgericht. Een aanrader.
Google 30 Jul 2025
star star star star star
star star star star star
Patrick Verduijn
Magmodules biedt plugins aan die van hoge kwaliteit zijn tegen een goede prijs, waar dit bedrijf in uitblinkt is de bereidheid om de zeldzame feedback & problemen met de plugins te willen onderzoeken, mee te willen denken in het debuggen van problemen en goede oplossingen toe te passen. In mijn decennium ervaring met Magento & 3th parties is Magmodules absoluut een uniqum binnen de markt.
Google 25 Jul 2025
star star star star star
star star star star star
Erik de Groot
Magemodules heeft hele sterke Magento extensies en een proactieve support. Al jaren heel erg tevreden over jullie service en producten!
Google 18 Jul 2025
star star star star star
star star star star star
René Zeuner
We are using the Mollie Magento extension from Magmodules. It works excellently without flaws. Very fast, competent and friendly support. Thanks!
Google 30 Jun 2025
star star star star star
star star star star star
R. U.
Erg goed team, reageren snel en duidelijk en hebben met toegang tot onze database erg goed geholpen (eigenlijk een gratis customization).
Google 18 Jun 2025
star star star star star
star star star star star
Hugo de Groot
Uitstekende support! Wij gebruiken o.a. de Rich Snippets Suite extensie voor onze Magento 2 webshop (Hyvä) en hadden een specifieke vraag over structured data op PLP-pagina’s. Binnen no-time kregen we een inhoudelijk en duidelijk antwoord. Zeer prettig contact en goed onderbouwde uitleg. Absoluut een betrouwbare partner voor Magento-extensies!
Google 13 Jun 2025
star star star star star
star star star star star
Rick Manders
Dit is nog eens een modulemaker! Stopt niet tot het werkt, blijft enthousiast. Grote dank!
Google 04 Jun 2025