Add External Storage to Nextcloud with Amazon S3 Bucket: Easy Steps
This guide aims to teach you how to Add External Storage to Nextcloud with Amazon S3 Bucket. External storage in Nextcloud refers to the capability to connect and integrate different storage services and devices into the Nextcloud platform. This feature allows users to access and manage data from other external sources directly from within Nextcloud. External storage can include cloud, network, or local storage services.
Amazon S3 (Amazon Simple Storage Service) is a scalable, high-speed, web-based cloud storage service designed for online backup and archiving of data and applications. In this guide from the Orcacore team, we want to show you how you can use Amazon S3 for file storage in Nextcloud. Using Add External Storage to Nextcloud with Amazon S3 Bucket can greatly expand the capabilities of your personal cloud.
To complete this guide, you must log in to your Nextcloud dashboard and follow the steps below. If you are looking for Nexcloud installation steps, you can visit the Orcacore website and look for the Nextcloud articles. For example, you can check these guide steps for Debian 12, AlmaLinux 9, and Ubuntu 22.04:
Install Nextcloud on Ubuntu 22.04
Install and Configure Nextcloud on AlmaLinux 9
Install Nextcloud with LAMP stack on Debian 12 Bookworm
Requirements To connect an Amazon S3 bucket to Nextcloud
Before you start to Add External Storage to Nextcloud with Amazon S3 Bucket, you need the following requirements:
- A running Nextcloud instance.
- An Amazon S3 bucket created in your AWS account.
- AWS access key and secret key with permissions to access the S3 bucket.
- The External Storage Support app enabled in Nextcloud.
Now follow the steps below to complete Nextcloud S3 External Storage Setup.
Step 1. Enable External storage support application in Nextcloud
First, you must activate the external storage support app in Nexcloud. To do this, click on your profile at the top right and click on Apps.

