# Shopware App System

If you are developing for and with Shopware, it can happen that you are using the App system.

The **worst case** is, that you develop a shop, that has a **third-party app** installed. And this app, or its backend-system, also **sends data to the shop**. If you are working locally, there's just **no chance** to make this work without things like tunnels.

It's indeed possible to just use a tunnel system without SquadDNS, but if you only get random domains, you also register **all kinds of random domains** in the system of the app manufacturer which leads to a lot of temporary and useless data.&#x20;

It's technically okay, but let's be fair and avoid this, right?

This page shows you, how to setup your local Shopware to **register with your configured static hostname**, so that the external backend system can talk to your local Shopware API, if required.

## 1. Start Shopware

Start your local Shopware installation.

Here is a simple Docker line using the dockware.io project to lunch Shopware 6.5.3.0 with Port 443 (HTTPS).

```bash
docker run -p 443:443 dockware/dev:6.5.3.0
```

{% hint style="info" %}
Please keep in mind, there is a diffent tutorial availale for setups with multiple containers, services and reverse proxy options: [shopware-with-reverse-proxy](https://docs.squad-dns.com/tutorials/shopware/shopware-with-reverse-proxy "mention")
{% endhint %}

## 2. Start Tunnel

{% tabs %}
{% tab title="NGROK" %}
If you use NGROK for your tunnels, please see the following sections.\
If you are not yet familiar with NGROK you might want to check it out here: <https://ngrok.com/>

Now start NGROK with the corresponding port, such as HTTPS 443, as well as your static hostname. This one will make sure that all incoming requests are recognized as **{my-hostname}**.

```bash
ngrok http --region=eu --host-header={my-hostname} 443
```

{% endtab %}

{% tab title="Cloudflare" %}
If you use Cloudflare for your tunnels, please see the following sections.

OIf you just have a single Shopware container, you only need to start Cloudflare with the corresponding port, such as HTTPS, as well as your static hostname. This one will make sure that all incoming requests are recognized as **{my-hostname}**.

```bash
cloudflared tunnel --no-tls-verify --http-host-header={my-hostname} --url=https://localhost
```

{% endtab %}
{% endtabs %}

## 3. Shopware URL

The next thing is to configure our Shopware to use the correct static hostname when registering with the app.

This is usually used in an app backend system to **connect to Shopware** and its API.

The value that is used inside Shopware during the registration process comes from the **APP\_URL** in the **.env** file. (The sales channel domains don't need to be changed if you don't want to).

Make sure to adjut the .env file in the root folder of Shopware like this:

```bash
APP_URL={my-full-domain-with-https-schema}}

# samples
APP_URL=https://my-name-tunnel.my-company.io
```

## 4. Update SquadDNS

The only thing that's left to do is, to copy the generated tunnel domain and add it to your record inside SquadDNS.

{% hint style="success" %}
That's it!\
You can now install and activate the App in your local Shopware.\
It will register with the external backend system and make sure that this system can reach you using the provided static hostname and tunnel.
{% endhint %}
