Blog navigation keyboard_arrow_down

Blog Rss rss_feed

Efficient PrestaShop Installation via CLI: A Comprehensive Guide for Advanced Users

Efficient PrestaShop Installation via CLI: A Comprehensive Guide for Advanced Users

Installing PrestaShop via CLI (Command Line Interface) is a fast and flexible way to set up an online store. CLI allows users to execute commands directly without relying on graphical interfaces, making it ideal for experienced users, web developers, and administrators who value automation and time optimization, especially when deploying stores across multiple servers. If you prefer a more standard installation, refer to our article on traditional PrestaShop installation here.

Steps to Install PrestaShop via CLI

Below is a step-by-step guide explaining each command with useful tips.

1. Download PrestaShop

Start by downloading the latest version of PrestaShop. We recommend checking the current version on GitHub.

wget https://github.com/PrestaShop/PrestaShop/releases/download/8.2.0/prestashop_8.2.0.zip

2. Unzip the downloaded archive

Extract the archive to access all the files.

unzip prestashop_8.2.0.zip

3. Delete unnecessary files

After unzipping, delete the original archive and some extra files to free up space.

rm prestashop_8.2.0.zip rm index.php rm Install_PrestaShop.html

4. Unzip the main PrestaShop files archive

Now, unzip the internal archive containing the core PrestaShop files.

unzip prestashop.zip

5. Delete the main archive

Since files are now extracted, remove the main archive to save space.

rm prestashop.zip

6. Go to the installation folder

Switch to the install folder to begin the CLI installation.

cd install

7. Start the installation via CLI

Using the php index_cli.php command, specify all installation parameters:

  • --domain — your site's URL.
  • --db_server — the database server, typically localhost.
  • --db_name — the database name.
  • --db_user and --db_password — database username and password.
  • --prefix — table prefix, default is ps_.
  • --email and --password — admin account credentials.
  • --language, --timezone, --country — language, timezone, and country settings.
  • --ssl — SSL setting (recommended to enable by using 1).

Example command:

php index_cli.php --domain=domain.com --db_server=localhost --db_name=name --db_user=user --db_password=password --prefix=ps_ --email=demo@demo.com --password=demodemo --language=language --timezone=timezone --country=country --ssl=1

The full list of parameters is available in the official documentation.

8. Return to the root directory

Once the installation is complete, return to the root directory.

cd ..

9. Delete the installation folder

For security, delete the install folder as it is no longer needed.

rm -r install

Installing PrestaShop via CLI is an excellent choice for those who value automation. However, keep in mind that not every hosting provider may support this installation method.

Share in the comments if you were aware of the CLI installation method and if you’ve tried it.

Was this blog post helpful to you?

    
No comments at this moment
close

Checkout

close

Favourites