Skip to content
Home » Tutorials » Tuto – Install Sylius step by step!

Tuto – Install Sylius step by step!

Want to install Sylius? You can’t do it and/or find it complicated? Don’t worry, here’s a quick and simple tutorial that will allow you to install Sylius step by step!

The Sylius e-commerce solution, based on Symfony is on the rise at the moment and more and more developers and specialized e-commerce agencies are interested. I’m obviously one of them because, it’s obviously part of my technological watch but I like to know what’s happening in the world of e-commerce, whether on the side of e-retailers or agencies / developers.

I’m not going to compare Sylius here against other solutions on the market, whether it’s Prestashop, Shopify or WooCommerce, but rather a quick tutorial to help you simply install it and allow you to discover it in the best conditions.

Small preamble, I use here my MacBook Pro under MacOS Catalina 10.15.3 with the server Apache 2.4, MySQL 5.7, PHP 7.2 (minimum required for Sylius). All to install Sylius 1.6!

Pre-requisite to install Sylius 1.6

First, make sure your PC/Server is ready to receive Sylius 1.6. You’ll need installed and functional PHP 7.2 as well as MySQL 5.7 (if you have MySQL 8, it works too, although it’s little rependue).

At the database level, I’ll let you prepare a user and an empty database.

Don’t forget to install Composer if you don’t have it yet!

We start the installation of Sylius 1.6!

Installation de Sylius Standard

compose create-project sylius/sylius-standard nom_projet

This has the effect of downloading Sylius and all its dependencies in the folder nom_projet that Composer will create automatically. Once completed, you can go to this folder to continue.

We’re going to have to prepare the connection to the database now. So I’m going to create a file, about local at the Sylius root where I’m just going to insert the following environment variable:

DATABASE_URL-mysql://root:root@localhost/db_name

I will, of course, let you change the values here by yours. Once OK for you, you can play this command that will really install Sylius and set up some default items.

php bin/console sylius:install

During this installation, there will be a few fields to fill in interactive mode, especially if you want sample data as well as the default currency (put EUR), the local default (put fr_FR) and login information for your admin account.

Installing the front-end

Sylius uses Gulp to manage its assets and package manager Yarn. If you do not Yarn install, I let you install it, for my case, I had to install it with brew install yarn. Once installed, use

yarn install

Once completed, you have to build the front-end with

yarn build

That’s it, your Sylius shop is technically installed, all you have to do is access it.

Go to your Sylius store

Using the Symfony Web Server

Symfony packs the necessary to run a standalone server, you just have to play the command symfony server:start or php bin/console server:start. So you can access your shop with the URL http://127.0.0.1:8000 and administration with http://127.0.0.1:8000/admin.

Using Apache 2.4

If like me you have Apache 2.4 installed and configured on your server, no worries, you can use it too. I’ll leave you my setup, which works very well and allows access to my Sylius store from the URL https://dev.sylius.testet administration via https://dev.sylius.test/admin.

<VirtualHost *:80>
   DocumentRoot "/usr/local/var/www/sylius/sylius/public"
   ServerName dev.sylius.test
   ErrorLog "/usr/local/var/log/httpd/sylius_error_log"
   CustomLog "/usr/local/var/log/httpd/sylius_access_log" common
   <Directory "/usr/local/var/www/sylius/sylius/public">
        AllowOverride All
        Require all granted
         <IfModule mod_rewrite.c>
            Options -MultiViews
            RewriteEngine On
            RewriteCond %REQUEST_FILENAME!-f
            RewriteRule $ index.php[QSA,L]
        
   


<VirtualHost *:443>
   DocumentRoot "/usr/local/var/www/sylius/sylius/public"
   ServerName dev.sylius.test
   SSLEngine on
   SSLCertificateFile "/usr/local/etc/httpd/server.crt"
   SSLCertificateKeyFile "/usr/local/etc/httpd/server.key"
   ErrorLog "/usr/local/var/log/httpd/sylius_error_log"
   CustomLog "/usr/local/var/log/httpd/sylius_access_log" common
   <Directory "/usr/local/var/www/sylius/sylius/public">
        AllowOverride All
        Require all granted
         <IfModule mod_rewrite.c>
            Options -MultiViews
            RewriteEngine On
            RewriteCond %REQUEST_FILENAME!-f
            RewriteRule $ index.php[QSA,L]
        
   
127.0.0.1 dev.sylius.test

The Virtual Host part for port 80 (HTTP only) is not useful to me, but I’ll leave it to you in case you don’t want to use the HTTPS or if you don’t have a usable certificate at the moment.

Once the VH is set up, restart your server and your shop is accessible!

Quick discovery

Front Office

The default front office is quite simple but is fully functional. You have by default a selector of languages, currencies, all with a full French translation and a convincing responsive mode! The essential options for all e-commerce stores are present and allow you to start selling quickly and efficiently

Back Office

It’s the part a little more complicated to take in hand but finally, everything is in its place. As I told you for the front, back office also everything is done to allow you to sell quickly and well. Stripe and PayPal integration is available by default, you can set them up and activate them with just a few clicks.

I really like the order management which is quite simple, a few buttons to confirm the payment and to confirm the shipment. In the end, everything is pretty simple if you know where it is!

Conclusion

You can test what this e-commerce framework comes straight from Poland and based on Symfony that is starting to make a name for itself in France thanks to its power, adaptability and growing community!

I’m already preparing an upcoming tutorial that will allow you to start developing on Sylius!


Don’t hesitate to ask questions in comments or talk about the difficulties you encountered at the installation.

Also, feel free to come and see me, here or on LinkedIn, if you want to talk about Sylius’ differences, strengths and weaknesses compared to its direct competitors Prestashop, Shopify and WooCommerce or simply discuss e-commerce!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.