.How do I install Shopware 6 on a subfolder or subdomain the right way?
Quick Answer
You can install Shopware 6 on both a subfolder and a subdomain, but the setup is slightly different for each. The biggest mistakes usually happen around document roots, APP_URL configuration, and web server rewrites. The steps below cover the cleanest setup method for Apache and Nginx without breaking admin access, media URLs, or SEO.
Before You Start
- ✦ SSH or hosting access — you’ll need access to your web server config and Shopware files.
- ✦ A working Shopware installation package — Composer-based installs are easier to maintain long-term.
- ✦ Correct DNS records — subdomains must already point to the server before SSL setup.
Choose the installation structure
Decide early whether the store belongs in a subfolder or a subdomain because changing it later usually means URL redirects, media path updates, and cache cleanup. A subdomain like store.example.com is cleaner for separate storefronts, staging environments, or regional stores. A subfolder like example.com/store works better when the shop is part of an existing website.
- Use a subdomain for isolated Shopware deployments
- Use a subfolder only if your main site already exists
Point the web root correctly
Shopware must serve traffic from the /public directory. This is the part most hosting setups get wrong. If your document root points to the project root instead, assets, admin login, and storefront routes can fail randomly. On subfolder installs, your virtual host or rewrite rules also need to respect the folder path.
- Set the document root to /public
- Verify Apache or Nginx rewrites are enabled
DocumentRoot /var/www/shopware/publicConfigure the APP_URL
Shopware generates storefront URLs, media links, and API endpoints from the APP_URL value inside the .env file. If this URL is wrong, the admin panel may redirect incorrectly or storefront assets may load from the wrong path. Subfolder installs must include the folder name directly in the URL.
- Use full HTTPS URLs whenever possible
- Include the subfolder path if using one
APP_URL=https://example.com/storeInstall SSL and redirects
SSL should be active before you launch the storefront publicly. Shopware handles secure URLs correctly once HTTPS is enabled, but mixed-content warnings can still appear if old HTTP media paths are cached. Redirect all HTTP traffic to HTTPS immediately to avoid duplicate URL versions getting indexed.
- Install an SSL certificate for the domain or subdomain
- Force HTTPS redirects at the server level
Clear caches and test routes
After installation, clear Shopware caches and test both storefront and admin URLs carefully. Subfolder installs sometimes break media thumbnails or admin assets because of incorrect rewrite paths. Test product pages, login pages, and media uploads before going live. This catches most routing problems early.
- Run cache clear commands after config changes
- Test media, checkout, and admin access
php bin/console cache:clearShopware Installation Checklist
0 of 6 completeMistakes Most Developers Make
! Wrong document root
What happens: Storefront assets fail or sensitive files become accessible publicly.
Fix: Always point the web root directly to the /public directory.
! Incorrect APP_URL value
What happens: Admin redirects and media links start loading from the wrong URL.
Fix: Update APP_URL immediately after every domain or folder change.
! Forgetting HTTPS redirects
What happens: Search engines index duplicate HTTP and HTTPS versions of the store.
Fix: Force HTTPS at the web server level before launch.
Key Takeaway
The short version: Shopware 6 works well on both subfolders and subdomains if the server configuration is correct from the start. The biggest setup issues come from incorrect document roots, broken rewrite rules, and APP_URL mismatches. Always point traffic to the /public directory, configure HTTPS early, and clear caches after every major URL change. Subdomains are usually easier to maintain long-term for scaling and deployments. Start with Step 2—that one alone handles most of it.
Related Answers
Still need help?
Talk to our Shopware experts
We've handled GDPR/CCPA compliance for dozens of EU & US Shopware stores.