Rclone is a powerful command-line tool for managing files across cloud storage platforms. It supports backing up and encrypting files to the cloud, as well as restoring and decrypting them when needed. This guide walks you through setting up Rclone for use with MEGA S4.
Set up your MEGA S4
Create a new bucket
- Click Object storage on the left-hand panel.
- Click Create bucket.
- Name the bucket.
- Click Create.
Set up your access keys
- Click Object storage on the left-hand panel.
- Click Keys on the left-hand panel.
- Click Create key.
- Name the key.
- Copy the Access key and Secret key.
Standard configuration
- Download and install Rclone from the Rclone website.
- Open the command line and execute the command
rclone configto start the setup process. - Enter
nfor new remote and enter a name, for examples4. - For storage type, choose
Amazon S3 Compliant Storage Providers. - For provider, choose
MEGA S4 Object Storage. - Enter
env_auth. - Choose
Enter AWS credentials in the next step. - For
access_key_id, enter the Access key you copied earlier. - For
secret_access_key, enter the Secret key you copied earlier. - For endpoint, choose from the list provided or enter one of your choice.
- A full list can be seen in the MEGA S4 settings.
The standard configuration is now finished, but the app will ask if you want to go to the advanced configuration.
- Enter
yto go to advanced configuration settings (see below).
or
- Enter
nto finish the configuration.
- Enter
yto save the configuration. - Enter
qto quit the setup.
Advanced configuration
- s3-upload-cutoff (default 200Mb)
- Rclone switches from single part uploads to multipart uploads at the point specified by
--s3-upload-cutoff
- Rclone switches from single part uploads to multipart uploads at the point specified by
- s3-chunk-size (default 5Mb)
- The chunk sizes used in the multipart upload. The minimum limit is 5Mb which it will default to.
- s3-force-path-style
- If this option is set as
true, Rclone will use path style instead of virtual-hosted style.
- If this option is set as
Testing your configuration
Here’s how to verify that your Rclone remote (s4) is working correctly.
- Create a bucket.
rclone mkdir s4:mybucket - List your buckets.
rclone lsf s4:- You should see
mybucketin the output.
- You should see
- Delete the empty bucket.
rclone rmdir s4:mybucket - Confirm the bucket is gone.
rclone lsf s4:- No output means it was deleted successfully.
Useful commands
| Action | Command | Example |
| Lists files and directories | lsf | rclone lsf s4:bucketname or rclone lsf s4: for the top level |
| Lists objects in a bucket with sizes | ls | rclone ls s4:bucketname |
| Lists objects in a bucket with sizes and modification timestamps | lsl | rclone lsl s4:bucketname |
| Remove the empty directory at the path | size | rclone size s4:bucketname |
| Creates a bucket | mkdir | rclone mkdir s4:newbucketname |
| Remove the empty directory at path | rmdir | rclone rmdir s4:bucketname |
| Remove the path and all of its contents | purge | rclone purge s4:bucketname |
| Copies objects from source to destination | copy | rclone copy C:\MyFolder s4:bucketname |
| Copies objects from source to destination | move | rclone move C:\MyFolder s4:bucketname |
| Shows the current Rclone configuration | Shows the total size of the bucket | rclone config show |
| Syncs the destination to match the source exactly. Can be local to cloud storage or cloud to cloud | sync | rclone sync C:\MyFolder s4:bucketname\MyFolder |
More commands and configuration options can be found on the Rclone website.
Performance tuning upload speeds
The following are settings you can try, depending on the type of objects you are using.
Large object uploads – e.g., 1GB and above
Use multipart uploads
- Set
--s3-upload-cutoffto a good size, so large objects always use MPU.- Try value of 64Mi–256Mi.
- Larger
--s3-chunk-sizemeans fewer API requests and less overhead, but requires more RAM.- A good range is 64Mi, 128Mi, 256Mi.
- Increase
--s3-upload-concurrency– The number of parts uploaded in parallel per file. Higher values can hit diminishing returns or provider throttling.- A range of 4 – 32 can work well for most workloads.
- Keep
--transferslow when uploading large files. Performance scaling comes from--s3-upload-concurrency, not from file-level parallelism.- For multiple large files, increase
--transfersonly if a single file upload does not fully saturate your available bandwidth. - If one file already fills the link, increasing
--transferswill not increase total throughput. It will only increase memory usage and may trigger provider throttling.
- For multiple large files, increase
Small objects uploads (1KB to a few MB)
Prefer single PUT over multipart
- Set
--s3-upload-cutoffhigher so most “small” files stay single PUT.- Try 256Mi–1Gi
- Note: Rclone’s
--s3-upload-cutoffmax is 5 GiB.
Use high file parallelism:
--transfers(file uploads in parallel)--checkers(listing/stat in parallel)- Due to API limitations, increasing
--transfersbeyond approximately 45 concurrent uploads will not improve throughput.- The practical maximum achievable rate is around 42–45 objects per second.
- Because of this objects-per-second cap, it is always preferable to upload larger objects whenever possible. Larger objects are not negatively affected by this limit, while very small objects are.
Optional:
Reduce validation checks
These flags reduce the number of API calls and checksum operations Rclone performs. They improve performance but reduce verification.
--s3-disable-checksum Disables MD5 calculation before upload. Reduces CPU usage and startup delay for large files, but removes stored checksum metadata.
--s3-no-head Skips the HEAD request after each upload. Reduces one API call per object and improves objects-per-second performance for small file workloads.
--fast-list Reduces the number of listing API calls when scanning large directory trees before upload. Improves performance for sync and copy of many files, but increases RAM usage.
--ignore-checksum Skips checksum validation when copying, moving, or syncing. Improves performance but relies on size and timestamp instead of hash validation. See note below on using this when files are copied to S4 from Mega Cloud drive.
Special note on files copied from MEGA Cloud into S4
Rclone assumes files are uploaded using Rclone itself, so for objects smaller than the s3-upload-cutoff value, it verifies integrity using the ETag (MD5 hash).
However, files uploaded via MEGA software don’t store the MD5 in the ETag, causing these downloads to fail checksum validation. To avoid this, use the --ignore-checksum flag when copying, moving, or syncing files.