Skip to content

Commit 49d0920

Browse files
authored
Merge pull request #349 from ByteInternet/shopware6-object-storage-docs
Shopware6 object storage docs
2 parents b17d58d + 8e30485 commit 49d0920

File tree

1 file changed

+105
-0
lines changed

1 file changed

+105
-0
lines changed
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
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+
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.
12+
13+
Using remote object storage in Shopware 6 provides several benefits, including:
14+
15+
- Offloading storage from your server, reducing the load on your server, and improving performance.
16+
- 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.
17+
- Allows for effortless storage capacity scaling, as you can easily increase the storage capacity of your remote storage location.
18+
- Serving assets from a CDN, which can improve the performance of your website.
19+
20+
## Configuring the application
21+
22+
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.
23+
24+
**Hypernode Object Storage**
25+
26+
If you're using Hypernode Object Storage, you need to make sure that the configuration file contains the following:
27+
28+
```yaml
29+
shopware:
30+
filesystem:
31+
public:
32+
type: 'amazon-s3'
33+
config:
34+
bucket: 'main'
35+
region: 'EU'
36+
endpoint: 'management url'
37+
use_path_style_endpoint: true
38+
credentials:
39+
key: 'access key'
40+
secret: 'secret key'
41+
```
42+
43+
You can get the required management URL, access key, and secret key by running `hypernode-object-storage info` with the `--with-credentials` flag:
44+
45+
```console
46+
app@testapp ~ # hypernode-object-storage info --with-credentials
47+
+--------------------------------------+----------------+---------+-------------+-------------------------------------+---------------+---------------+
48+
| UUID | Name | Plan | Hypernodes | Management URL | Access Key | Secret Key |
49+
+--------------------------------------+----------------+---------+-------------+-------------------------------------+---------------+---------------+
50+
| 12345678-9012-3456-b7e3-19ab43df4a23 | testappbucket1 | OS200GB | testapp | https://example.ams.objectstore.eu | abcd1234 | abcd1234 |
51+
+--------------------------------------+----------------+---------+-------------+-------------------------------------+---------------+---------------+
52+
```
53+
54+
**AWS S3**
55+
56+
If you're using the AWS S3 service, your configuration file should include the following:
57+
58+
```yaml
59+
shopware:
60+
filesystem:
61+
public:
62+
type: 'amazon-s3'
63+
config:
64+
bucket: 'your bucket name'
65+
region: 'your aws region'
66+
credentials:
67+
key: 'your aws access key'
68+
secret: 'your aws secret key'
69+
```
70+
71+
### Shopware remote storage documentation
72+
73+
For more details on configuring remote storage in Shopware, you can refer to the official [Shopware Filesystem documentation](https://developer.shopware.com/docs/guides/hosting/infrastructure/filesystem.html)
74+
75+
## Syncing the files
76+
77+
You can use the following to sync the files between your local and remote storage:
78+
79+
```bash
80+
hypernode-object-storage objects sync public/media/ s3://bucket_name/media/
81+
```
82+
83+
In the case of Hypernode Object Storage, the bucket name will always be `main`.
84+
85+
The `hypernode-object-storage objects sync` command runs the sync process in the background
86+
and provides the Process ID (PID). You can monitor the sync progress using:
87+
88+
```bash
89+
hypernode-object-storage objects show PID
90+
```
91+
92+
Alternatively, you can use the AWS CLI directly:
93+
94+
```bash
95+
aws s3 sync public/media/ s3://bucket_name/media/
96+
```
97+
98+
## Serving assets from your S3 bucket
99+
100+
To serve media assets directly from your S3 bucket, you need to adjust your nginx configuration.
101+
Fortunately, `hypernode-manage-vhosts` [simplifies this process for you](../../hypernode-platform/nginx/hypernode-managed-vhosts.md#object-storage-and-hypernode-managed-vhosts).
102+
103+
### Configuring Amazon S3 bucket policies
104+
105+
If you’re using Amazon S3, ensure that your S3 bucket has ACLs enabled.

0 commit comments

Comments
 (0)