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:
- A working Nextcloud installation (version 27 or later recommended)
- The External Storage support app enabled in your Nextcloud admin settings
- Appropriate credentials or access keys for your chosen storage backend
- Sufficient permissions to create mount points in Nextcloud
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:
- In the External storage section, select Local from the storage dropdown
- Enter a mount point name (e.g.,
/media/backup-drive) - 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
- Set the folder name that will appear in Nextcloud
- 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:
- Select Amazon S3 from the storage dropdown
- Enter your credentials:
- Bucket name
- Access key ID
- Secret access key
- Region (or leave blank for MinIO)
- Configure the hostname for MinIO or other S3-compatible services:
# MinIO configuration example
Hostname: minio.example.com
Port: 9000
- Enable “SSL” for production deployments
- 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:
- Select WebDAV from the storage dropdown
- Enter the WebDAV URL:
# WebDAV URL format
https://remote-server.com/remote.php/dav/files/username/
- Provide credentials or use an app password
- 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:
- Use IAM roles or limited-access credentials instead of root AWS keys
- Enable TLS/SSL for all network-based storage backends
- Restrict mount access to specific users or groups via the permissions interface
- Regularly audit external storage configurations using
occ files_external:list - Store credentials in Nextcloud’s secure credential storage rather than plain configuration
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:
- Artifact storage: Connect S3 buckets to store build artifacts, release packages, and deployment scripts
- Multi-instance sharing: Mount a shared WebDAV folder across multiple Nextcloud instances for team collaboration
- Backup consolidation: Aggregate backups from multiple servers into a single S3-backed archive
- Media libraries: Connect large media storage without consuming local disk space
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