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 Ubuntu 22.04 with Nginx and PHP-FPM?

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

Quick Answer

You can install Shopware 6 on Ubuntu 22.04 using Nginx, PHP-FPM, MySQL, and Composer in under an hour if the server is prepared correctly. The biggest issues usually come from missing PHP extensions, incorrect file permissions, or a bad Nginx document root. The steps below cover the full server setup, Shopware installation, Nginx configuration, SSL preparation, and post-install checks.

Before You Start

  • Ubuntu 22.04 server — Use a clean VPS or cloud instance with sudo access.
  • Domain name pointed to the server — You’ll need this for Nginx virtual hosts and SSL later.
  • At least 4 GB RAM — Shopware becomes unstable quickly on smaller servers during indexing.
  • SSH access and basic Linux knowledge — Most of the setup happens through the terminal.
1

Install server packages

Start by updating Ubuntu and installing Nginx, MySQL, PHP-FPM, Composer, Git, and the PHP extensions Shopware needs. Missing extensions are one of the main reasons the installer fails halfway through. Shopware 6 runs best on PHP 8.2 right now, so avoid older PHP builds unless you have a plugin compatibility reason.

  • Update Ubuntu packages
  • Install Nginx, MySQL, PHP-FPM, and Composer
  • Enable required PHP extensions like intl, gd, curl, zip, and opcache
sudo apt update && sudo apt upgrade -y

sudo apt install nginx mysql-server unzip git curl composer
php8.2-fpm php8.2-cli php8.2-mysql php8.2-curl php8.2-gd
php8.2-xml php8.2-zip php8.2-intl php8.2-mbstring
php8.2-bcmath php8.2-soap php8.2-opcache redis-server -y
IMPORTANT If php-fpm is installed but not running, Nginx will return 502 Bad Gateway errors immediately.
2

Create the Shopware database

Shopware stores products, orders, indexes, and cache metadata inside MySQL. Create a dedicated database and user instead of using the MySQL root account. This makes migrations, backups, and permissions much easier later. Use utf8mb4 everywhere so special characters and multilingual content work properly.

  • Log into MySQL as root
  • Create a Shopware database and user
  • Grant privileges and flush permissions
sudo mysql

CREATE DATABASE shopware;
CREATE USER 'shopwareuser'@'localhost' IDENTIFIED BY 'StrongPassword';
GRANT ALL PRIVILEGES ON shopware.* TO 'shopwareuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
PRO TIP Save the database credentials somewhere secure before starting the web installer.
3

Download Shopware files

Install Shopware using Composer inside your web root directory. Composer keeps dependencies manageable and makes upgrades cleaner later. Most production stores use the production template instead of ZIP uploads because deployment workflows are easier to automate.

  • Create a project directory under /var/www
  • Install Shopware using Composer
  • Assign permissions to the www-data user
cd /var/www

sudo composer create-project shopware/production shopware

sudo chown -R www-data:www-data /var/www/shopware
sudo chmod -R 755 /var/www/shopware
COMMON MISTAKE Developers often point Nginx to the project root instead of the public directory. Shopware should serve from /public only.
4

Configure Nginx and PHP-FPM

Create an Nginx server block for your domain and connect it to PHP-FPM. Shopware depends heavily on clean rewrites, so the Nginx rules matter more than most PHP apps. If uploads or the admin panel feel unstable later, PHP memory limits and execution time are usually the reason.

  • Create an Nginx virtual host file
  • Set the document root to the public folder
  • Restart Nginx and PHP-FPM services

server {
 listen 80;
 server_name example.com;
 root /var/www/shopware/public;
 index index.php;
 location / {
  try_files $uri /index.php$is_args$args;
 }
  location ~ ^/index\.php(/|$) {
  fastcgi_pass unix:/run/php/php8.2-fpm.sock;
  fastcgi_split_path_info ^(.+\.php)(/.*)$;
  include fastcgi_params;
  fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
  internal;
 }
}
IMPORTANT If the root path does not end in /public, assets, media, and admin routing will break.
5

Run the Shopware installer

Open your domain in a browser and complete the Shopware setup wizard. The installer checks PHP extensions, database access, and file permissions automatically. Once installation finishes, remove install leftovers and lock down permissions before opening the store publicly.

  • Visit your domain in the browser
  • Enter database credentials and admin details
  • Verify storefront and admin access
PRO TIP Install SSL with Let’s Encrypt immediately after setup so admin logins and API traffic stay encrypted.

Shopware Installation Checklist

0 of 8 complete

Mistakes Most Developers Make

! Using the wrong document root

What happens: Admin assets fail to load and storefront routing becomes unstable.

Fix: Point Nginx to the /public directory only.

! Forgetting PHP extensions

What happens: The installer fails or background workers crash later during indexing.

Fix: Install all recommended PHP modules before running Composer.

! Incorrect file permissions

What happens: Theme compilation and media uploads silently fail.

Fix: Make www-data the owner of the entire Shopware directory.

Key Takeaway

The short version: Shopware 6 runs very well on Ubuntu 22.04 with Nginx and PHP-FPM if the server is configured properly from the beginning. Most failed installs come from missing PHP extensions, wrong Nginx paths, or weak file permissions—not from Shopware itself. Use Composer for installation, point Nginx at the public directory, and verify PHP-FPM before touching the web installer. Add SSL and Redis immediately after launch for a more stable production 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.