Magento — The bin/magento Command Line
Practical guide to the Magento CLI bin/magento — manage modules, cache, indexers, setup, deployment and maintenance for Magento 2 / Adobe Commerce.
bin/magento is the central command-line tool for Magento 2 and Adobe Commerce – it drives almost every administrative task, from flushing the cache and reindexing to switching into production mode. Instead of clicking through the backend, you handle module management, schema upgrades and deployments reproducibly from the terminal, which is ideal for scripts and deploy pipelines. This guide collects the commands you reach for most often in day-to-day work and during rollouts.
General & Info
bin/magento list — List all available commands.
bin/magento listbin/magento help <command> — Show help for a specific command.
bin/magento help setup:upgradebin/magento info:adminuri — Show the admin panel URI.
bin/magento info:adminuribin/magento --version — Show the Magento version.
bin/magento --versionSetup & Deploy
bin/magento setup:upgrade — Run database schema and data upgrades.
bin/magento setup:upgradebin/magento setup:di:compile — Compile dependency injection configuration.
bin/magento setup:di:compilebin/magento setup:static-content:deploy — Deploy static view files.
bin/magento setup:static-content:deploy -fbin/magento setup:static-content:deploy <locales> — Deploy static content for specific locales.
bin/magento setup:static-content:deploy en_US de_DEbin/magento deploy:mode:show — Show the current deployment mode.
bin/magento deploy:mode:showbin/magento deploy:mode:set <mode> — Set deployment mode (developer, production, default).
bin/magento deploy:mode:set productionCache Management
bin/magento cache:status — Show cache types and their status.
bin/magento cache:statusbin/magento cache:flush — Flush all cache storage used by cache types.
bin/magento cache:flushbin/magento cache:clean — Clean specific cache types.
bin/magento cache:clean config full_pagebin/magento cache:enable <type> — Enable a cache type.
bin/magento cache:enable full_pagebin/magento cache:disable <type> — Disable a cache type.
bin/magento cache:disable full_pageIndexer
bin/magento indexer:status — Show indexer status.
bin/magento indexer:statusbin/magento indexer:reindex — Reindex all indexers.
bin/magento indexer:reindexbin/magento indexer:reindex <indexer> — Reindex a specific indexer.
bin/magento indexer:reindex catalog_product_pricebin/magento indexer:info — Show all available indexers.
bin/magento indexer:infobin/magento indexer:set-mode <mode> — Set indexer mode (realtime or schedule).
bin/magento indexer:set-mode scheduleModule Management
bin/magento module:status — Show status of all modules.
bin/magento module:statusbin/magento module:enable <module> — Enable a module.
bin/magento module:enable Vendor_Modulebin/magento module:disable <module> — Disable a module.
bin/magento module:disable Magento_TwoFactorAuthbin/magento module:uninstall <module> — Uninstall a module (removes code and data).
bin/magento module:uninstall Vendor_ModuleMaintenance & Admin
bin/magento maintenance:enable — Enable maintenance mode.
bin/magento maintenance:enable --ip=10.0.0.1bin/magento maintenance:disable — Disable maintenance mode.
bin/magento maintenance:disablebin/magento maintenance:status — Show maintenance mode status.
bin/magento maintenance:statusbin/magento admin:user:create — Create a new admin user.
bin/magento admin:user:create --admin-user=admin --admin-password=Admin123 --admin-email=admin@example.com --admin-firstname=Admin --admin-lastname=Userbin/magento admin:user:unlock <user> — Unlock an admin account.
bin/magento admin:user:unlock adminbin/magento cron:run — Run scheduled cron jobs.
bin/magento cron:runbin/magento store:list — List all stores and store views.
bin/magento store:list Conclusion
With bin/magento you hold the entire lifecycle of a Magento 2 or Adobe Commerce store in your hands, from the first setup to ongoing operations. Treat the invasive commands with care: setup:upgrade alters the database schema, so back up first; after setup:upgrade and setup:di:compile you usually need a cache:flush for changes to take effect. Switch on maintenance mode with maintenance:enable before maintenance work, and only go live in production after deploy:mode:set production plus a fresh static-content deploy. That keeps upgrades and deployments reproducible and safe.
Further Reading
- Adobe Commerce CLI reference – official overview of the bin/magento commands
- Magento Open Source / Adobe Commerce for developers – official developer documentation