---
title: Shopware PaaS Deployment for Shopware | Shopware Community Hub
description: Understanding Shopware Deployment on Shopware PaaS
canonical_url: 'https://hub.shopware.com/learn/unit/paas-deployment'
---

# Shopware PaaS Deployment for Shopware

<LearningObjectives>

- Understand the Shopware PaaS deployment process.
- Learn about Shopware PaaS configuration and services.
- Master Shopware PaaS CLI and deployment workflow.
- Understand monitoring and maintenance on Shopware PaaS.

</LearningObjectives>

# Deploying Shopware on Shopware PaaS: From Code to Live Shop

In this learning unit, you'll learn the complete Shopware PaaS deployment workflow, from project preparation to live monitoring.

<Callout title="Recap: Why Deployment Matters" type="info">

A smooth deployment process reduces downtime, prevents errors, and ensures your shop is always ready for customers. Shopware PaaS provides tools and automation to make this process seamless.

</Callout>

## The Big Picture: How Shopware PaaS Deployment Works

As you already learned, Shopware PaaS is a Platform-as-a-Service that abstracts away infrastructure headaches. You focus on your Shopware code and configuration, while Shopware PaaS handles the servers, scaling, and services.

**Typical deployment flow:**

1. Prepare your Shopware project **locally**.
2. Configure Platform.sh services and environment.
3. Push your code to the Platform.sh Git remote.
4. Platform.sh builds, deploys, and runs your shop automatically.

<Callout title="Official Documentation" type="info">

For the latest deployment steps and troubleshooting, always check the [official Shopware PaaS deployment guide](https://developer.shopware.com/docs/products/paas/shopware-paas/build-deploy.html#first-deployment).

</Callout>

### Step 1: Preparing Your Shopware Project

Before you deploy, make sure your Shopware project is ready for Shopware PaaS. This means having the right configuration files and understanding how your app will run in the cloud.

**Scenario:**  
You're setting up a new client shop. Start by cloning the Shopware template or your custom repository, then review the included Shopware PaaS config files:

- `.platform/services.yaml`: Defines databases, Redis, search, and other services
- `.platform/applications.yaml`: Main app configuration (PHP version, build/deploy hooks, mounts)
- `.platform/routes.yaml`: Routing and domains

**Example:**

```yaml
# .platform/services.yaml
# Database service
db:
    type: mysql:10.4
    disk: 2048
# Redis service
redis:
    type: redis:6.0
# Elasticsearch service
search:
    type: elasticsearch:7.7
    disk: 512
```

<Callout title="Tip" type="info">

Start with the official Shopware template for a pre-configured setup, then customize as needed for your project.

</Callout>

### Step 2: Configuring Your Environment

Shopware PaaS uses environment variables and service relationships to connect everything. Set up your environment variables for secrets, URLs, and any custom settings.

**Example:**

```bash
# Set environment variables
shopware variable:create --level project --name APP_SECRET --value 'your-secret'
shopware variable:create --level project --name ADMIN_WORKERS_ENABLED --value '1'
# Environment-specific variables
shopware variable:create --environment staging --name APP_ENV --value 'prod'
shopware variable:create --environment staging --name APP_URL --value 'https://staging.example.com'
```

**Scenario:**  
You're preparing for a staging launch. Set `APP_ENV` to `prod` and update `APP_URL` to your staging domain. This ensures your shop runs in production mode with the correct URLs.

### Step 3: Pushing Code and Deploying

With your project and environment ready, it's time to deploy:

```bash
# Initialize Git repository
git init
git add .
git commit -m "Initial commit"
# Add Platform.sh remote
shopware project:set-remote <project-id>
# Push to Platform.sh
git push platform master
```

Platform.sh will automatically build and deploy your shop using the hooks defined in `.platform/applications.yaml`:

```yaml
hooks:
    build: |
        set -e
        composer install --no-dev --optimize-autoloader
        composer dump-env prod
        bin/console assets:install
        npm ci && npm run build
    deploy: |
        set -e
        bin/console cache:clear
        bin/console database:migrate --no-interaction
        bin/console plugin:refresh
        bin/console plugin:update --all
        bin/console theme:compile
        bin/console cache:warmup
```

<Callout title="Troubleshooting" type="info">

If your build fails, check the Platform.sh build logs for missing dependencies or misconfigured hooks. The [Build & Deploy documentation](https://fixed.docs.upsun.com/create-apps/app-reference.html) has solutions for common issues.

</Callout>

### Step 4: Going Beyond the Basics

Shopware PaaS supports advanced features like multi-app setups, workers, and custom deployment workflows. As your project grows, you can:

- Add Node.js or admin apps.
- Configure workers for background tasks.
- Set up custom cron jobs and deployment hooks.

**Example:**

```yaml
# .platform/applications.yaml
shopware:
    type: php:8.1
    relationships:
        database: "db:mysql"
        redis: "redis:redis"
    web:
        locations:
            "/":
                root: "public"
                passthru: "/index.php"
admin:
    type: nodejs:16
    web:
        commands:
            start: "npm run start"
        locations:
            "/":
                root: "public"
                passthru: true
```

## Hands-on Exercise: Your First Deployment

1. Clone the Shopware template or your project repo.
2. Review and customize Platform.sh config files.
3. Set environment variables for your environment.
4. Push your code to Platform.sh and watch the deployment.
5. Verify your shop is live and working as expected.

## Key Takeaways

- **Platform.sh Configuration**: Understand the key configuration files needed for successful deployment.
- **Environment Management**: Learn how to manage different environments and their specific settings.
- **Deployment Workflow**: Master the Git-based deployment process from code to live shop.
- **Troubleshooting**: Know how to diagnose and fix common deployment issues.

## Next Steps

Now that you understand how to deploy your Shopware application successfully, it's time to automate your development workflow.

In the next learning unit, we'll explore continuous integration and how to set up automated testing and deployment pipelines that will make your development process more efficient and reliable.
