How to deploy Sylius to


Start with reading documentation. Also Symfony provides a guide on deploying projects to

The process of deploying Sylius to is based on the guidelines prepared for Symfony projects in general. In this guide you will find sufficient instructions to have your application up and running on

1. Prepare a project

If you do not have it yet, go to the store choose development plan and go through checkout. Then, when you will have a project ready, give it a name and proceed to Import an existing site.


To investigate if suits your needs, you can use their free trial, which you can choose as a development plan.

2. Make the application ready to deploy

  • Add the file at the root of your project repository

This is how this file should look like for Sylius:

name: sylius

type: "php:7.0"
    flavor: symfony

    database: "mysql:mysql"
    redis: "redis:redis"

        - msgpack
        - igbinary
        - memcached
        - redis

    document_root: "/web"
    passthru: "/app.php"

      - \.css$
      - \.js$

      - \.gif$
      - \.jpe?g$
      - \.png$
      - \.tiff?$
      - \.wbmp$
      - \.ico$
      - \.jng$
      - \.bmp$
      - \.svgz?$

      - \.midi?$
      - \.mpe?ga$
      - \.mp2$
      - \.mp3$
      - \.m4a$
      - \.ra$
      - \.weba$

      - \.3gpp?$
      - \.mp4$
      - \.mpe?g$
      - \.mpe$
      - \.ogv$
      - \.mov$
      - \.webm$
      - \.flv$
      - \.mng$
      - \.asx$
      - \.asf$
      - \.wmv$
      - \.avi$

      - \.ogx$

      - \.swf$

      - \.jar$

      - \.ttf$
      - \.eot$
      - \.woff$
      - \.otf$

      - /robots\.txt$

      - \.html$
      - \.pdf$

disk: 2048

    "/var/cache": "shared:files/cache"
    "/var/logs": "shared:files/logs"
    "/web/uploads": "shared:files/uploads"
    "/web/media": "shared:files/media"

    build: |
        rm web/app_dev.php
        rm web/app_test.php
        rm web/app_test_cached.php
        rm -rf var/cache/*
        php bin/console --env=prod --no-debug --ansi cache:clear
        php bin/console --env=prod --no-debug --ansi assets:install
        npm install
        npm run gulp
    deploy: |
        rm -rf web/media/*
        php bin/console --env=prod --no-debug sylius:fixtures:load
        rm -rf var/cache/*
        spec: "0 */1 * * *"
        cmd: "rm -rf web/media/* && php bin/console --env=prod --no-debug sylius:fixtures:load"
  • Add .platform/routes.yaml file:
# .platform/routes.yaml
    type: upstream
    upstream: "sylius:http"

    type: redirect
    to: "http://{default}/"
  • Add .platform/services.yaml file:

This file will load myslq and redis on your server.

# .platform/services.yaml
    type: mysql
    disk: 2048

    type: redis:2.8
  • Configure the access to the database:

In the app/config/parameters_platform.php put such code:

// app/config/parameters_platform.php

$relationships = getenv("PLATFORM_RELATIONSHIPS");

if (!$relationships) {

$relationships = json_decode(base64_decode($relationships), true);

foreach ($relationships['database'] as $endpoint) {
    if (empty($endpoint['query']['is_master'])) {

    $container->setParameter('database_driver', 'pdo_' . $endpoint['scheme']);
    $container->setParameter('database_host', $endpoint['host']);
    $container->setParameter('database_port', $endpoint['port']);
    $container->setParameter('database_name', $endpoint['path']);
    $container->setParameter('database_user', $endpoint['username']);
    $container->setParameter('database_password', $endpoint['password']);
    $container->setParameter('database_path', '');
foreach ($relationships['redis'] as $endpoint) {
    $container->setParameter('redis_dsn', 'redis://'.$endpoint['host'].':'.$endpoint['port']);

$container->setParameter('sylius.cache', array('type' => 'array'));

ini_set('session.save_path', '/tmp/sessions');

Remember to have it imported in the config:

# app/config/config.yml
    - { resource: parameters_platform.php }

3. Add as a remote to your repository:

Use the below command to add your project as the platform remote:

$ git remote add platform [PROJECT-ID]@git.[CLUSTER][PROJECT-ID].git

The PROJECT-ID is the unique identifier of your project, and CLUSTER can be eu or us - depending on where are you deploying your project.

4. Commit the specific files:

$ git add
$ git add .platform/*
$ git add app/config/parameters_platform.php
$ git add app/config/config.yml
$ git commit -m " deploy configuration files."

5. Push your project to the platform remote:

$ git push platform master

6. Connect to the project via SSH and install Sylius

The SSH command can be found in your project data on

When you get connected please run:

$ php bin/console sylius:install

Learn more