This is a simple tutorial, if you have a single Shopware shop, that you would love to share with someone else. The challenge is to configure Shopware in a way, that TWIG links will be rendered correctly, so that a full navigation is possible using the external static hostname.
1. Start Shopware
Start your local Shopware installation
Here is a simple Docker line using the dockware.io project to lunch Shopware 18.104.22.168 with Port 443 (HTTPS).
docker run -p443:443 dockware/dev:22.214.171.124
2. Sales Channel Domain
We want our shop to render all links with the correct static hostname.
Otherwise visitors would be redirected to https://localhost when clicking somewhere, which does obviously only exist on the local machine, and not from remote.
This is why we have to add a new domain to our sales channel.
Just use your personal static hostname and enter it in the administration of Shopware.
Pay attention to the HTTP(s) scheme, when doing this!
3. Start Tunnel
You can now decide what service you want to use for your tunnel.
Now it's time to start NGROK.
If you are not yet familiar with NGROK you might want to check it out here: https://ngrok.com/
All we need is to run this line with port 443 and with our hostname.
This will make sure that our shop thinks there is a request for this hostname, and not for the NGROK domain that would be used otherwise.
If you want to use the Cloudflare service, run the following command.
This will start a tunnel that redirects to your HTTPS localhost.
It will also ensure sure that our shop thinks there is a request for our static hostname, and not for the Cloudflare domain that would be used otherwise.