Command Line Installation Wizard

Last modified by Keizer on Thu, February 26, 2009 17:09
Source|Old Revisions  |  Back To Group

This is an old revision of the document!

The typical installation scenario for SSH goes something like this:

  1. Grab the Magneto GZIP file
  2. Extract the files
  3. Set the appropriate permissions
  4. Run through the web-based installer

But did you know you can even use SSH to bypass the web-based installer and do it directly from the command line? Here’s how to do it:

After you’ve gone through the basic installation steps, run the following command:

  1. php-cli -f install.php --
  2. --license_agreement_accepted "yes"
  3. --locale "en_US"
  4. --timezone "America/Los_Angeles"
  5. --default_currency "USD"
  6. --db_host "DB_HOST"
  7. --db_name "DB_NAME"
  8. --db_user "DB_USER"
  9. --db_pass "DB_PASS"
  10. --url "SITE_URL"
  11. --use_rewrites "yes"
  12. --use_secure "no"
  13. --secure_base_url ""
  14. --use_secure_admin "no"
  15. --admin_firstname "FIRST_NAME"
  16. --admin_lastname "LAST_NAME"
  17. --admin_email "EMAIL_ADDRESS"
  18. --admin_username "USERNAME"
  19. --admin_password "PASSWORD"

You’ll want to replace the capitalized values with the correct information for your installation:

  • DB_HOST - Databae hostname, localhost works for most people
  • DB_NAME - The name of your database
  • DB_USER - The username with access rights to the database
  • DB_PASS - The password for the database user
  • FIRST_NAME - The store owner’s first name
  • LAST_NAME - The store owner’s last name
  • EMAIL_ADDRESS - The store owner’s email address
  • USERNAME - The administrator’s username
  • PASSWORD - The administrator’s password

After you run that, it will tell you Magento was installed successfully. Since we didn’t set the flag for the encryption key, one will automatically be generated and displayed on the screen.

There are a number of flags we can set that aren’t listed in the previous example command, most of which are optional. You can also change some of the other required flags, like the locale, timezone, and default currency.

For a complete list of all the flags available, view the source code for the install.php file.

And just to give another example, here’s a command with all of the flags set:

  1. php-cli -f install.php --
  2. --license_agreement_accepted "yes"
  3. --locale "en_US"
  4. --timezone "America/Los_Angeles"
  5. --default_currency "USD"
  6. --db_host "localhost"
  7. --db_name "magento"
  8. --db_user "dbuser"
  9. --db_pass "p4ssw0rd"
  10. --db_prefix "mag"
  11. --session_save "db"
  12. --admin_frontname "system"
  13. --url ""
  14. --use_rewrites "yes"
  15. --use_secure "yes"
  16. --secure_base_url ""
  17. --use_secure_admin "yes"
  18. --admin_firstname "John"
  19. --admin_lastname "Smith"
  20. --admin_email ""
  21. --admin_username "admin"
  22. --admin_password "a123b456"
  23. --encryption_key "BRuvuCrUd4aSWutr"

You should be able to recognize all of the flags above, they’re the same things you set via the web-based installer.

It should be pointed out that you don’t need to have this split up on individual lines. You can remove the line-breaks and the backslashes to put the whole command on one line. For the sake of readability, each flag is on its own line.


Magento 2 GitHub Repository

Magento Job Board - Some sort of tag line goes here

Latest Posts| View all Jobs