Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status


prestashop (8) Versions 0.2.3

Installs and configures a web site based on Prestashop, an e-commerce open source solution

cookbook 'prestashop', '= 0.2.3', :supermarket
cookbook 'prestashop', '= 0.2.3'
knife supermarket install prestashop
knife supermarket download prestashop
Quality 0%

prestashop Cookbook

Cookbook for installing and configuring e-commerce web sites based
on Prestashop, an Open Source web
e-commerce solution.



The following packages are installed by this cookbook:

  • php5-cli
  • php5-gd
  • php5-mysql
  • tar
  • wget
  • unzip

Also the package php5-mcrypt will be installed by default, but the user can exclude it.


  • apache2
  • database
  • mysql



  • node['prestashop']['base_dir'] - directory where Prestashop will be installed (default /var/www/prestashop)
  • node['prestashop']['default_admin_dir'] - name of default admin directory
  • node['prestashop']['custom_admin_dir'] - new name for admin directory (default 'store-admin-' + rand(1000..9999).to_s)
  • node['prestashop']['install_dir'] - name of default install directory
  • node['prestashop']['settings_file'] - path to config file (default 'config/')
  • node['prestashop']['dir_owner'] - owner of installation directory (default 'www-data')
  • node['prestashop']['dir_group'] - group of installation directory (default 'www-data')
  • node['prestashop']['old_downloads_url_prefix'] - URL to get several Prestashop versions (default '')
  • node['prestashop']['version'] - Prestashop version to install (default '')
  • node['prestashop']['db_server'] - address of database server to use (default '')
  • node['prestashop']['db_name'] - database name to use (default 'prestashop_db')
  • node['prestashop']['db_user'] - database user (default 'prestashop_user')
  • node['prestashop']['db_password'] - database password (default 'V2ryD3ff3c5lt_')
  • node['prestashop']['db_prefix'] - prestashop database tables prefix (default '')
  • node['prestashop']['install_db'] - install database (yes/no, default true)

