Installation for Linux¶
If you prefer using containers or have problems with configuring PostgreSQL, Redis and Elasticsearch, try Using Docker for Development instructions.
Before you are ready to run Saleor you will need additional software installed on your computer.
Saleor requires Python 3.4 or later. A compatible version comes preinstalled with most current Linux systems. If that is not the case consult your distribution for instructions on how to install Python 3.6.
Version 8 or later is required. See the installation instructions.
Debian and Ubuntu users who install Node.js using system packages will also need to install the
Saleor needs PostgreSQL version 9.4 or above to work. Use the PostgreSQL download page to get instructions for your distribution.
Some features like PDF creation require that additional system libraries are present.
Debian / Ubuntu¶
Debian 9.0 Stretch or newer, Ubuntu 16.04 Xenial or newer:
$ sudo apt-get install build-essential python3-dev python3-pip python3-cffi libcairo2 libpango-1.0-0 libpangocairo-1.0-0 libgdk-pixbuf2.0-0 libffi-dev shared-mime-info
$ sudo yum install redhat-rpm-config python-devel python-pip python-cffi libffi-devel cairo pango gdk-pixbuf2
$ sudo pacman -S python-pip cairo pango gdk-pixbuf2 libffi pkg-config
$ emerge pip cairo pango gdk-pixbuf cffi
Clone the repository (or use your own fork):
$ git clone https://github.com/mirumee/saleor.git
Enter the directory:
$ cd saleor/
Install all dependencies:
We strongly recommend creating a virtual environment before installing any Python packages.
$ pip install -r requirements.txt
We try to provide usable default values for all of the settings. We’ve decided not to provide a default for
SECRET_KEYas we fear someone would inevitably ship a project with the default value left in code.
$ export SECRET_KEY='<mysecretkey>'
Secret key should be a unique string only your team knows. Running code with a known
SECRET_KEYdefeats many of Django’s security protections, and can lead to privilege escalation and remote code execution vulnerabilities. Consult Django’s documentation for details.
Create a PostgreSQL user:
See PostgreSQL’s createuser command for details.
You need to create the user to use within your project. Username and password are extracted from the
DATABASE_URLenvironmental variable. If absent they both default to
While creating the database Django will need to create some PostgreSQL extensions if not already present in the database. This requires a superuser privilege.
For local development you can grant your database user the
SUPERUSERprivilege. For publicly available systems we recommend using a separate privileged user to perform database migrations.
Create a PostgreSQL database
See PostgreSQL’s createdb command for details.
Database name is extracted from the
DATABASE_URLenvironmental variable. If absent it defaults to
Prepare the database:
$ python manage.py migrate
This command will need to be able to create database extensions. If you get an error related to the
CREATE EXTENSIONcommand please review the notes from the user creation step.
Install front-end dependencies:
$ npm install
If this step fails go back and make sure you’re using new enough version of Node.js.
Prepare front-end assets:
$ npm run build-assets
$ npm run build-emails
Start the development server:
$ python manage.py runserver