Sylius CE Installation
Last updated
Was this helpful?
Last updated
Was this helpful?
The recommended way of creating a new Sylius-based project is to use our project template.
This command will create an AcmeStore
directory with the downloaded latest version of Sylius Standard, and install its dependencies. Before we go further, we have to enter the AcmeStore
directory.
Before we perform an initial installation of Sylius, we need to have our front-end assets built. People often use Yarn over npm due to features like workspaces, offline caching, and faster installation times, which can be particularly useful in large-scale or complex projects. However, npm has improved significantly over time and can also be a great choice for managing your front-end packages.
To make installing Sylius easier, we provide an interactive process for it. But before we start the installer, we need to define the database's credentials. For the local development, the best choice is to use local .env
files.
To define your database connection string, create the .env.local
file with the following content:
Once you have the database configured, we can run the interactive installer by running the below command in the project's root directory:
In the first step, Sylius checks whether the system meets the requirements. The second step is dedicated to setting up the database we configured earlier. When the database schema is ready, we can choose whether we want to install the demo data. Next we go through a basic shop configuration and generating tokens for the Sylius API. At the end, Sylius will automatically install assets from the already installed bundles and plugins.
During the sylius:install
command you will be asked to provide important information, but also its execution ensures that the default currency (USD) and the default locale (English - US) are set. They can be changed later, respectively in the “Configuration > Channels” section of the admin and in the config/services.yaml
file. If you want to change these before running the installation command, set the locale
and sylius_installer_currency
parameters in the config/services.yaml
file. From now on all the prices will be stored in the database in USD as integers, and all the products will have to be added with a base american english name translation.
In order to send emails you need to configure Mailer Service. Basically there are multiple ways to do it:
(deprecated) Use SwiftMailer with this short configuration:
Create an account on a mailing service.
In your .env
file modify/add the MAILER_URL
variable.
We strongly recommend using the Symfony Local Web Server by running the symfony server:start
command and then accessing https://127.0.0.1:8000
in your web browser to see the shop.
You can log to the administrator panel located at /admin
with the credentials you have provided during the installation process.
After you have successfully gone through the installation process of Sylius-Standard you are probably going to start developing within the framework of Sylius.
In the root directory of your project you will find these important subdirectories:
config/
- here you will be adding the yaml configuration files including routing, security, state machines configurations etc.
var/log/
- these are the logs of your application
var/cache/
- this is the cache of you project
src/
- this is where you will be adding all you custom logic in the App
public/
- there you will be placing assets of your project
To enable asynchronous tasks (for example for Catalog Promotions), remember about running messenger consumer in a separate process, use the command:
We are recommending to use where out of the box, you can deliver emails by configuring the MAILER_DSN
variable in your .env file.
In Symfony Mailer use the
You can learn more about configuring mailer service in
Get to know more about using Symfony Local Web Server. If you are using a built-in server check .
As it was mentioned before we are basing on Symfony, that is why we’ve adopted its approach to architecture. Read more . Read also about the .
For production environments, we suggest usage of more robust solution like Supervisor, which will ensure that the process is still running even if some failure will occur. For more information, please visit .
You can learn more about Catalog Promotions .
If you would like to contribute to Sylius - please go to the .