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 list

bin/magento help <command> — Show help for a specific command.

bin/magento help setup:upgrade

bin/magento info:adminuri — Show the admin panel URI.

bin/magento info:adminuri

bin/magento --version — Show the Magento version.

bin/magento --version

Setup & Deploy

bin/magento setup:upgrade — Run database schema and data upgrades.

bin/magento setup:upgrade

bin/magento setup:di:compile — Compile dependency injection configuration.

bin/magento setup:di:compile

bin/magento setup:static-content:deploy — Deploy static view files.

bin/magento setup:static-content:deploy -f

bin/magento setup:static-content:deploy <locales> — Deploy static content for specific locales.

bin/magento setup:static-content:deploy en_US de_DE

bin/magento deploy:mode:show — Show the current deployment mode.

bin/magento deploy:mode:show

bin/magento deploy:mode:set <mode> — Set deployment mode (developer, production, default).

bin/magento deploy:mode:set production

Cache Management

bin/magento cache:status — Show cache types and their status.

bin/magento cache:status

bin/magento cache:flush — Flush all cache storage used by cache types.

bin/magento cache:flush

bin/magento cache:clean — Clean specific cache types.

bin/magento cache:clean config full_page

bin/magento cache:enable <type> — Enable a cache type.

bin/magento cache:enable full_page

bin/magento cache:disable <type> — Disable a cache type.

bin/magento cache:disable full_page

Indexer

bin/magento indexer:status — Show indexer status.

bin/magento indexer:status

bin/magento indexer:reindex — Reindex all indexers.

bin/magento indexer:reindex

bin/magento indexer:reindex <indexer> — Reindex a specific indexer.

bin/magento indexer:reindex catalog_product_price

bin/magento indexer:info — Show all available indexers.

bin/magento indexer:info

bin/magento indexer:set-mode <mode> — Set indexer mode (realtime or schedule).

bin/magento indexer:set-mode schedule

Module Management

bin/magento module:status — Show status of all modules.

bin/magento module:status

bin/magento module:enable <module> — Enable a module.

bin/magento module:enable Vendor_Module

bin/magento module:disable <module> — Disable a module.

bin/magento module:disable Magento_TwoFactorAuth

bin/magento module:uninstall <module> — Uninstall a module (removes code and data).

bin/magento module:uninstall Vendor_Module

Maintenance & Admin

bin/magento maintenance:enable — Enable maintenance mode.

bin/magento maintenance:enable --ip=10.0.0.1

bin/magento maintenance:disable — Disable maintenance mode.

bin/magento maintenance:disable

bin/magento maintenance:status — Show maintenance mode status.

bin/magento maintenance:status

bin/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=User

bin/magento admin:user:unlock <user> — Unlock an admin account.

bin/magento admin:user:unlock admin

bin/magento cron:run — Run scheduled cron jobs.

bin/magento cron:run

bin/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

  • artisan – Laravel's command line: generate code, run migrations and manage queues
  • cargo – Rust's package manager and build tool
  • composer – dependency manager for PHP, also used to install Magento