# Use rclone

Configure an rclone remote for the S3 endpoint and copy or sync directories to a bucket.

Replace _EWS1EXAMPLEEXAMPLE00_ and _&lt;secret&gt;_ with your access key, _example-uploads_ with
your bucket's name and `https://s3.<domain>` with the endpoint. The bucket's **Overview** shows the
same configuration under **Connect** › **rclone**.

## Prerequisites

- An access key (see [Create an access key](create-an-access-key.md)) whose IAM user may read and
  write the bucket.

## Configure the remote

In `~/.config/rclone/rclone.conf`:

```ini
[dcloud]
type = s3
provider = Other
access_key_id = EWS1EXAMPLEEXAMPLE00
secret_access_key = <secret>
region = de1
endpoint = https://s3.<domain>
force_path_style = false
no_check_bucket = true
```

`no_check_bucket` stops rclone from trying to create the bucket before each copy. Buckets are not
created over S3: for a bucket of your organization the endpoint answers `BucketAlreadyOwnedByYou`,
which rclone takes as done, and for a name that does not exist yet `NotImplemented`. Create the
bucket first (see [Create a bucket](create-a-bucket.md)).

## Copy and sync

```sh
rclone copy ./photos dcloud:example-uploads
rclone sync ./site dcloud:example-uploads/site
rclone ls dcloud:example-uploads
```

## Result

rclone reads and writes the bucket as the key's IAM user. A key made for one bucket in the console
may also read the bucket's versioning status, which rclone asks for before a purge (see
[Limit a key to one bucket](limit-a-key-to-one-bucket.md)).

## Related

- [S3 compatibility](s3-compatibility.md)
