Theme
Cloudflare R2
Cloudflare R2 is an S3 compatible object storage with no egress fees, which suits a file transfer service well: what your users download costs you nothing extra.
Step 1: in the Cloudflare dashboard
- Create a bucket. Open R2 Object Storage, choose Create bucket, pick a name and, if you care where the data lives, a location hint or a jurisdiction.
- Create an API token. Still in R2, choose Manage R2 API Tokens, then Create API token. Give it the Object Read & Write permission, scope it to the one bucket, and set a TTL if your policy requires one.
- Copy three values, shown once on the next screen: the Access Key ID, the Secret Access Key, and the endpoint for S3 clients, which looks like
https://<account id>.r2.cloudflarestorage.com. A bucket created with a jurisdiction has its own endpoint, shown on the bucket's settings page.
That is it for the Cloudflare side. Now to the SFTP.cloud side.
Step 2: in your SFTP.cloud Storage Connector
Best performance
R2 lives on Cloudflare's network, not in a region you can deploy next to. Place the Storage Connector where its uplink is best: on the cloud or in the data center that hosts the rest of your systems.
The first thing to do is to add a new Virtual File System. For R2 in particular there are a few small but important details:
- Type:
S3(as for any other S3 compatible object store) - Region:
auto - Endpoint: the account endpoint from step 1, without the bucket name
- Use path style addressing: off. R2 serves every bucket as its own host name.
WARNING
Do not forget to press the Save button next to the Access secret after typing it in, or it will not be saved and nothing will work.
When you save, the Connector tests the storage right away. If it cannot reach it, the form stays open and says why.
Then, still in the Storage Connector UI, go to the Users page and give your users the desired access to the new VFS.
Finally
Test it. Connect through your SFTP.cloud WebClient, create a folder, upload some files, then check in the Cloudflare dashboard that they landed in the bucket.
In the manual