Skip to content

Commit d6fc327

Browse files
author
Dominik Matic
committed
How to configure remote storage for shopware 6.x
1 parent 4c5d040 commit d6fc327

File tree

1 file changed

+108
-0
lines changed

1 file changed

+108
-0
lines changed
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
---
2+
myst:
3+
html_meta:
4+
description: Configure remote storage for Shopware 6.x. Learn how to configure
5+
Shopware 6 to start storing files in your bucket.
6+
title: How to Configure Remote Storage for Shopware 6.x | Hypernode
7+
---
8+
9+
# How to Configure Remote Storage for Shopware 6.x
10+
11+
12+
Shopware 6.x supports remote storage for different types of files, allowing you to store assets such as product images, documents, and other media in an external storage service instead of the local server.
13+
14+
Using remote object storage in Shopware 6 provides several benefits, including:
15+
16+
- Offloading storage from your server, reducing the load on your server, and improving performance.
17+
- Allows you to make use of [horizontal scaling](../../hypernode-platform/autoscaling/how-does-horizontal-autoscaling-work), as you can easily add more servers without having to worry about syncing files between them.
18+
- Allows for effortless storage capacity scaling, as you can easily increase the storage capacity of your remote storage location.
19+
- Serving assets from a CDN, which can improve the performance of your website.
20+
21+
## Configuring the application
22+
23+
Configuring Shopware 6 to start storing files in your bucket is done by modifying the the general bundle configuration file located at `config/packages/shopware.yml` in your shopware root directory.
24+
25+
**Hypernode Object Storage and other S3 compatible providers**
26+
27+
If you're using Hypernode Object Storage, you need to make sure that the configuration file contains the following:
28+
29+
```yml
30+
shopware:
31+
filesystem:
32+
public:
33+
type: 'amazon-s3'
34+
config:
35+
bucket: 'main'
36+
region: 'EU'
37+
endpoint: 'management url'
38+
use_path_style_endpoint: true
39+
credentials:
40+
key: 'access key'
41+
secret: 'secret key'
42+
43+
```
44+
45+
You can get the required management URL, access key, and secret key by running `hypernode-object-storage info` with the `--with-credentials` flag:
46+
47+
```console
48+
app@testapp ~ # hypernode-object-storage info --with-credentials
49+
+--------------------------------------+----------------+---------+-------------+-------------------------------------+---------------+---------------+
50+
| UUID | Name | Plan | Hypernodes | Management URL | Access Key | Secret Key |
51+
+--------------------------------------+----------------+---------+-------------+-------------------------------------+---------------+---------------+
52+
| 12345678-9012-3456-b7e3-19ab43df4a23 | testappbucket1 | OS200GB | testapp | https://example.ams.objectstore.eu | abcd1234 | abcd1234 |
53+
+--------------------------------------+----------------+---------+-------------+-------------------------------------+---------------+---------------+
54+
```
55+
56+
**AWS S3**
57+
58+
If you're using Amazon's S3 bucket, your configuration file should include the following:
59+
60+
```yml
61+
shopware:
62+
filesystem:
63+
public:
64+
type: 'amazon-s3'
65+
config:
66+
bucket: 'your bucket name'
67+
region: 'your aws region'
68+
credentials:
69+
key: 'your aws access key'
70+
secret: 'your aws secret key'
71+
72+
```
73+
74+
## Syncing the files
75+
76+
You can use the following to sync the files between your local and remote storage:
77+
78+
```bash
79+
hypernode-object-storage objects sync pub/media/ s3://my_bucket_name/media/
80+
hypernode-object-storage objects sync var/import_export s3://my_bucket_name/import_export
81+
```
82+
83+
The `hypernode-object-storage objects sync` command runs the sync process in the background
84+
and provides the Process ID (PID). You can monitor the sync progress using:
85+
86+
```bash
87+
hypernode-object-storage objects show PID
88+
```
89+
90+
Alternatively, you can use the AWS CLI directly:
91+
92+
```bash
93+
aws s3 sync pub/media/ s3://my_bucket_name/media/
94+
aws s3 sync var/import_export s3://my_bucket_name/import_export
95+
```
96+
97+
## Serving assets from your S3 bucket
98+
99+
To serve media assets directly from your S3 bucket, you need to adjust your nginx configuration.
100+
Fortunately, `hypernode-manage-vhosts` [simplifies this process for you](../../hypernode-platform/nginx/hypernode-managed-vhosts.md#object-storage-and-hypernode-managed-vhosts).
101+
102+
### Configuring Amazon S3 bucket policies
103+
104+
If you’re using Amazon S3, ensure that your S3 bucket has ACLs enabled.
105+
106+
## Shopware remote storage documentation
107+
108+
- [Filesystem](https://developer.shopware.com/docs/guides/hosting/infrastructure/filesystem.html)

0 commit comments

Comments
 (0)