R2 SFTP Server

In this guide, we’ll walk you through the process of configuring a Cloudflare R2 bucket to work with Baskt’s SFTP as a Service using S3-compatible APIs and access keys. By the end, you’ll have a fully functional SFTP server backed by your own R2 storage.

Prerequisites

Before you begin, make sure you have:

  • A Cloudflare account with an R2 bucket
  • A Baskt account

Step 1: Create an R2 API Token

  1. Log in to the Cloudflare Dashboard and navigate to the “R2” page
  2. In the “R2” right sidebar, click on “Manage R2 API Tokens”
  3. Click the “Create API Token” button
  4. Give your token a name (e.g., “Baskt R2 Token”)
  5. Under “Permissions,” select “Object Read & Write”
  6. Under “Specify bucket(s),” choose the R2 bucket you want to use with Baskt
  7. Click the “Create API Token” button
  8. On the API token details page, copy the “Access Key ID” and “Secret Access Key” and also the “Endpoint” URL

You now have the necessary credentials and endpoint to set up your R2 bucket with Baskt.

Step 2: Add Your R2 Bucket to Baskt

  1. Log in to your Baskt account and navigate to the “Buckets” page
  2. Click “Create a new one”
  3. Enter your R2 bucket name
  4. Fill in your R2 bucket information:
    • Region: The region where your R2 bucket is located (e.g., “auto”)
    • Endpoint: Paste the “Endpoint” URL you copied in Step 1
    • Access Key ID: Paste the “Access Key ID” you copied in Step 1
    • Secret Access Key: Paste the “Secret Access Key” you copied in Step 1
  5. Click “Create bucket”

Baskt will now verify your credentials and connect to your R2 bucket using the S3-compatible API. Once the verification is successful, your R2 SFTP server is ready for use!

Next Steps

Now that your R2 bucket is set up with S3-compatible access, you can:

  • Create Baskt users and assign them access to your bucket
  • Connect to your bucket via SFTP and start transferring files
  • Monitor user activity and bandwidth usage through the Baskt dashboard