# R2 Store large amounts of unstructured data without egress fees > Links below point directly to Markdown versions of each page. Any page can also be retrieved as Markdown by sending an `Accept: text/markdown` header to the page's URL without the `index.md` suffix (for example, `curl -H "Accept: text/markdown" https://docs.ahq.lat/r2/`). > > For other Cloudflare products, see the [Cloudflare documentation directory](https://docs.ahq.lat/llms.txt). ## Overview - [Cloudflare R2](https://docs.ahq.lat/r2/index.md): Cloudflare R2 is a cost-effective, scalable object storage solution for cloud-native apps, web content, and data lakes without egress fees. ## Get started - [Get started](https://docs.ahq.lat/r2/get-started/index.md): Create your first R2 bucket and store objects using the dashboard, S3-compatible tools, or Workers. - [CLI](https://docs.ahq.lat/r2/get-started/cli/index.md): Use R2 from the command line with Wrangler, rclone, or AWS CLI. - [S3](https://docs.ahq.lat/r2/get-started/s3/index.md): Use R2 with S3-compatible SDKs like boto3 and the AWS SDK. - [Workers API](https://docs.ahq.lat/r2/get-started/workers-api/index.md): Use R2 from Cloudflare Workers with the Workers API. ## How R2 works - [How R2 works](https://docs.ahq.lat/r2/how-r2-works/index.md): Find out how R2 works. ## Data migration - [Data migration](https://docs.ahq.lat/r2/data-migration/index.md): Migrate data from other cloud providers to R2 using Super Slurper or Sippy. - [Migration Strategies](https://docs.ahq.lat/r2/data-migration/migration-strategies/index.md): Combine Super Slurper and Sippy to migrate objects to R2 with minimal downtime. - [Sippy](https://docs.ahq.lat/r2/data-migration/sippy/index.md): Incrementally migrate objects to R2 on-demand as they are requested, reducing egress fees. - [Super Slurper](https://docs.ahq.lat/r2/data-migration/super-slurper/index.md): Copy objects from other cloud providers to R2 in a one-off bulk migration job. ## Buckets - [Buckets](https://docs.ahq.lat/r2/buckets/index.md): Create and manage R2 buckets for storing objects with flat-structure organization. - [Bucket locks](https://docs.ahq.lat/r2/buckets/bucket-locks/index.md): Prevent deletion and overwriting of R2 objects by enabling bucket lock retention policies. - [Configure CORS](https://docs.ahq.lat/r2/buckets/cors/index.md): Set up Cross-Origin Resource Sharing (CORS) policies on R2 buckets for browser access. - [Create new buckets](https://docs.ahq.lat/r2/buckets/create-buckets/index.md): Create R2 buckets using the Cloudflare dashboard or Wrangler CLI. - [Delete buckets](https://docs.ahq.lat/r2/buckets/delete-buckets/index.md): Empty all objects from an R2 bucket and permanently delete it. - [Event notifications](https://docs.ahq.lat/r2/buckets/event-notifications/index.md): Send messages to Cloudflare Queues when objects in your R2 bucket change. - [Local uploads](https://docs.ahq.lat/r2/buckets/local-uploads/index.md): Improve R2 upload performance by writing object data to a nearby location before async copy. - [Object lifecycles](https://docs.ahq.lat/r2/buckets/object-lifecycles/index.md): Configure retention and storage class transition rules for objects in R2 buckets. - [Public buckets](https://docs.ahq.lat/r2/buckets/public-buckets/index.md): Expose R2 bucket contents to the Internet via a custom domain or r2.dev subdomain. - [Storage classes](https://docs.ahq.lat/r2/buckets/storage-classes/index.md): Choose between R2 Standard and Infrequent Access storage to optimize cost and access patterns. ## Objects - [Objects](https://docs.ahq.lat/r2/objects/index.md): Manage objects stored in Cloudflare R2 buckets. - [Delete objects](https://docs.ahq.lat/r2/objects/delete-objects/index.md): Delete individual objects or folders from an R2 bucket. - [Download objects](https://docs.ahq.lat/r2/objects/download-objects/index.md): Download objects from R2 using the dashboard, Workers API, S3 API, or CLI tools. - [Upload objects](https://docs.ahq.lat/r2/objects/upload-objects/index.md): Upload objects to R2 using single-part or multipart uploads via the dashboard, Workers API, or S3 API. ## API - [API](https://docs.ahq.lat/r2/api/index.md): Access R2 storage through the S3-compatible API, Workers API, or Cloudflare REST API. - [Error codes](https://docs.ahq.lat/r2/api/error-codes/index.md): Reference of R2 error codes returned by the Workers API and S3-compatible API. - [S3 API compatibility](https://docs.ahq.lat/r2/api/s3/api/index.md): Review which S3 API operations and features R2 supports, including implementation status. - [Extensions](https://docs.ahq.lat/r2/api/s3/extensions/index.md): R2 extensions to the S3 API, including Unicode metadata and custom headers. - [Presigned URLs](https://docs.ahq.lat/r2/api/s3/presigned-urls/index.md): Generate presigned URLs to grant temporary access to R2 objects without exposing credentials. - [Temporary credentials](https://docs.ahq.lat/r2/api/s3/temporary-credentials/index.md): Learn about temporary credentials in r2. - [Authentication](https://docs.ahq.lat/r2/api/tokens/index.md): Generate and manage R2 API tokens for use with S3-compatible SDKs and APIs. - [Workers API reference](https://docs.ahq.lat/r2/api/workers/workers-api-reference/index.md): Complete reference for the R2 in-Worker API, including bucket and object operations. - [Use R2 from Workers](https://docs.ahq.lat/r2/api/workers/workers-api-usage/index.md): Bind an R2 bucket to a Worker and perform read, write, and list operations. - [Use the R2 multipart API from Workers](https://docs.ahq.lat/r2/api/workers/workers-multipart-usage/index.md): Upload large objects to R2 using the multipart API through a Cloudflare Worker. ## R2 Data Catalog - [R2 Data Catalog](https://docs.ahq.lat/r2/data-catalog/index.md): A managed Apache Iceberg data catalog built directly into R2 buckets. - [DuckDB](https://docs.ahq.lat/r2/data-catalog/config-examples/duckdb/index.md): Connect DuckDB to R2 Data Catalog to query and manage Iceberg tables. - [PyIceberg](https://docs.ahq.lat/r2/data-catalog/config-examples/pyiceberg/index.md): Connect PyIceberg to R2 Data Catalog to create and query Iceberg tables in Python. - [Snowflake](https://docs.ahq.lat/r2/data-catalog/config-examples/snowflake/index.md): Query R2 Data Catalog tables from Snowflake using a catalog integration. - [Spark (PySpark)](https://docs.ahq.lat/r2/data-catalog/config-examples/spark-python/index.md): Connect PySpark to R2 Data Catalog to read and write Iceberg tables. - [Spark (Scala)](https://docs.ahq.lat/r2/data-catalog/config-examples/spark-scala/index.md): Build a Scala Spark application that connects to R2 Data Catalog for Iceberg table operations. - [StarRocks](https://docs.ahq.lat/r2/data-catalog/config-examples/starrocks/index.md): Connect StarRocks to R2 Data Catalog to query and modify Iceberg tables. - [Apache Trino](https://docs.ahq.lat/r2/data-catalog/config-examples/trino/index.md): Connect Apache Trino to R2 Data Catalog using the Iceberg REST catalog connector. - [Deleting data](https://docs.ahq.lat/r2/data-catalog/deleting-data/index.md): How to properly delete data from R2 Data Catalog - [Getting started](https://docs.ahq.lat/r2/data-catalog/get-started/index.md): Learn how to enable the R2 Data Catalog on your bucket, load sample data, and run your first query. - [Manage catalogs](https://docs.ahq.lat/r2/data-catalog/manage-catalogs/index.md): Understand how to manage Iceberg REST catalogs associated with R2 buckets - [Metrics and analytics](https://docs.ahq.lat/r2/data-catalog/observability/metrics/index.md): Query R2 Data Catalog metrics for Iceberg REST API operations and table maintenance jobs via the GraphQL Analytics API. - [Platform](https://docs.ahq.lat/r2/data-catalog/platform/index.md): R2 Data Catalog platform details including pricing. - [Pricing](https://docs.ahq.lat/r2/data-catalog/platform/pricing/index.md): R2 Data Catalog pricing for catalog operations, compaction, and free tier details. - [Table maintenance](https://docs.ahq.lat/r2/data-catalog/table-maintenance/index.md): Learn how R2 Data Catalog automates table maintenance ## R2 SQL - [R2 SQL](https://docs.ahq.lat/r2-sql/index.md): R2 SQL is a serverless SQL interface for Cloudflare R2, enabling querying and analyzing data. ## Tutorials - [Tutorials](https://docs.ahq.lat/r2/tutorials/index.md): Step-by-step R2 tutorials for building applications with object storage. - [Protect an R2 Bucket with Cloudflare Access](https://docs.ahq.lat/r2/tutorials/cloudflare-access/index.md): You can secure access to R2 buckets using Cloudflare Access, which allows you to only allow specific users, groups or applications within your organization to access objects within a bucket. - [Mastodon](https://docs.ahq.lat/r2/tutorials/mastodon/index.md): This guide explains how to configure R2 to be the object storage for a self hosted Mastodon instance. You can set up a self-hosted instance in multiple ways. - [Postman](https://docs.ahq.lat/r2/tutorials/postman/index.md): Learn how to configure Postman to interact with R2. - [Use event notification to summarize PDF files on upload](https://docs.ahq.lat/r2/tutorials/summarize-pdf/index.md): Use event notification to summarize PDF files on upload. Use Workers AI to summarize the PDF and store the summary as a text file. - [Log and store upload events in R2 with event notifications](https://docs.ahq.lat/r2/tutorials/upload-logs-event-notifications/index.md): This example provides a step-by-step guide on using event notifications to capture and store R2 upload logs in a separate bucket. ## Videos - [Videos](https://docs.ahq.lat/learning-paths/r2-intro/series/r2-1/index.md): Watch video tutorials covering R2 storage setup, configuration, and common use cases. ## Demos and architectures - [Demos and architectures](https://docs.ahq.lat/r2/demos/index.md): Explore Cloudflare R2 demos and reference architectures for fullstack applications, storage, and AI, with examples and use cases. ## Platform - [Platform](https://docs.ahq.lat/r2/platform/index.md): R2 platform details including limits, pricing, analytics, and troubleshooting. - [Audit Logs](https://docs.ahq.lat/r2/platform/audit-logs/index.md): Review audit logs for configuration changes made to your R2 buckets. - [Event subscriptions](https://docs.ahq.lat/r2/platform/event-subscriptions/index.md): Subscribe to R2 bucket events and Super Slurper events using Cloudflare Queues. - [Limits](https://docs.ahq.lat/r2/platform/limits/index.md): Account, bucket, and object limits for Cloudflare R2 storage. - [Metrics and analytics](https://docs.ahq.lat/r2/platform/metrics-analytics/index.md): View R2 storage and operations metrics via the dashboard or GraphQL Analytics API. - [Release notes](https://docs.ahq.lat/r2/platform/release-notes/index.md): Latest changes and updates to Cloudflare R2 object storage. - [Choose a storage product](https://docs.ahq.lat/workers/platform/storage-options/index.md): Compare Cloudflare storage products to find the right fit for your workload. - [Troubleshooting](https://docs.ahq.lat/r2/platform/troubleshooting/index.md): Troubleshoot common R2 issues including CORS errors, 403 responses, and cache behavior. ## Pricing - [Pricing](https://docs.ahq.lat/r2/pricing/index.md): R2 pricing for storage, Class A and Class B operations, and free tier details. ## examples - [Authenticate against R2 API using auth tokens](https://docs.ahq.lat/r2/examples/authenticate-r2-auth-tokens/index.md): Authenticate against the R2 S3-compatible API using API tokens with Python or JavaScript. - [Authenticate against R2 with temporary credentials](https://docs.ahq.lat/r2/examples/authenticate-r2-temp-credentials/index.md): Authenticate against R2 with temporary credentials. - [aws CLI](https://docs.ahq.lat/r2/examples/aws/aws-cli/index.md): Use the aws CLI to interact with Cloudflare R2 via the S3-compatible API. - [aws-sdk-go](https://docs.ahq.lat/r2/examples/aws/aws-sdk-go/index.md): Configure aws-sdk-go (v2) to work with Cloudflare R2 object storage. - [aws-sdk-java](https://docs.ahq.lat/r2/examples/aws/aws-sdk-java/index.md): Configure the AWS SDK for Java v2 to work with Cloudflare R2 object storage. - [aws-sdk-js](https://docs.ahq.lat/r2/examples/aws/aws-sdk-js/index.md): Configure the AWS SDK for JavaScript v2 to work with Cloudflare R2. - [aws-sdk-js-v3](https://docs.ahq.lat/r2/examples/aws/aws-sdk-js-v3/index.md): Configure the AWS SDK for JavaScript v3 to work with Cloudflare R2. - [aws-sdk-kotlin](https://docs.ahq.lat/r2/examples/aws/aws-sdk-kotlin/index.md): Configure the AWS SDK for Kotlin to work with Cloudflare R2 object storage. - [aws-sdk-net](https://docs.ahq.lat/r2/examples/aws/aws-sdk-net/index.md): Configure the AWS SDK for .NET to work with Cloudflare R2 object storage. - [aws-sdk-php](https://docs.ahq.lat/r2/examples/aws/aws-sdk-php/index.md): Example of how to configure `aws-sdk-php` to use R2. - [aws-sdk-ruby](https://docs.ahq.lat/r2/examples/aws/aws-sdk-ruby/index.md): Configure the AWS SDK for Ruby to work with Cloudflare R2 object storage. - [aws-sdk-rust](https://docs.ahq.lat/r2/examples/aws/aws-sdk-rust/index.md): Configure the AWS SDK for Rust to work with Cloudflare R2 object storage. - [aws4fetch](https://docs.ahq.lat/r2/examples/aws/aws4fetch/index.md): Configure aws4fetch to sign requests to Cloudflare R2 using the S3-compatible API. - [boto3](https://docs.ahq.lat/r2/examples/aws/boto3/index.md): Configure Python boto3 to work with Cloudflare R2 via the S3-compatible API. - [Configure custom headers](https://docs.ahq.lat/r2/examples/aws/custom-header/index.md): Set custom request headers for R2 S3 API extensions using boto3 or aws-sdk-js-v3. - [s3mini](https://docs.ahq.lat/r2/examples/aws/s3mini/index.md): Configure s3mini, a lightweight TypeScript S3 client, to work with Cloudflare R2. - [Use the Cache API](https://docs.ahq.lat/r2/examples/cache-api/index.md): Store R2 objects in Cloudflare's cache using the Workers Cache API for faster retrieval. - [Multi-cloud setup](https://docs.ahq.lat/reference-architecture/diagrams/storage/egress-free-storage-multi-cloud/index.md): Reference architecture for using R2 in a multi-cloud egress-free storage setup. - [Rclone](https://docs.ahq.lat/r2/examples/rclone/index.md): Configure rclone to manage and upload objects to R2 using the S3-compatible API. - [Use SSE-C](https://docs.ahq.lat/r2/examples/ssec/index.md): The following tutorial shows some snippets for how to use Server-Side Encryption with Customer-Provided Keys (SSE-C) on Cloudflare R2. - [Terraform](https://docs.ahq.lat/r2/examples/terraform/index.md): Configure R2 buckets with Terraform using the Cloudflare provider. - [Terraform (AWS)](https://docs.ahq.lat/r2/examples/terraform-aws/index.md): Configure R2 buckets and objects with Terraform using the AWS provider. ## reference - [Consistency model](https://docs.ahq.lat/r2/reference/consistency/index.md): R2 provides strong global consistency for reads, writes, deletes, and list operations. - [Data location](https://docs.ahq.lat/r2/reference/data-location/index.md): Control where R2 stores your data using automatic placement, location hints, or jurisdictions. - [Data security](https://docs.ahq.lat/r2/reference/data-security/index.md): R2 encrypts all objects at rest with AES-256 and in transit with TLS. - [Durability](https://docs.ahq.lat/r2/reference/durability/index.md): R2 is designed for 99.999999999% annual durability using replication and erasure coding. - [Partners](https://docs.ahq.lat/r2/reference/partners/index.md): R2 partner integration guides for connecting with third-party platforms. - [Snowflake](https://docs.ahq.lat/r2/reference/partners/snowflake-regions/index.md): Recommended R2 data locations and jurisdictions for each Snowflake region. - [Unicode interoperability](https://docs.ahq.lat/r2/reference/unicode-interoperability/index.md): R2 NFC-normalizes object key names by default to ensure cross-platform Unicode consistency. - [Wrangler commands](https://docs.ahq.lat/r2/reference/wrangler-commands/index.md): Wrangler CLI commands for managing R2 buckets and objects.