Skip to content
NewRedesigned blogFeedback
Jigar Karangiya

DDEV Docker: Configure Cron in Magento 2

Hello Guys, In this tutorial, we are going to see how we can set up and run crons inside our ddev docker setup for our Magento 2 setup.

DDEV Docker: Configure Cron in Magento 2
Written by
JKJigar Karangiya
Published
Reading time
2 min read

Jigar Karangiya · · 2 min read

Hello Guys,

In this tutorial, we are going to see how we can set up and run crons inside our ddev docker setup for our Magento 2 setup.

In Magento 2 development many configurations need cron for the proper working of your Magento. So crons must be configured properly to ensure our store works properly.

By default, after setup Magento 2 using DDEV, it doesn’t come with crons configured inside our web container.

To cross-verify, Quickly follow the below steps.

  1. Log in to your web container using ssh
RunTerminal
ddev ssh

it will log in to ssh of your current project’s web container.

Figure 01

Now run the below command to check if crontab is installed or not.

RunTerminal
crontab -l
Figure 02

If it shows the above error crontab: command not found it means crontab is not configured in your web container.

Run the exit command to log out from the ssh.

Let’s configure it.

Step 1: Install the DDEV Cron add-on

This DDEV add-on helps to execute a command in the web container based on a cron schedule. Cron is a classic Linux/Unix service with a well-known configuration syntax.

The add-on:

  • Installs and runs the cron service inside the web container
  • Adds an example job that writes out the current time.

Run the below command to install the add-on in your project.

RunTerminal
ddev get ddev/ddev-cron
Figure 03

Step 2: Restart DDEV to apply changes:

RunTerminal
ddev restart
Figure 04

Step 3: Setup Magento 2 Cron Tab in your web server

Run the below commands to install Magento 2 crons:

RunTerminal
ddev magento cron:install
Figure 05

You can verify entries by running the below command :

RunTerminal
ddev exec crontab -l
Figure 06

If it shows the entry, you are all set. You can check the cron_schedule table after 1 minute, crons are scheduled now and it will run automatically, all indexers will run on time and consumer queues will work fine on your local system.

Figure 07

Hope this tutorial was helpful. Happy Coding !!

Thanks. See you in the next tutorial.

Keep reading
All posts

01 · 10 min · Shares Adobe Commerce Core

Adobe Commerce Agentic Capabilities, Q4 2026

Five agentic releases for Adobe Commerce: LLM product discovery, Brand Visibility, the Shopper MCP server, Brand Concierge, and Experience Workspace. What each one does, which editions get it, and when.

10 min

03 · 3 min · Shares Adobe Commerce Core

Conditions for Collections in Magento 2

Collections in Magento 2 (Now Adobe Commerce), are among the most powerful tools for retrieving and manipulating data directly from the database.

3 min

Newsletter

New Magento tutorials, straight to your inbox

Code examples, performance tips, and fixes for common Magento issues. No spam.

Subscribe