The following attributes are used on automated command line installer that comes with Prestashop:

  • node['prestashop']['domain'] - store URL (default '')
  • node['prestashop']['email'] - store admin email (default '')
  • node['prestashop']['password'] - store admin password (default 'V2ryStr4ng_')
  • node['prestashop']['store_name'] - store name (default 'My_Prestashop')
  • node['prestashop']['timezone'] - store timezone (default 'America/Caracas')
  • node['prestashop']['language'] - store main language ISO code (default 'es')
  • node['prestashop']['country'] - store country (default 've')
  • node['prestashop']['newsletter'] - send Prestashop newsletter to admin e-mail (1=yes, 0=no. Default '0')
  • node[prestashop']['install_via_cli'] - do Prestashop installation via CLI (yes/no, default true)
  • node['prestashop']['install_cli_options'] - several options to use when installing via CLI

  • node['prestashop']['translations_url_prefix'] - URL to download several translation files

  • node['prestashop']['translations'] - ISO codes of language tranlations to download and their associated version

  • node['prestashop']['do_cleanup'] - clean several unneeded files (yes/no, default true)

  • node['prestashop']['vhost_name'] - virtual host file name to use when configuring Apache web site

  • node['prestashop']['use_ssl_with_vhost'] - use SSL in virtual host configuration (yes/no, default false)

  • node['prestashop']['apache_ssl_params'] - several SSL params used when configuring Apache virtual host

  • node['prestashop']['with_php5_mcrypt'] - install and enable PHP mcrypt extension (yes/no, default true)


  • node['prestashop']['presh']['enabled'] - whether to use or not Presh (boolean, false by default because it is so experimental)
  • node['prestashop']['presh']['base_url'] - github repository base url to download Presh from ( by default)
  • node['prestashop']['presh']['revision'] - github repository branch, tag or revision of Presh to use (master by default, but it also could be something like c48cdd316d0c32c4f6958ade91b738b12a1c1330)
  • node['prestashop']['presh']['install_dir_base'] - base name of the directory where Presh will be installed in the node (default is /usr/local/presh)
  • node['prestashop']['presh']['install_dir_suffix'] - name suffix of the directory where Presh will be installed in the node (default is the concatenation of a - sign and the value of node.default['prestashop']['presh']['revision'])
  • node['prestashop']['presh']['keep_updating'] - whether to re-download a possible new version of Presh from the repository (boolean, true by default). No matter which value it has, it only will be useful when the revision used is master.
  • node['prestashop']['presh']['commands'] - array of Presh commands to execute; each entry is a hash with this convention: name is a required key pointing to a Presh command and params is an optional key pointing to a string of params expected by that command



Just include prestashop in your node's run_list:

  "run_list": [

When using it from another cookbook, you can override several attributes according to your needs. For example:

node.default['prestashop']['db_name'] = 'my_custom_database'
node.default['prestashop']['install_cli_options']['db_name'] = 'my_custom_database'
node.default['prestashop']['install_cli_options']['language'] = 'it'
node.default['prestashop']['install_cli_options']['country'] = 'it'
node.default['prestashop']['install_cli_options']['domain'] = ''
node.default['prestashop']['install_cli_options']['name'] = 'MyAwesomeStore'
node.default['prestashop']['version'] = ''

Another example when using it from a wrapper cookbook:

node.default['prestashop']['base_dir'] = '/var/www/awesomestore'
node.default['prestashop']['db_server'] = ''
node.default['prestashop']['db_name'] = 'db_awesome_store'
node.default['prestashop']['db_user'] = 'db_awesome_user'
node.default['prestashop']['db_password'] = 'db_awesome_password'
node.default['prestashop']['install_cli_options'] = {
  'domain' => '',
  'db_user' => 'db_awesome_user',
  'db_password' => 'db_awesome_password',
  'db_name' => 'db_awesome_store',
  'db_prefix' => '',
  'email' => '',
  'password' => 'TheAdminPassword',
  'name' => 'TheAwesomeStore' # no white spaces
node.default['prestashop']['vhost_name'] = 'awesomestore'
node.default['prestashop']['domain'] = ''
node.default['prestashop']['use_ssl_with_vhost'] = true
node.default['prestashop']['apache_ssl_params'] = {
  'SSLCertificateFile' => '/etc/ssl/certs/',
  'SSLCertificateKeyFile' => '/etc/ssl/private/',
  'SSLCACertificateFile' => '/etc/ssl/certs/AlphaSSL-IntermediateCA.crt'
include_recipe "prestashop::default"

When using chef-client executable with an attribute file in JSON format, for
example chef-client -o 'recipe[prestashop]' -j my-file.json, such JSON file
could be like this:

  "prestashop": {
    "base_dir": "/var/www/prestashop1.5",
    "db_name": "ps15_db",
    "install_cli_options": {
      "db_name": "ps15_db"
    "version": ""

Notice that right now there is a (needed) redundancy with some attributes
present in the install_cli_options hash, like db_name. This is because Chef
evaluates the attributes values too early and if not rewritten then some values
could be wrong for this cookbook. This is a point pending for improvement.

Also notice that db_prefix option is ignored or is not working as expected,
so some debugging will be needed to make it useful. In the meanwhile the
Prestashop installer will create every table with the ps_ prefix and the
generated config file will contain that ps_ prefix too.

If you want to use Presh in your own cookbooks take these lines as an example:

node.default['prestashop']['presh']['enabled'] = true # it is false by default
node.default['prestashop']['presh']['revision'] = 'c48cdd316d0c32c4f6958ade91b738b12a1c1330' # 'master' is the default value
node.default['prestashop']['presh']['commands'] = [
  {'name' => 'set_demo_mode', 'params' => '0'},
  {'name' => 'set_friendly_urls', 'params' => '1'},
  {'name' => 'set_debug_settings', 'params' => '0'},
  {'name' => 'optimize_via_ccc', 'params' => '1'},
  {'name' => 'fix_mail'}, # fix TLS problems patching some Prestashop core files
  {'name' => 'set_smtp_mailing', 'params' => ' SalesMailAccountPassword TLS 587'}
include_recipe "prestashop::default"


This cookbok needs automated testing, nothing has been incorporated in this respect.


Go to Github, fork it and suggest improvements or submit your issues.

License and Authors

Author: Rodolfo Castellanos (rodolfojcj at

Dependent cookbooks

apache2 >= 0.0.0
database >= 0.0.0
mysql = 5.5.3

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

prestashop CHANGELOG


  • Fix in file path


  • Fix in the way of downloading Presh


  • Inclusion of Presh as a command line tool


  • Fixes


  • Changed the default base directory where Prestashop will be installed
  • Fix in the way the URL to download Prestashop from is set. There was a bug when the configured version is different from the default one, because Chef evaluates each attribute too early, so the final URL value was wrong and as consequence the whole cookbook failed


  • Initial release of prestashop, a Chef cookbook to install and configure a web site based on Prestashop, an e-commerce Open Source solution

Foodcritic Metric

0.2.3 failed this metric

FC002: Avoid string interpolation where not required: /tmp/cook/54c6cd2949e3d6982092aec7/prestashop/recipes/install.rb:80