# How to Deploy a Shopware Project ```php require 'recipe/shopware.php'; ``` [Source](/recipe/shopware.php) Deployer is a free and open source deployment tool written in PHP. It helps you to deploy your Shopware application to a server. It is very easy to use and has a lot of features. Three main features of Deployer are: - **Provisioning** - provision your server for you. - **Zero downtime deployment** - deploy your application without a downtime. - **Rollbacks** - rollback your application to a previous version, if something goes wrong. Additionally, Deployer has a lot of other features, like: - **Easy to use** - Deployer is very easy to use. It has a simple and intuitive syntax. - **Fast** - Deployer is very fast. It uses parallel connections to deploy your application. - **Secure** - Deployer uses SSH to connect to your server. - **Supports all major PHP frameworks** - Deployer supports all major PHP frameworks. You can read more about Deployer in [Getting Started](/docs/getting-started.md). The [deploy](#deploy) task of **Shopware** consists of: * [deploy:prepare](/docs/recipe/common.md#deployprepare) – Prepares a new release * [deploy:info](/docs/recipe/deploy/info.md#deployinfo) – Displays info about deployment * [deploy:setup](/docs/recipe/deploy/setup.md#deploysetup) – Prepares host for deploy * [deploy:lock](/docs/recipe/deploy/lock.md#deploylock) – Locks deploy * [deploy:release](/docs/recipe/deploy/release.md#deployrelease) – Prepares release * [deploy:update_code](/docs/recipe/deploy/update_code.md#deployupdate_code) – Updates code * [deploy:shared](/docs/recipe/deploy/shared.md#deployshared) – Creates symlinks for shared files and dirs * [deploy:writable](/docs/recipe/deploy/writable.md#deploywritable) – Makes writable dirs * [sw:deploy](/docs/recipe/shopware.md#swdeploy) – * [sw:database:migrate](/docs/recipe/shopware.md#swdatabasemigrate) – * [sw:plugin:refresh](/docs/recipe/shopware.md#swpluginrefresh) – * [sw:cache:clear](/docs/recipe/shopware.md#swcacheclear) – * [sw:plugin:update:all](/docs/recipe/shopware.md#swpluginupdateall) – * [sw:cache:clear](/docs/recipe/shopware.md#swcacheclear) – * [deploy:clear_paths](/docs/recipe/deploy/clear_paths.md#deployclear_paths) – Cleanup files and/or directories * [sw:cache:warmup](/docs/recipe/shopware.md#swcachewarmup) – * [sw:writable:jwt](/docs/recipe/shopware.md#swwritablejwt) – * [deploy:publish](/docs/recipe/common.md#deploypublish) – Publishes the release * [deploy:symlink](/docs/recipe/deploy/symlink.md#deploysymlink) – Creates symlink to release * [deploy:unlock](/docs/recipe/deploy/lock.md#deployunlock) – Unlocks deploy * [deploy:cleanup](/docs/recipe/deploy/cleanup.md#deploycleanup) – Cleanup old releases * [deploy:success](/docs/recipe/common.md#deploysuccess) – The shopware recipe is based on the [common](/docs/recipe/common.md) recipe. ## Usage Add {{repository}} to your _deploy.php_ file: ```php set('repository', 'git@github.com:shopware/production.git'); ``` :::note Please remember that the installation must be modified so that it can be [build without database](https://developer.shopware.com/docs/guides/hosting/installation-updates/deployments/build-w-o-db#compiling-the-storefront-without-database). ::: ## Configuration ### default_timeout [Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L23) Overrides [default_timeout](/docs/recipe/common.md#default_timeout) from `recipe/common.php`. ### shared_files [Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L26) Overrides [shared_files](/docs/recipe/deploy/shared.md#shared_files) from `recipe/deploy/shared.php`. These files are shared among all releases. ```php title="Default value" [ '.env', 'install.lock', 'public/.htaccess', 'public/.user.ini', ] ``` ### shared_dirs [Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L34) Overrides [shared_dirs](/docs/recipe/deploy/shared.md#shared_dirs) from `recipe/deploy/shared.php`. These directories are shared among all releases. ```php title="Default value" [ 'config/jwt', 'files', 'var/log', 'public/media', 'public/thumbnail', 'public/sitemap', ] ``` ### writable_dirs [Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L45) Overrides [writable_dirs](/docs/recipe/deploy/writable.md#writable_dirs) from `recipe/deploy/writable.php`. These directories are made writable (the definition of "writable" requires attention). Please note that the files in `config/jwt/*` receive special attention in the `sw:writable:jwt` task. ```php title="Default value" [ 'config/jwt', 'custom/plugins', 'files', 'public/bundles', 'public/css', 'public/fonts', 'public/js', 'public/media', 'public/sitemap', 'public/theme', 'public/thumbnail', 'var', ] ``` ## Tasks ### sw:cache:clear [Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L61) This task remotely executes the `cache:clear` console command on the target server. ### sw:cache:warmup [Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L67) This task remotely executes the cache warmup console commands on the target server, so that the first user, who visits the website, doesn't have to wait for the cache to be built up. ### sw:database:migrate [Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L73) This task remotely executes the `database:migrate` console command on the target server. ### sw:plugin:refresh [Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L77) ### sw:plugin:update:all [Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L113) ### sw:writable:jwt [Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L123) ### sw:deploy [Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L130) Grouped SW deploy tasks. This task is group task which contains next tasks: * [sw:database:migrate](/docs/recipe/shopware.md#swdatabasemigrate) * [sw:plugin:refresh](/docs/recipe/shopware.md#swpluginrefresh) * [sw:cache:clear](/docs/recipe/shopware.md#swcacheclear) * [sw:plugin:update:all](/docs/recipe/shopware.md#swpluginupdateall) * [sw:cache:clear](/docs/recipe/shopware.md#swcacheclear) ### deploy [Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L139) Deploys your project. This task is group task which contains next tasks: * [deploy:prepare](/docs/recipe/common.md#deployprepare) * [sw:deploy](/docs/recipe/shopware.md#swdeploy) * [deploy:clear_paths](/docs/recipe/deploy/clear_paths.md#deployclear_paths) * [sw:cache:warmup](/docs/recipe/shopware.md#swcachewarmup) * [sw:writable:jwt](/docs/recipe/shopware.md#swwritablejwt) * [deploy:publish](/docs/recipe/common.md#deploypublish) ### sw-build-without-db:get-remote-config [Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L149) ### sw-build-without-db:build [Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L162) ### sw-build-without-db [Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L166) This task is group task which contains next tasks: * [sw-build-without-db:get-remote-config](/docs/recipe/shopware.md#sw-build-without-dbget-remote-config) * [sw-build-without-db:build](/docs/recipe/shopware.md#sw-build-without-dbbuild)