Published 29.05.2026
Magento 2 CLI Commands Cheat Sheet for Developers
Magento 2 CLI Cheat Sheet for Developers and Administrators. Learn how to manage cache, indexes, modules, cron jobs, DI compilation, static content deployment, and other essential day-to-day Magento tasks.
Magento 2 includes a powerful CLI tool, bin/magento, used for store administration, module development, deployment, and maintenance.
This cheat sheet covers the most commonly used commands that Magento developers rely on every day.
List Available Commands
bin/magento
Displays a list of all available Magento commands.
Cache Management
Clean Cache
bin/magento cache:clean
Removes outdated cache entries only.
Use after:
- XML changes;
- configuration updates;
- template modifications.
Flush Cache
bin/magento cache:flush
Clears all Magento cache and backend storage such as Redis and file cache.
Use carefully in production environments.
Check Cache Status
bin/magento cache:status
Enable Cache
bin/magento cache:enable
Disable Cache
bin/magento cache:disable
Magento Application Modes
Show Current Mode
bin/magento deploy:mode:show
Enable Developer Mode
bin/magento deploy:mode:set developer
Recommended for local development.
Enable Production Mode
bin/magento deploy:mode:set production
Used on live production servers.
Dependency Injection Compilation
Compile Dependency Injection
bin/magento setup:di:compile
Run after creating plugins, preferences, new modules, or before deploying to production.
Static Content Deployment
Deploy Static Content
bin/magento setup:static-content:deploy -f
Deploy for multiple locales:
bin/magento setup:static-content:deploy en_US uk_UA -f
Database Updates
Run Module Upgrades
bin/magento setup:upgrade
This command executes new migrations, schema updates, and data patches.
Index Management
Check Indexer Status
bin/magento indexer:status
Reindex All Indexers
bin/magento indexer:reindex
Show Indexer Modes
bin/magento indexer:show-mode
Set Schedule Mode
bin/magento indexer:set-mode schedule
Recommended for production environments.
Set Realtime Mode
bin/magento indexer:set-mode realtime