---
title: "ShopPerformance - Shopware 6: Using .env.local.php"
description: Starting with Shopware 6.4.8.0, Shopware supports writing settings directly to a .env.local.php file.
---

[Skip to content](https://knowledge.maxcluster.de/en/shopware-6-using-.env.local.php#main-content)

- [English](https://knowledge.maxcluster.de/en/shopware-6-using-.env.local.php)
- [Deutsch](https://knowledge.maxcluster.de/shopware-6-.env.local.php-verwenden)

English

Show submenu for translations

[![maxcluster\_byteamblue\_logo\_main](https://knowledge.maxcluster.de/hubfs/maxcluster_byteamblue_logo_main.svg)](https://knowledge.maxcluster.de/en)

Open main navigation

Close main navigation

- - [English](https://knowledge.maxcluster.de/en/shopware-6-using-.env.local.php)
    - [Deutsch](https://knowledge.maxcluster.de/shopware-6-.env.local.php-verwenden)

  English
  
  Show submenu for translations
- [maxcluster.de/en](https://maxcluster.de/en)

[maxcluster.de/en](https://maxcluster.de/en)

 How can we help you?

- There are no suggestions because the search field is empty.

1. [Knowledge Base (en)](https://knowledge.maxcluster.de/en)
2. [Managed Center](https://knowledge.maxcluster.de/en/managed-center)
3. [ShopPerformance](https://knowledge.maxcluster.de/en/managed-center#shopperformance)

November 27, 2025

# ShopPerformance - Shopware 6: Using .env.local.php

## Starting with Shopware 6.4.8.0, Shopware supports writing settings directly to a .env.local.php file.

**Please note:** The information in this article refers exclusively to our **ShopPerformance** tool, which you can use to identify potential performance improvements in your online shop.

### **Background**

As of Shopware 6.4.8.0 ([https://developer.shopware.com/docs/guides/hosting/performance/performance-tweaks#.env.local.php](https://developer.shopware.com/docs/guides/hosting/performance/performance-tweaks#.env.local.php)) Shopware supports the settings to be written directly to an `.env.local.php`. This function is a Symfony Core feature ([https://symfony.com/doc/current/configuration.html#configuring-environment-variables-in-production](https://symfony.com/doc/current/configuration.html#configuring-environment-variables-in-production)).  
This means that the `.env` file does not have to be parsed for each request.

However, as of May 2022, Shopware does not yet provide a way to automatically generate the `.env.local.php`. Also, the Symfony tool Flex is not shipped with Shopware.  
Currently, the `.env.local.php` must therefore still be generated manually.

### **Solution**

Although Shopware does not yet offer the possibility to generate the .env.local.php automatically, it is still possible to use the `.env.local.php` file.

For this purpose, a corresponding file can be created based on the previous `.env` file. The syntax must be rewritten into a PHP array. A corresponding file can therefore look like the following:

`<?php`

`return array (`

`       'APP_ENV' => 'prod',`

`       'APP_SECRET' => '***',`

`       'APP_URL' => 'http://sw6.c-421.maxcluster.net',`

`       'DATABASE_URL' => 'mysql://db-user-1:***@localhost:3306/db-1',`

`       'COMPOSER_HOME' => '/var/www/share/sw6.c-421.maxcluster.net/sw6/var/cache/composer',`

`       'INSTANCE_ID' => '***',`

`       'BLUE_GREEN_DEPLOYMENT' => '1',`

`       'SHOPWARE_HTTP_CACHE_ENABLED' => '1',`

`       'SHOPWARE_HTTP_DEFAULT_TTL' => '7200',`

`       'SHOPWARE_ES_HOSTS' => '',`

`       'SHOPWARE_ES_ENABLED' => '0',`

`       'SHOPWARE_ES_INDEXING_ENABLED' => '0',`

`       'SHOPWARE_ES_INDEX_PREFIX' => 'sw',`

`       'SHOPWARE_CDN_STRATEGY_DEFAULT' => 'id'`

`);`

You can find detailed information about **Shopware hosting** at **maxcluster** at [maxcluster.de/en/shopware-hosting](https://maxcluster.de/en/shopware-hosting)

If you require any further assistance, please contact our support team by phone at +49 5251/414130 or by email at [support@maxcluster.de](mailto:support@maxcluster.de) 

- [Managed Center](https://knowledge.maxcluster.de/en/managed-center#main-content)

    - [ShopPerformance](https://knowledge.maxcluster.de/en/managed-center#shopperformance)
    - [ShopSecurity](https://knowledge.maxcluster.de/en/managed-center#shopsecurity)
- [General information](https://knowledge.maxcluster.de/en/general-information)
- [Magento](https://knowledge.maxcluster.de/en/magento#main-content)

    - [Information](https://knowledge.maxcluster.de/en/magento#information)
- [Shopware](https://knowledge.maxcluster.de/en/shopware#main-content)

    - [Instructions](https://knowledge.maxcluster.de/en/shopware#instructions)

[![maxcluster-logo\_schwarz\_rot\_ohne\_claim\_cmyk](https://knowledge.maxcluster.de/hs-fs/hubfs/maxcluster-logo_schwarz_rot_ohne_claim_cmyk.png?width=200&height=31&name=maxcluster-logo_schwarz_rot_ohne_claim_cmyk.png "maxcluster-logo_schwarz_rot_ohne_claim_cmyk")](https://maxcluster.de/)

<https://www.xing.com/pages/maxclustergmbh> <https://www.linkedin.com/company/maxcluster-gmbh/> <https://www.facebook.com/> <https://www.youtube.com/@maxcluster>

Copyright © 2025, maxcluster GmbH