Object storage S3 for Nextcloud
Turn OtterStorage into your Nextcloud's infinite disk: scalable S3 object storage, with no surprises for requests or deletes.
Nextcloud is the most widely used self-hosted file and collaboration platform, but its Achilles' heel is storage: the server's local disk fills up, scaling means migrating volumes and backups grow out of control. OtterStorage solves this by offering S3-compatible object storage that Nextcloud can use natively, either as primary storage for the entire instance or as external storage mounted for specific users and groups.
The problem
A growing Nextcloud instance runs into the limitations of the server's local disk:
- Finite capacity. The server volume has a physical cap, and expanding it means downtime, data migration and, often, over-provisioning "just in case".
- Heavy backups. The more data on local disk, the longer the backups of the full instance take and the more space they consume.
- Rigid scaling. Spreading the load across several application nodes gets complicated when files live on a local disk instead of in a central store.
- Opaque costs. With many object providers, every generated thumbnail, every desktop client sync and every delete translates into billable requests. Nextcloud generates a huge number of requests, so that bill skyrockets.
The OtterStorage solution
OtterStorage exposes an S3-compatible endpoint at https://es-mad-1.s3.otterstorage.io that Nextcloud understands natively. Instead of writing files to the server's disk, Nextcloud stores them as objects in your bucket, with capacity that grows as you need it.
- No charges for requests or deletes. This is decisive with Nextcloud, which reads, writes, lists and deletes objects constantly (thumbnails, sync, previews). With OtterStorage you only pay for what you store, not for the number of operations.
- Elastic capacity. The bucket doesn't "fill up": add users and files without touching the server or planning disk expansions.
- Per-bucket credentials. Each bucket has its own access key and secret key, so you can isolate the Nextcloud instance from the rest of your workloads.
- Optional immutability. For critical data you can enable Object Lock (OtterVault) and bucket-level Legal Hold, so objects cannot be modified or deleted during the retention period. Useful for regulatory compliance and anti-ransomware protection.
You have two ways to connect Nextcloud with OtterStorage. Choose based on whether you want to move the entire instance or just specific folders.
How to set it up
Before you start, create a bucket in your OtterStorage panel and generate its credentials. You'll need these values in both modes:
- Endpoint / hostname:
es-mad-1.s3.otterstorage.io - Región:
eu-mad - Bucket: the name you've chosen (e.g.
mi-nextcloud) - Access key and secret key of the bucket
Mode 1: Primary Object Storage
This mode makes the entire Nextcloud instance store its files in OtterStorage. It's the recommended option for new installations or for those who want a single central store. It's configured by editing Nextcloud's config/config.php file and adding the objectstore block:
'objectstore' => [
'class' => '\\OC\\Files\\ObjectStore\\S3',
'arguments' => [
'bucket' => 'mi-nextcloud',
'autocreate' => true,
'key' => 'TU_ACCESS_KEY',
'secret' => 'TU_SECRET_KEY',
'hostname' => 'es-mad-1.s3.otterstorage.io',
'port' => 443,
'use_ssl' => true,
'region' => 'eu-mad',
// OtterStorage usa direccionamiento por ruta (path-style):
'use_path_style' => true,
],
],
Important notes about this mode:
use_path_style => truemakes requests use the formhttps://es-mad-1.s3.otterstorage.io/mi-nextcloud/...instead of a per-bucket subdomain. This is what's recommended with OtterStorage.- Set it up on an empty instance. Enabling primary storage on a Nextcloud that already has files on local disk does not migrate them automatically. If you already have data, plan the migration before changing the configuration.
- With
'autocreate' => trueNextcloud will create the bucket if it doesn't exist. If you prefer to create it yourself from the panel, set it tofalse. - In object storage, all files of all users live in the same bucket identified by an internal urn; the metadata and folder structure still live in the Nextcloud database, so keep its backups as well.
Mode 2: External Storage (External Storage app)
This mode mounts OtterStorage as an additional folder within Nextcloud, without touching the storage of the rest of the instance. It's ideal when you already have Nextcloud running and just want to give certain users or groups access to a bucket. Steps:
- Enable the External storage support app from
Apps(in the "Files" category). - Go to
Settings → Administration → External Storage. - Add a new storage and choose the type Amazon S3 (it's compatible with OtterStorage).
- Fill in the connection fields:
Carpeta mi-bucket-externo
Bucket mi-nextcloud
Hostname es-mad-1.s3.otterstorage.io
Port 443
Region eu-mad
Enable SSL sí
Enable Path Style sí
Access key TU_ACCESS_KEY
Secret key TU_SECRET_KEY
Save and check that the status indicator turns green. From there, the assigned users or groups will see the mounted folder and work against the OtterStorage bucket transparently.
Which of the two should you choose?
- Primary storage if you're setting up a new instance or want all of Nextcloud to live in object storage. Maximum scalability and a single central store.
- External storage if you already have Nextcloud running and just need to add capacity, share a specific bucket with certain users or try OtterStorage without migrating anything.
Performance recommendations
- Don't worry about the number of requests. Nextcloud generates a high volume of S3 operations (sync, thumbnails, previews, integrity checks). With OtterStorage there are no charges for requests or deletes, so you can enable previews and aggressive sync without fear of the bill.
- Cron instead of AJAX. Configure Nextcloud's background jobs with system cron so that operations against the bucket don't block the user interface.
- Limit thumbnail pre-generation. Even though requests are free, generating previews of sizes no one uses does consume CPU and storage. Tune
preview_max_x,preview_max_yand the preview providers to what you actually need. - Network proximity. If your application server is close to the
eu-madregion, the latency per operation is lower and sync runs more smoothly. - Keep a local cache of small objects. Using Redis/APCu for metadata and file locking reduces the work and greatly improves the sense of speed.
Benefits
- Limitless growth. Your Nextcloud stops depending on the size of the server's disk.
- Predictable costs. You pay for what you store, not for the millions of requests or the deletes that Nextcloud generates.
- A lighter application server. The local disk is freed up and the application nodes become practically stateless, which makes them easier to scale and replace.
- Protectable data. With Object Lock (OtterVault) and bucket-level Legal Hold you can make sensitive data immutable against accidental deletions or ransomware.
- Open standard. Being S3 compatible, you're not locked in: the same configuration works for migration and backup tools.
Want a complete backup strategy? Combine this integration with our backups guide to protect both the files and the Nextcloud database. And if you need the details of parameters and credentials, it's all in the documentation.
Shall we set it up together?
Assisted migration for Founding Otters.