Now that you intend to develop for PrestaShop, you are better off keeping all your development work on your machine. The main advantage is that it makes it possible for you to entirely bypass the process of uploading your file on your online server in order to test it. Another advantage is that a local test environment enables you to test code without the risk of breaking your production store. Have a local environment is the essential first step in the path of web development.
Read System Requirements.
Installing any web-application locally requires that you first install the adequate environment, namely the Apache web server, the PHP language interpreter, the MySQL database server, and ideally a MySQL admin tool such as phpMyAdmin tool.
This is called an *AMP package: Apache+MySQL+PHP and the operating system, giving WAMP (Windows+Apache+MySQL+PHP), MAMP (macOS…) and LAMP (Linux+…). Since all of the items packaged are open-source, these installers are most of the time free.
Here is a selection of free AMP installers:
To install LAMP on your computer follow these steps (tested on Debian Buster).
apt install default-mysql-server default-mysql-client
apt install apache2
apt install libapache2-mod-php7.3 php7.3 php7.3-common php7.3-curl php7.3-gd php7.3-imagick php7.3-mbstring php7.3-mysql php7.3-json php7.3-xsl php7.3-intl php7.3-zip
If you are installing PrestaShop on a web server, then you must create the database and give access to a privileged user. You will need this user’s credentials to configure PrestaShop during the installation process.
We assume you have root access to
phpMyAdmin, and you’re using version 4.x.
phpMyAdminas the root user
User accounts, and then click on
Add user account
User nameand the
Database for user account, select
Grant all privileges
The database must be created with 4-Byte UTF-8 encoding (
For information on installation and configuring MySQL see the MySQL 5.6 documentation.
Connect as root to your MySql server. In this example our root user is called
$ mysql -u adminusername -p
Create the database and give it a name like “prestashop”:
> CREATE DATABASE prestashop COLLATE utf8mb4_general_ci;
Grant privileges to that database to a new user (the one that PrestaShop will use to connect to the database). Let’s call it “prestashopuser”.
> CREATE USER "prestashopuser"@"hostname" IDENTIFIED BY "somepassword"; > GRANT ALL PRIVILEGES ON prestashop.* TO "prestashopuser"@"hostname";
In the example above,
prestashopis the name of the new database
hostnameis usually localhost (
localhost), if you don’t know the value, check with a system administrator
somepasswordmust be a strong password and of course, only known by you
Finally, flush privileges:
> FLUSH PRIVILEGES;
The source code of PrestaShop is hosted on the Official PrestaShop GitHub Repository.
You can find all the released versions of PrestaShop here: PrestaShop releases.
Nightly releases of PrestaShop are also generated daily. Their details can be found on a public Google Cloud storage.
PrestaShop comes in two “flavors”:
Prefer cloning the repository using git for the development version.
If you intend to work on PrestaShop itself, we suggest using Git to clone the source code of PrestaShop from the GitHub repository.
As stated above, if you decide to work on PrestaShop itself, it’s best to clone the PrestaShop repository and work using git. Depending on the version of PrestaShop you want to work on, you will need to choose the right branch:
Clone the repository using Git or extract the zip package in a
prestashop folder inside the document folder of the AMP installer you chose:
Use composer to download the project’s dependencies:
cd /path/to/prestashop composer install # or alternatively: make composer
cd /path/to/prestashop make assets
You can also compile assets for the particular element of the system:
make admin-default- for the legacy back office theme
make admin-new-theme- for the new back office theme
make front-core- front office theme core assets
make front-classic- front office default theme assets
make front- all assets for the the front office
make admin- all assets for the the back office
Alternatively, you can compile assets manually.
PrestaShop needs recursive write permissions on several directories:
You can set up the appropriate permissions using this command:
$ chmod -R +w admin-dev/autoupgrade app/config var/logs cache config download img log mails modules override themes translations upload var
If you do not have some of the folders above, please create them before changing permissions. For example:
$ mkdir log var/logs
To ease up your life on a development environment, we suggest to make Apache run with your own user and group.
Open the PrestaShop installer and follow its instructions.
Depending on whether you downloaded a release package or cloned the repository, the route to the installer will be slightly different:
You can read the Getting Started guide for more details.
You may find this error message the first time you open up the Back Office.
This problem may arise in case-insensitive file systems like MacOS due to a misconfiguration. Check your Apache configuration and make sure that the root directory path to your PrestaShop matches the capitalization of the actual system path exactly. A typical error is for example having a folder named
/path/to/PrestaShop (capital P, capital S) and then configuring it in Apache as
/path/to/Prestashop (missing the capital S).