Warning: You are browsing the documentation for PrestaShop 1.7, which is outdated.
You might want to look at the current version, PrestaShop 8. Read the updated version of the documentation
Since version 1.5.4, PrestaShop has a command-line installer.
This special installer makes it possible to install PrestaShop without the need to use a web browser: simply put the content of the zip archive on your web server or pull code from an official PrestaShop repository, and you can install PrestaShop through your command-line interface (CLI).
composer install
from project’s root directory.The point of having a CLI installer in addition to the regular in-browser installer is to provide a solution to some advanced users, who often prefer command-line interfaces as they tend to give a more concise and powerful means to control a program or operating system. We can see the advantage of CLI installer in Continuous Integration processes.
To use the CLI installer, use your terminal, go to the /install
(or /install-dev
) folder, and start the script with this command:
php index_cli.php
This command, by default, will display the various available options:
Argument | Description | Default value | Allowed values |
---|---|---|---|
step |
Installation steps to execute | all | all, database, fixtures, theme, modules, postInstall |
language |
Language ISO code to install | en | 2 letters ISO 639-1 code (ISO 639-1) with available translation files in /translations |
all_languages |
Installs all available languages | 0 | 0, 1 |
timezone |
Set timezone of instance | Europe/Paris | Valid timezone (TZ Database) |
base_uri |
Base URI (appended after domain name) | / | Any URI |
domain |
Domain name for the shop (without http/s) | localhost | Any domain name or IP address |
db_server |
Database server hostname | localhost | Any valid MySQL valid server name or IP address |
db_user |
Database server user | root | Any valid MySQL user name |
db_password |
Database server password | "" | The valid password for db_user |
db_name |
Database name | prestashop | string |
db_clear |
Drop existing tables | 1 | 0, 1 |
db_create |
Create the database if not exists | 0 | 0, 1 |
prefix |
Prefix of table names | ps_ | string |
engine |
Engine for MySQL | InnoDB | InnoDB, MyISAM |
name |
Name of the shop | PrestaShop | string |
activity |
Default activity of the shop | 0 | Id of an activity (Complete list of activities) |
country |
Country of the shop | fr | 2 letters Alpha-2 code of ISO-3166 list(ISO-3166) |
firstname |
Admin user firstname | John | string |
lastname |
Admin user lastname | Doe | string |
password |
Admin user password | Correct Horse Battery Staple | string |
email |
Admin user email | [email protected] | string |
license |
Show PrestaShop license after installation | 0 | 0, 1 |
theme |
Theme name to install | "" (classic) | Theme name (located in /themes ) |
ssl |
Enable SSL (from PS 1.7.4) | 0 | 0, 1 |
rewrite |
Enable rewrite engine | 1 | 0, 1 |
fixtures |
Install fixtures | 1 | 0, 1 |
To start the installation, we recommend that you provide at least these arguments :
domain
. The domain name where your shop will be available.db_server
. The database server address.db_name
. The name of the database you want to use. We strongly recommend that you change the default prestashop
valuedb_user
. The username for the database you want to use.db_password
. The password for the database username above.prefix
. We strongly recommend that you change the default ps_
value.email
. Your email to connect to the Back Office.password
. The password to connect to the Back Office.Example:
php index_cli.php
--domain=example.com
--db_server=sql.example.com
--db_name=myshop
--db_user=root
--db_password=123456789
--prefix=myshop_
--email=[email protected]
--password=mystrongpassword
If the installation completes without any errors, you should see the following confirmation:
-- Installation successful! --
CREATE DATABASE xxx;
statement.
If the database is not created, please use argument --db_create=1
to create the database.3306
, please specify it in the db_server
argument like this :
--db_server=sql.example.com:3307