Skip to content

Managing Magento Connect extensions from the command line

Magento 1.x includes the mage script, a command‑line tool that allows you to manage Magento Connect extensions without using the web interface. On ruachost.com, this is useful for automation, cron jobs, and troubleshooting.

  • Faster than using the Magento admin panel.
  • Enables automation with cron jobs.
  • Useful for bulk extension management.
  • Provides more control for developers.
  • The mage script is included with Magento 1.x by default.
  • It is located in the Magento installation directory.
  • Magento 2 does not use the mage script — it has its own CLI tool.
  1. Log in to your hosting account via SSH.

  2. Navigate to your Magento installation directory:

    Terminal window
    cd ~/public_html
  3. Set permissions:

    Terminal window
    chmod 700 mage
  4. Run the mage script:

    Terminal window
    ./mage
Terminal window
./mage list-installed
Terminal window
./mage list-available
Terminal window
./mage install community <extension_name>
Terminal window
./mage download community <extension_name>
Terminal window
./mage install-file <filename>
  • Upgrade all extensions:

    Terminal window
    ./mage upgrade-all
  • Upgrade a specific extension:

    Terminal window
    ./mage upgrade community <extension_name>
Terminal window
./mage uninstall community <extension_name>

You can automate extension upgrades with cron. Example: upgrade all extensions every Sunday at 2:00 AM:

Terminal window
./mage uninstall community <extension_name>
  • The mage script only applies to Magento 1.x.

  • Magento 2 uses its own CLI tool (bin/magento).

  • Always back up your site before installing or upgrading extensions.

  • Use the community channel unless you add a third‑party channel with:

    Terminal window
    ./mage channel-add <channel_url>