Skip to content

Vendor-neutral, engineer-written explanations. Clear definitions first, then practical steps with real examples — no fluff.

.How do I install Shopware 6 on Apache (VirtualHost + PHP-FPM) step by step?

SB
Written by StageBit Engineering Team
Updated May 2026 4 min readVerified by engineers

Quick Answer

To install Shopware 6 on Apache with PHP-FPM, you need to configure your Linux server, install PHP extensions, create an Apache VirtualHost, connect Apache to PHP-FPM, and then run the Shopware installer. The two things most stores get wrong are incorrect document roots and missing PHP extensions. The steps below walk through a production-ready setup that works reliably on Ubuntu and Debian servers.

Before You Start

  • Ubuntu or Debian server — most Shopware production installs run on Linux with Apache 2.4+
  • Root or sudo access — you’ll need permission to install packages and restart services
  • Domain pointed to the server — Apache VirtualHosts depend on the correct DNS records
  • MariaDB or MySQL installed — Shopware needs a database before installation starts
1

Install server packages

Start by installing Apache, PHP-FPM, MariaDB, Composer, and the PHP extensions Shopware needs. Missing extensions are one of the main reasons fresh installs fail during the installer validation step. PHP-FPM handles PHP processing separately from Apache, which gives you better performance and cleaner process management compared to mod_php.

  • Install Apache, PHP 8.2+, PHP-FPM, and MariaDB
  • Install PHP extensions like intl, gd, curl, xml, zip, mbstring, bcmath, and opcache
  • Enable Apache modules rewrite, proxy_fcgi, headers, ssl, and http2
sudo apt update

sudo apt install apache2 mariadb-server composer
php php-fpm php-cli php-common php-curl php-intl
php-mbstring php-xml php-zip php-gd php-bcmath
php-mysql unzip -y

sudo a2enmod rewrite proxy_fcgi setenvif headers ssl http2

sudo systemctl restart apache2 php8.2-fpm
IMPORTANT Shopware will fail installation checks if intl, zip, or opcache are missing.
2

Download Shopware

Install Shopware into your web directory using Composer. Most developers place production projects inside /var/www. The public web root must point to the public directory inside the Shopware installation—not the project root itself (this catches people off guard during Apache setup).

  • Create a project directory under /var/www
  • Install Shopware with Composer
  • Set the correct ownership for Apache
cd /var/www

composer create-project shopware/production shopware

sudo chown -R www-data:www-data /var/www/shopware
PRO TIP Keep releases outside the web root if you plan to use zero-downtime deployments later.
3

Configure VirtualHost

Now create the Apache site configuration and connect Apache to PHP-FPM using proxy_fcgi. The most critical setting here is the DocumentRoot. It must point to /public inside your Shopware installation or media assets, admin routes, and storefront pages will break.

  • Create a new VirtualHost config file
  • Set DocumentRoot to the public directory
  • Forward PHP requests to PHP-FPM
<VirtualHost *:80>
ServerName yourdomain.com
DocumentRoot /var/www/shopware/public

<Directory /var/www/shopware/public>
    AllowOverride All
    Require all granted
</Directory>

<FilesMatch \.php$>
    SetHandler "proxy:unix:/run/php/php8.2-fpm.sock|fcgi://localhost/"
</FilesMatch>

ErrorLog ${APACHE_LOG_DIR}/shopware-error.log
CustomLog ${APACHE_LOG_DIR}/shopware-access.log combined

COMMON MISTAKE Developers often point Apache to /var/www/shopware instead of /var/www/shopware/public.
4

Enable the site

Once the VirtualHost exists, enable it and reload Apache. Before restarting, run apachectl configtest to catch syntax mistakes early. A missing bracket or typo inside FilesMatch can stop Apache from starting entirely.

  • Save the config inside sites-available
  • Enable the new site with a2ensite
  • Reload Apache after validation passes
sudo a2ensite shopware.conf

sudo apachectl configtest

sudo systemctl reload apache2
IMPORTANT Never skip configtest before reloads on production servers.
5

Complete installation

Open your domain in the browser and finish the Shopware setup wizard. You’ll enter database credentials, create the admin user, and generate the application configuration. After installation, configure HTTPS immediately and disable unused default services.

  • Create the Shopware database first
  • Open the domain and complete the installer
  • Install SSL with Let’s Encrypt after setup
PRO TIP Enable OPcache and HTTP/2 before launch—it noticeably improves admin and storefront response times.

Shopware Apache Setup Checklist

0 of 8 complete

Mistakes Most Developers Make

! Wrong document root

What happens: The storefront loads incorrectly or sensitive files become publicly accessible.

Fix: Always point Apache to the /public directory only.

! Missing PHP extensions

What happens: The installer fails dependency checks or background tasks stop working later.

Fix: Verify installed modules with php -m before running the installer.

! Incorrect file ownership

What happens: Cache clearing, plugin installs, and media uploads start failing unexpectedly.

Fix: Set ownership to www-data and avoid mixing deployment users casually.

Key Takeaway

The short version: installing Shopware 6 on Apache with PHP-FPM is mostly about getting the server foundation right before you even open the installer. The biggest issues are almost always wrong VirtualHost paths, missing PHP modules, or broken PHP-FPM socket settings. Use the public directory as your document root, validate Apache configs before reloads, and install SSL immediately after setup. Start with Step 1—that one alone handles most of it.

Was this answer helpful?

Your feedback helps us improve our answers.

Still need help?

Talk to our Shopware experts

We've handled GDPR/CCPA compliance for dozens of EU & US Shopware stores.

Talk to Shopware Experts

Tell us more about your brand!

Rohit Kundale, Our VP of Sales and Marketing is ready to meet with your team.