DeployHQ supports deploying to any S3-compatible object storage provider. This includes popular services like Cloudflare R2, Wasabi, Backblaze B2, MinIO, DigitalOcean Spaces, and Katapult Object Storage.

## Adding an S3-Compatible Server

First, select **S3-Compatible Storage** in the server protocol selector. The server form is organized into sections:

### Storage Details

Enter the full endpoint URL for your S3-compatible storage provider (see provider examples below) and the bucket name.

![S3-Compatible Storage Details](https://i.ibb.co/kVy2LrSd/s3-compatible-storage-details.png)

### Authentication

Enter your Access Key ID and Secret Access Key.

![S3-Compatible Authentication](https://i.ibb.co/yBhLbBzY/s3-authentication.png)

### Path Prefix

If you want to upload your files to a different folder from your bucket's root directory, enter the directory in the **Path Prefix**.

![S3-Compatible Path Prefix](https://i.ibb.co/bjWRTGyp/rackspace-path-prefix.png)

## Provider Configuration Examples

### Cloudflare R2

Cloudflare R2 provides S3-compatible object storage with no egress fees.

**Endpoint URL format:**
```
https://<ACCOUNT_ID>.r2.cloudflarestorage.com
```

To find your Account ID and create API tokens:
1. Log in to your Cloudflare dashboard
2. Navigate to R2 in the sidebar
3. Your Account ID is displayed on the overview page
4. Click "Manage R2 API Tokens" to create access credentials

For detailed instructions on creating R2 API tokens, see the <a href="https://developers.cloudflare.com/r2/api/s3/tokens" target="_blank">Cloudflare R2 documentation</a>.

**Example configuration:**
- Endpoint URL: `https://a1b2c3d4e5f6g7h8i9j0.r2.cloudflarestorage.com`
- Bucket Name: `my-website-assets`
- Access Key ID: Your R2 access key
- Secret Access Key: Your R2 secret key

### Wasabi

Wasabi offers hot cloud storage that is S3-compatible with predictable pricing.

**Endpoint URL format:**
```
https://s3.<REGION>.wasabisys.com
```

**Available regions:**
- `us-east-1` - US East (N. Virginia)
- `us-east-2` - US East (N. Virginia)
- `us-central-1` - US Central (Texas)
- `us-west-1` - US West (Oregon)
- `eu-central-1` - EU (Amsterdam)
- `eu-central-2` - EU (Frankfurt)
- `eu-west-1` - EU (London)
- `eu-west-2` - EU (Paris)
- `ap-northeast-1` - AP (Tokyo)
- `ap-northeast-2` - AP (Osaka)
- `ap-southeast-1` - AP (Singapore)
- `ap-southeast-2` - AP (Sydney)

**Example configuration:**
- Endpoint URL: `https://s3.eu-central-1.wasabisys.com`
- Bucket Name: `my-deployment-bucket`
- Access Key ID: Your Wasabi access key
- Secret Access Key: Your Wasabi secret key

### Backblaze B2

Backblaze B2 provides affordable S3-compatible cloud storage.

**Endpoint URL format:**
```
https://s3.<REGION>.backblazeb2.com
```

**Available regions:**
- `us-west-004` - US West
- `eu-central-003` - EU Central

To get your credentials:
1. Log in to your Backblaze account
2. Go to "App Keys" under Account
3. Create a new application key with appropriate bucket access

**Example configuration:**
- Endpoint URL: `https://s3.us-west-004.backblazeb2.com`
- Bucket Name: `my-b2-bucket`
- Access Key ID: Your B2 keyID
- Secret Access Key: Your B2 applicationKey

### MinIO

MinIO is a self-hosted S3-compatible object storage solution.

**Endpoint URL format:**
```
https://<YOUR_MINIO_SERVER>:<PORT>
```

or for local/internal deployments:
```
http://<YOUR_MINIO_SERVER>:<PORT>
```

**Example configuration:**
- Endpoint URL: `https://minio.example.com:9000`
- Bucket Name: `deployments`
- Access Key ID: Your MinIO access key
- Secret Access Key: Your MinIO secret key

### DigitalOcean Spaces

DigitalOcean Spaces provides S3-compatible object storage.

**Endpoint URL format:**
```
https://<REGION>.digitaloceanspaces.com
```

**Available regions:**
- `nyc3` - New York
- `sfo3` - San Francisco
- `ams3` - Amsterdam
- `sgp1` - Singapore
- `fra1` - Frankfurt
- `syd1` - Sydney

**Example configuration:**
- Endpoint URL: `https://nyc3.digitaloceanspaces.com`
- Bucket Name: `my-space-name`
- Access Key ID: Your Spaces access key
- Secret Access Key: Your Spaces secret key

### Katapult Object Storage

Katapult provides S3-compatible object storage as part of their cloud platform.

**Endpoint URL format:**
```
https://<REGION>.object-storage.katapult.io
```

Contact Katapult support or check their documentation for available regions and credential setup.

## Request Headers

![S3-Compatible Request Headers](https://i.ibb.co/C5zqVHR1/s3-compatible-request-headers.png)

Within the Request Headers section, you can configure specific metadata to send along with files matching a given pattern.

You may, for example, wish to send a `Cache-Control` header for all files, or a `Content-Disposition` header for all files of a certain type or even in a certain directory, to force them to be downloaded rather than rendered inline in the end-user's browser.

### Common Header Examples

**Cache control for all files:**
- Header Key: `Cache-Control`
- Header Value: `max-age=31536000`
- Pattern: `*`

**Force download for PDF files:**
- Header Key: `Content-Disposition`
- Header Value: `attachment`
- Pattern: `*.pdf`

**Set content type for JSON files:**
- Header Key: `Content-Type`
- Header Value: `application/json`
- Pattern: `*.json`

Add as many header rules as you need within this section, starting with the Header Key and Header Value, followed by a glob pattern to match files.

## Troubleshooting

### Invalid Endpoint URL

Ensure your endpoint URL:
- Starts with `https://` (or `http://` for local MinIO)
- Does not include the bucket name in the URL
- Does not have a trailing slash

### Access Denied Errors

Verify that your access credentials have the following permissions:
- `s3:GetObject`
- `s3:PutObject`
- `s3:DeleteObject`
- `s3:ListBucket`

### Connection Timeout

If you're using a self-hosted solution like MinIO, ensure:
- The endpoint is accessible from the internet
- Any firewalls allow connections from DeployHQ's IP addresses
- The correct port is specified in the endpoint URL