Then, at the left panel choose Disabled Apps. Next, choose External Storage Support Application and click Enable.
Once you are done, you can proceed to the next step to start your configuration.
Step 2. Configure External Storage in Nextcloud
At this point, you can start to Add External Storage to Nextcloud with Amazon S3 Bucket. From your profile at the top right click on Adminstration Settings.
Then, on the left panel click on External Storage. In this guide, we use the Wasabi bucket. In the folder name enter the desired name like Wasabi. Select Amazon S3 Type.
In the configuration field, you need to enter your credential details. Because we use Wasabi, we enter the Wasabi bucket name and URL and enter the Wasabi region. Also, you need to select the access key and enter the secret and access key. You can also allow people to mount external storage. Finally, be sure your configuration is validated.
Note: You can check Service URLs for Wasabi’s Storage Regions From the Official Wasabi Docs page.
Finally, open the Files application, select the External storage menu, and then select your bucket. You should see something similar to this. From there, you can upload files, add folders, etc.
That’s it, you are done. You can get more information by visiting the Nextclod Docs page.
Conclusion
At this point, you have learned to Add External Storage to Nextcloud with Amazon S3 Bucket. First, you must install and configure your Nextcloud and access your dashboard. From there, you can do the guide steps and easily configure your external storage. Also, Nextclod is integrated with Wasabi. In this guide, we use the Wasabi region and URL’s.
Hope you enjoy using it. Also, you may like to read the following articles:
Install ownCloud on Ubuntu 22.04
Install Seafile Server on Ubuntu 22.04
Set Up ZFS on Debian 12 Bookworm
Alternative Solutions for Adding External Storage to Nextcloud
While the above method outlines a straightforward way to connect an Amazon S3 bucket to Nextcloud via the web interface, alternative solutions exist that might be better suited for specific needs or environments. Here are two alternatives to Add External Storage to Nextcloud with Amazon S3 Bucket:
1. Using the Command-Line Interface (CLI) and occ
command:
The occ
command is a powerful tool for managing Nextcloud instances from the command line. It allows administrators to perform various tasks, including configuring external storage, without using the web interface. This method is particularly useful for automation, scripting, and headless server environments.
-
Explanation: This method involves using the
occ
command to directly configure the external storage settings in Nextcloud’s database. It requires SSH access to the Nextcloud server and a basic understanding of command-line operations. -
Steps:
- Access the Nextcloud server via SSH.
- Navigate to the Nextcloud installation directory. This is typically
/var/www/nextcloud
. - Run the
occ
command to configure the external storage. The specific command will vary depending on your Nextcloud version, but it will generally follow this format:
sudo -u www-data php occ files_external:create s3 <mount_point> --configuration '{"bucket":"<your_bucket_name>","hostname":"<your_s3_endpoint>","accesskey":"<your_access_key>","secretkey":"<your_secret_key>","use_ssl":true,"authtype":"v4","region":"<your_region>"}'
- Replace
<mount_point>
with the desired name for the external storage in Nextcloud (e.g., "MyS3Bucket"). - Replace
<your_bucket_name>
with the name of your S3 bucket. - Replace
<your_s3_endpoint>
with the endpoint for your S3 bucket (e.g., "s3.amazonaws.com" or your region-specific endpoint). - Replace
<your_access_key>
and<your_secret_key>
with your AWS access key and secret key, respectively. - Replace
<your_region>
with your AWS region (e.g., "us-east-1").
- Verify the configuration. You can list the configured external storages using the following command:
sudo -u www-data php occ files_external:list
-
Example:
sudo -u www-data php occ files_external:create s3 MyS3Bucket --configuration '{"bucket":"my-nextcloud-backup","hostname":"s3.us-west-2.amazonaws.com","accesskey":"AKIAIOSFODNN7EXAMPLE","secretkey":"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY","use_ssl":true,"authtype":"v4","region":"us-west-2"}'
This command creates an external storage named "MyS3Bucket" connected to the "my-nextcloud-backup" S3 bucket in the us-west-2 region.
2. Using an Object Storage Gateway (e.g., MinIO):
An object storage gateway acts as an intermediary between Nextcloud and the S3 bucket. It provides a local S3-compatible interface that Nextcloud can connect to. This can improve performance, security, and control over data access.
-
Explanation: An object storage gateway, like MinIO, can be installed on the same server as Nextcloud or on a separate server within the same network. Nextcloud then connects to MinIO as if it were a local S3 service. MinIO, in turn, interacts with the actual Amazon S3 bucket.
-
Steps:
-
Install and configure an object storage gateway (e.g., MinIO). Download and install MinIO following the official documentation. Configure it to connect to your Amazon S3 bucket.
-
Configure Nextcloud to connect to the object storage gateway. In the Nextcloud admin settings, add an external storage of type "Amazon S3". Use the object storage gateway’s endpoint as the hostname (e.g.,
http://localhost:9000
if MinIO is running on the same server), and use the access key and secret key configured for MinIO.
-
-
Example (MinIO Configuration):
Assume you have MinIO running on the same server as Nextcloud and configured to use the "my-nextcloud-backup" S3 bucket. You would configure the external storage in Nextcloud with the following parameters:
- Folder name: MinIO
- Storage type: Amazon S3
- Bucket: my-nextcloud-backup
- Hostname: localhost:9000
- Access key: MINIO_ACCESS_KEY (The access key you configured for MinIO)
- Secret key: MINIO_SECRET_KEY (The secret key you configured for MinIO)
- Region: (Leave blank, as MinIO is acting as a local endpoint)
- Enable SSL: (Disable if you are not using SSL for MinIO locally)
-
Advantages of using an Object Storage Gateway:
- Improved Performance: Can reduce latency by caching frequently accessed data locally.
- Enhanced Security: Provides an additional layer of security by controlling access to the S3 bucket through the gateway.
- Greater Control: Allows for more granular control over data access and management.
- S3 Compatibility: Abstracts away the specific S3 implementation details, making it easier to switch to a different S3-compatible storage provider in the future.
These alternative methods offer greater flexibility and control over how you Add External Storage to Nextcloud with Amazon S3 Bucket. Choosing the right approach depends on your specific requirements and technical expertise.