Docs Ordnary R2
Quickstart
Create a bucket and upload your first file with any S3-compatible tool.
Ordnary R2 speaks the S3 API, so the tools and SDKs you already use work with it. All you change is the endpoint.
Create a bucket
- 1
Activate Ordnary R2
Open Ordnary R2 in the console and activate it for your account.
- 2
Create a bucket
Choose a name and a region. Bucket names are lowercase and unique within your account.
- 3
Create an access key
Create a key for this bucket, see Access keys.
Connect with the AWS CLI
Copy the S3 endpoint from your bucket's settings in the console and pass it with --endpoint-url:
aws s3 cp ./report.pdf s3://my-bucket/reports/report.pdf \
--endpoint-url "<your-s3-endpoint>"
aws s3 ls s3://my-bucket/reports/ --endpoint-url "<your-s3-endpoint>"Connect from JavaScript
import { S3Client, PutObjectCommand } from "@aws-sdk/client-s3";
const r2 = new S3Client({
region: "auto",
endpoint: process.env.R2_ENDPOINT,
credentials: {
accessKeyId: process.env.AWS_ACCESS_KEY_ID!,
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!,
},
});
await r2.send(
new PutObjectCommand({ Bucket: "my-bucket", Key: "hello.txt", Body: "Hello from Ordnary R2" }),
);