Documentation » Using WinSCP » Guides » Cloud Computing »

Connecting securely to Cloudflare R2 storage/bucket with S3

With WinSCP you can easily upload and manage files on your Cloudflare R2 storage/bucket using S3 protocol.

Before starting you should have WinSCP installed.

Connecting

Collect information about your R2 bucket and API keys in your Cloudflare dashboard on the R2 panel.

  • If you do not have an R2 API Token yet, select Manage R2 API Tokens and click Create API token. After creating the token, note the Access Key ID and Secret Access Key.
  • Back on the R2 panel, select your bucket and go to Settings page. Find S3 API URL. It contains your S3 API hostname. It has a format like your-account-id.r2.cloudflarestorage.com (in other words, drop the leading https:// and trailing /bucket from the URL).

Start WinSCP. Login dialog will appear. On the dialog:

  • Make sure New site node is selected.
  • On the New site node, select Amazon S3 protocol.
  • Enter your S3 API hostname to the Host name box.
  • Enter your Access key ID and Secret access key.
  • Click Advanced and go to Environment > Directories page. There, enter your bucket name preceded by a slash (/bucket) into the Remote directory box. Submit the Advanced Site Setting dialog.
  • Back on the Login dialog, save your site settings using the Save button.
  • Login using the Login button.

Further reading

Last modified: by martin