Before you start
- A Cloudflare account with R2 enabled
- A database on a server added to Kule with Dokploy installed
- You don’t need to have connected Cloudflare to Kule; R2 uses a separate key.
1Create the bucket
In the Cloudflare dashboard, open R2 Object Storage and create a new bucket, for example merttopuz-yedek. The name must be between 3 and 63 characters and may contain only lowercase letters, numbers and hyphens, and it can’t start or end with a hyphen. Buckets are private by default.
2Create an R2 API token
On the R2 overview page, in the Account Details section, click Manage next to API Tokens and create a new token. A token tied to the account (an Account API token) keeps working even if you are removed from the account.
- Choose Object Read & Write as the permission. You don’t need the Admin permissions that can create and delete buckets.
- Limit the token to the merttopuz-yedek bucket only.
Once the token is created, you see two values: the Access Key ID and the Secret Access Key.
3Storage address
R2’s S3-compatible address includes your account ID. You can find the account ID in the Cloudflare dashboard. Kule asks you to type the address and the bucket name together in the bucket field:
https://ACCOUNT_ID.r2.cloudflarestorage.com/merttopuz-yedek
Replace ACCOUNT_ID with your own account ID and the name at the end with your own bucket’s name. If you created the bucket in the European Union jurisdiction, the address ends with .eu.r2.cloudflarestorage.com. You don’t need to choose a region; on R2 the region is auto, and Kule fills it in itself.
4Turn on backups in Kule
In Veritabanları (Databases), click Yedeklemeyi aç (Turn on backups) on the card of the database you want to back up. In the destination picker, choose + S3 uyumlu depo (+ S3-compatible storage).
- Choose Cloudflare R2 as the provider.
- Type the address from the previous step in the Bucket field.
- Paste the Access Key ID into the Access key field and the Secret Access Key into the Secret field, then save.
- When you return to the backup window, this bucket is selected as the destination. Confirm.
After adding the storage, turn on the backup in the same window. The storage is registered in Dokploy together with the first backup that uses it.
5From then on
Kule adds the bucket to Dokploy as a backup destination and sets up a nightly schedule for the database. Every night at 03:00 (server time), Dokploy takes the backup and puts it in a folder in the bucket named after the database’s name in Dokploy; the 14 newest backups are kept. Your Mac doesn’t need to be on.
Restoring is manual for now: the backup file stays in the bucket, and Kule doesn’t restore automatically. If you also want to keep backups on this Mac, you can turn on backups to this Mac for the same database too.