# Store WHMCS attachments in S3
Source: https://docs.webgee.com/en/reseller/managing-whmcs-attachments-with-s3-type-storage



Move WHMCS attachments to S3-compatible object storage. Applies to reseller
accounts running WHMCS.

## Why bother [#why-bother]

Ticket attachments accumulate indefinitely, and they are usually many small
files. Two problems follow:

**Inodes.** Your plan limits the **number** of files as well as their size. A
busy helpdesk can exhaust the inode allowance while using very little disk space,
and the symptoms — uploads failing, mail not delivering — look nothing like a
file-count problem. See
[Check your disk usage](/en/hosting/monitoring-disk-usage-with-cpanel).

**Backups.** Every attachment is copied on every backup run, making them slower
and larger for data that never changes.

Object storage removes both, and is cheaper per gigabyte than hosting.

## Choose a provider [#choose-a-provider]

WHMCS works with any S3-compatible service:

| Provider          | Notes                        |
| ----------------- | ---------------------------- |
| **Amazon S3**     | The reference implementation |
| **Wasabi**        | Flat pricing, no egress fees |
| **iDrive E2**     | Low cost, S3-compatible      |
| **Cloudflare R2** | No egress fees               |

For attachments — written once, read rarely — egress pricing matters more than
storage price. A provider without egress fees is usually cheaper in practice.

## Configure it [#configure-it]

1. In your provider's console, create a **bucket** and generate an **access key
   pair**.
2. In WHMCS, go to **Configuration → System Settings → Storage Settings**.
3. Add a new storage configuration, choose the S3 type, and enter the endpoint,
   region, bucket and credentials.
4. **Validate** the configuration before continuing.
5. Against **Attachments**, select your new storage and **migrate** the existing
   files.

WHMCS moves them and updates its references.

<Callout type="warn">
  Migration moves the files. Take a backup of the attachments directory first, so
  a failed migration does not leave you without them — see
  [Download a backup of your account](/en/backups/how-to-generate-download-a-website-backup).
</Callout>

## Keep the bucket private [#keep-the-bucket-private]

<Callout type="error">
  The bucket must **not** be publicly readable. Ticket attachments routinely
  contain customer data, server details and occasionally credentials. WHMCS
  signs its own requests, so public access is never required — and a public
  bucket is discoverable.
</Callout>

Use a key scoped to that bucket alone, not a root account key.

## Check it worked [#check-it-worked]

Open a ticket with an attachment, then confirm it appears in the bucket and
still downloads correctly through WHMCS. Then check an older attachment, to
confirm the migration carried them across.

## Related [#related]

* [Check your disk usage](/en/hosting/monitoring-disk-usage-with-cpanel)
* [Install WHMCS with Softaculous](/en/reseller/softaculous-how-do-i-install-whmcs)
