Nextcloud’s external storage support transforms your self-hosted cloud into a unified hub for all your data, regardless of where it lives. Whether you need to connect S3-compatible object storage, access legacy FTP servers, or mount local directories outside the Nextcloud data folder, the external storage app provides flexible mounting options that integrate seamlessly with Nextcloud’s file browser.

This guide walks through configuring external storage backends in Nextcloud, with practical examples for common scenarios that developers and power users encounter in 2026.

Prerequisites

Before configuring external storage, ensure you have:

To verify the external storage app is enabled, navigate to Apps > Your apps in the Nextcloud admin interface and confirm “External storage support” is active.

Adding External Storage via the Web Interface

The simplest method uses Nextcloud’s web interface. Log in as an administrator and navigate to Settings > Administration > External storage.

Adding Local Storage

For mounting directories outside the default Nextcloud data folder:

  1. In the External storage section, select Local from the storage dropdown
  2. Enter a mount point name (e.g., /media/backup-drive)
  3. Configure permissions — the web server user needs read/write access:
# Ensure Nextcloud can access the directory
sudo chown -R www-data:www-data /mnt/shared-data
sudo chmod 755 /mnt/shared-data
  1. Set the folder name that will appear in Nextcloud
  2. Click the checkmark to save

The mounted directory now appears in Nextcloud’s file browser alongside your main storage.

Configuring S3-Compatible Storage

For AWS S3, MinIO, Backblaze B2, or other S3-compatible providers:

  1. Select Amazon S3 from the storage dropdown
  2. Enter your credentials:
    • Bucket name
    • Access key ID
    • Secret access key
    • Region (or leave blank for MinIO)
  3. Configure the hostname for MinIO or other S3-compatible services:
# MinIO configuration example
Hostname: minio.example.com
Port: 9000
  1. Enable “SSL” for production deployments
  2. Save the configuration

The S3 bucket mounts as a folder in Nextcloud, with files stored remotely but accessible through the web interface. Files are not automatically downloaded — Nextcloud accesses them on-demand unless you enable caching.

WebDAV Mounts

For connecting to ownCloud, Nextcloud instances, or WebDAV-enabled servers:

  1. Select WebDAV from the storage dropdown
  2. Enter the WebDAV URL:
# WebDAV URL format
https://remote-server.com/remote.php/dav/files/username/
  1. Provide credentials or use an app password
  2. Configure the remote subfolder if needed

WebDAV mounts support both basic authentication and OAuth2, depending on your server configuration.

Command-Line Configuration

For automated deployments or scripted setups, use the Nextcloud occ command:

# List current external storage mounts
occ files_external:list

# Create an S3 mount
occ files_external:amazon-s3 \
  --bucket=my-bucket \
  --hostname=s3.amazonaws.com \
  --region=us-east-1 \
  --access-key=AKIAIOSFODNN7EXAMPLE \
  --secret-key=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY \
  --mount-point=s3-archive \
  --user=admin

# Create a local mount
occ files_external:local \
  --path=/mnt/external-drive \
  --mount-point=archive \
  --user=admin

The occ files_external:applicable command controls which users or groups can access specific mounts.

Programmatic Access with the WebDAV API

Once external storage is mounted, access files programmatically using Nextcloud’s WebDAV endpoint:

import requests
from requests.auth import HTTPBasicAuth

base_url = "https://cloud.example.com/remote.php/dav/files/admin/"
auth = HTTPBasicAuth("admin", "your-app-password")

# List files in external storage mount
response = requests.request(
    "PROPFIND",
    base_url + "s3-archive/",
    auth=auth,
    headers={"Depth": "1"}
)

print(response.text)

# Upload a file
with open("backup.tar.gz", "rb") as f:
    response = requests.put(
        base_url + "s3-archive/backup.tar.gz",
        auth=auth,
        data=f,
        headers={"Content-Type": "application/gzip"}
    )

This approach works with any external storage backend — Nextcloud handles the translation between its WebDAV interface and the underlying storage type.

Performance Considerations

External storage introduces latency compared to local Nextcloud storage. Optimize performance with these strategies:

Enable caching in your mount configuration to store frequently accessed files locally:

# Via occ command
occ files_external:option 1 enable_cache true

Configure preload for directories with predictable access patterns:

occ files_external:option 1 preallocate 100

Use the filesystem scanner sparingly — for large S3 buckets, consider using S3-native tools for bulk operations and only mount specific prefixes in Nextcloud.

Security Best Practices

When configuring external storage, follow these security practices:

Troubleshooting Common Issues

Permission denied errors: Verify the web server user has filesystem access to local mounts. Check SELinux or AppArmor policies on Linux systems.

S3 authentication failures: Confirm credentials are correct and the IAM user has s3:GetObject and s3:PutObject permissions for the specific bucket.

Slow performance: Enable caching, check network latency to the storage backend, and consider mounting only necessary subdirectories rather than entire buckets.

Mount not appearing: Clear the Nextcloud cache and verify the mount configuration is saved:

occ files_external:verify 1
occ maintenance:repair

Use Cases for Developers

External storage excels in several developer-focused scenarios:

Conclusion

Nextcloud’s external storage capabilities turn your self-hosted cloud into a flexible data hub that integrates with virtually any storage backend. Whether you’re connecting enterprise S3 buckets or legacy file servers, the configuration options covered here provide the foundation for building robust, multi-source file management systems.

Start with local mounts to understand the mechanics, then expand to network-based backends as you refine your setup. The combination of web interface configuration and command-line tools gives you both quick setup and automation-ready deployment options.

Built by theluckystrike — More at zovo.one