Shopware Frontends can be deployed in multiple ways, depending on the setup you are using. Most likely you will be using either a static hosting service or a server with a Node.js runtime. The different options and approaches are described below.
The biggest advantage is that there is no additional server needed to do the rendering of your page and it scales very well*, because your entire site is made of files on a server.
Single page application (SPA)
Server-side generation (SSG)
The main advantage of SSG is, that browsing activities are not affected by your API backend, because it's used to display products, categories etc. - in most cases it is the approach giving the most potential for good performance. For dynamic operations like cart, user account or checkout the API will still be called.
*The main drawback is that any change of products, categories, etc. will invalidate the generated pages and require you to re-generate them, so this approach is not ideal for sites that change often.
Popular static hosting services
There are various services that provide static hosting, such as
Each services has its own way of deploying your applications and you should refer to their documentation for more information.
Dynamic hosting (SSR)
It is the most dynamic and versatile approach and requires no invalidation and is generally better for SEO, since the page is visible to the user right away. For most eCommerce projects it is the best fit, bringing together the SEO and UX benefits of SSG and the actuality of SPA.
Drawbacks are that it requires API access at runtime for all operations. These calls are made by the Node.js server and introduce an additional round-trip (Node server>API>Node server) before the page can be fully rendered and sent to the client. For that reason, it is generally advised to optimize your network infrastructure with regard to that round trip in order to get the most out of the SSR approach. Obviously
Popular dynamic hosting services
Prepare you application
The final goal is always deployment, no less equal than development itself.
There are many good tools available that help you build and deploy your application.
Moreover, besides the frameworks or libraries that you can work with using Nitro, there are many ready-to-use platforms providers (called presets) which help you to build & deploy (docs included) your app with almost zero config:
Nitro provides also really great examples for other well known platforms (full static, or those serving SSR) and the list you can find here.
Here are the collected rules that may be followed to avoid most common issues during the deployment.
Automate the processes
Avoid doing manual work like running tests, building, release. The more work is being done automatically, there is less space for human mistake. Many platforms offer built-in CI/CD servers which help to achieve it for you codebase.
Use Continuous Integration (CI) tools
Always test your application. Test the build, do the static analyze, and whatever that can detect a potential source of problem in production build.
Use multiple environments
Test several configurations at the same time, like different nodejs version, or the upcoming release branch with upgraded dependencies. That concerns also the API your application relies on.
Prepare a checklist
Be prepared, be organized before every roll-out. Deployment checklist shouldn't be to way complicated, but should describe the flow of the work in order to get the deployment done.