---
title: "Rclone for S3 Integration | Hostman Docs"
description: "Discover Rclone commands for efficient S3 file transfers and management."
---

> For the complete documentation index for AI agents, see [llms.txt](https://hostman.com/llms.txt).

Rclone is a command-line utility for synchronizing files and directories between a local machine and cloud storage.

## Installing Rclone

You can download Rclone from the [official website](https://rclone.org/downloads/) and follow the [installation guides](https://rclone.org/install/), also available on the official site. 

For Windows, simply download and run `rclone.exe` via the command line.

## Configuring Rclone

To set up Rclone to work with our [S3 object storage](https://hostman.com/s3-storage/):

1.  Create the `rclone.conf` file in the `.config/rclone` directory in the root of your home directory
2.  Add the following content:

```shell
[hostman]
type = s3
provider = Other
env_auth = false
access_key_id = <Access_Key>
secret_access_key = <Secret_Access_Key>
endpoint = https://s3.hmstorage.net
```

Alternatively, you can use the configuration wizard, which will create a similar file. To launch the configuration wizard, run the command:

```shell
rclone config
```

Below is an example of setting up using the configuration wizard.

-   **No remotes found - make a new one**

Enter `n` and then the name `hostman`.

```shell
No remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n
name> hostman
```

-   **Option Storage**

Select `Amazon S3 Compliant Storage Providers`.

```shell
Storage> 4
```

-   **Option provider**

Select `Any other S3 compatible provider`.

```shell
provider> 32
```

-   **Option env\_auth**

Enter `false`.

```shell
env_auth> false
```

-   **Option access\_key\_id**

Enter the `Access Key` from your bucket settings. For example:

```shell
access_key_id> 6RNN1MM9UZOUU5XWVQUE
```

-   **Option secret\_access\_key**

Enter the `Secret Access Key` from your bucket settings. For example:

```shell
secret_access_key> jX8DgkESG2uqTtQYAuT25FZhctrbz2mhyBrwUgKK
```

-   **Option region**

Enter `us-2`.

```shell
region> us-2
```

-   **Option endpoint**

Enter `https://s3.hmstorage.net`

```shell
endpoint> https://s3.hmstorage.net
```

-   **Option location\_constraint**

Leave blank and press Enter.

```shell
location_constraint>
```

-   **Option acl**

Leave blank and press Enter.

```shell
acl>
```

-   **Edit advanced config?**

Enter `n`.

```
y/n> n
```

-   **Configuration complete**

Check the details and press `y`.

```shell
Options:
- type: s3
- provider: Other
- access_key_id: 6RNN1MM9UZOUU5XWVQUE
- secret_access_key: jX8DgkESG2uqTtQYAuT25FZhctrbz2mhyBrwUgKK
- region: us-2
- endpoint: https://s3.hmstorage.net

Keep this "hostman" remote?
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d> y
```

-   **Current remotes**

Enter `q` to exit.

```shell
Current remotes
Name                 Type
====                 ====
hostman2             s3

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> q
```

## Usage Examples

For a complete list of supported commands, refer to the [Rclone documentation](https://rclone.org/commands/). 

The storage name specified in the `rclone.conf` configuration file should be used as the host name. In our example earlier, we configured a storage named hostman.

### Viewing the List of Buckets

```shell
rclone lsd <host_name>:
```

For example:

```shell
rclone lsd hostman:
```

```shell
       -1 2021-12-10 11:34:51     -1 1d65c254-17ab-4b22-b262-1111fc006937
       -1 2022-01-13 10:05:47     -1 3b24945b-d373-4713-89ec-3dece346c7b3
       -1 2022-01-14 12:31:36     -1 bbf30ad7-8872-40fc-8d41-54537d894b7f
```

### Getting a List of Files in a Bucket

```shell
rclone ls <host_name>:<bucket_name>
```

For example:

```shell
rclone ls hostman:3b24945b-d373-4713-89ec-3dece346c7b3
```

```shell
    13 test.txt
    13 test1.txt
```

### Uploading a File to a Bucket

```shell
rclone -P copy <file_name> <host_name>:<bucket_name>
```

For example:

```shell
rclone -P copy test5.txt hostman:3b24945b-d373-4713-89ec-3dece346c7b3
```

### Deleting a File in a Bucket

```shell
rclone delete <host_name>:<bucket_name>/<file_name>
```

For example:

```shell
rclone delete hostman:3b24945b-d373-4713-89ec-3dece346c7b3/test5.txt
```

### Copying Files between Buckets

```shell
rclone copyto -vP --log-file=rclone_<source_bucket_name>.log --transfers=256 <source_host_name>:<source_bucket_name> <destination_host_name>:<destination_bucket_name>
```

### Synchronizing Files Between a Bucket and a Local Directory

```shell
rclone -P sync <host_name>:<bucket_name> /path/to/directory
```

For example:

```shell
rclone -P sync hostman:3b24945b-d373-4713-89ec-3dece346c7b3 /root/test
```

For reverse synchronization, simply reverse the arguments.
