Setting up AWS S3 for Canasta backups
Appearance
This guide walks through setting up an AWS S3 bucket and IAM user for Canasta backups using Restic.
Create an S3 bucket
- Go to S3 Console → Create bucket
- Enter a bucket name (e.g.,
canasta-backups-yoursite) - Select your preferred AWS Region
- Leave "Block all public access" enabled (default)
- Leave all other settings as default
- Click Create bucket
Enable versioning (recommended)
Versioning provides an extra safety net against accidental deletion:
- Click into your new bucket
- Go to the Properties tab
- Under Bucket Versioning, click Edit
- Select Enable and save
Create an IAM user with scoped permissions
Rather than using AmazonS3FullAccess, create a user with access limited to only the backup bucket.
Create the user
- Go to IAM Console → Users → Create user
- Enter a username (e.g.,
canasta-backup) - Do not enable console access — this user only needs API access
- Click Next, then Create user (skip attaching policies for now)
Attach a scoped inline policy
- Click into the new user
- Go to the Permissions tab
- Click Add permissions → Create inline policy
- Switch to the JSON tab
- Paste the following policy, replacing
YOUR-BUCKET-NAMEwith your actual bucket name:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:PutObject",
"s3:DeleteObject",
"s3:ListBucket",
"s3:GetBucketLocation"
],
"Resource": [
"arn:aws:s3:::YOUR-BUCKET-NAME",
"arn:aws:s3:::YOUR-BUCKET-NAME/*"
]
}
]
}
| Permission | Purpose |
|---|---|
s3:GetObject |
Read backup snapshots during restore |
s3:PutObject |
Write new backup snapshots |
s3:DeleteObject |
Prune old backups (canasta backup purge)
|
s3:ListBucket |
List snapshots (canasta backup list)
|
s3:GetBucketLocation |
Required by Restic to locate the bucket |
- Name the policy (e.g.,
canasta-backup-s3) - Click Create policy
Create an access key
- Go to the Security credentials tab on the user page
- Click Create access key
- Choose Application running outside AWS
- Click Create access key
- Save both values — the Secret Access Key is only shown once:
- Access Key ID (e.g.,
AKIA...) - Secret Access Key
- Access Key ID (e.g.,
Configure Canasta
Add the following to your Canasta installation's .env file:
# Restic backup configuration
RESTIC_REPOSITORY=s3:s3.REGION.amazonaws.com/YOUR-BUCKET-NAME
RESTIC_PASSWORD=your-restic-encryption-password
# AWS credentials
AWS_ACCESS_KEY_ID=your-access-key-id
AWS_SECRET_ACCESS_KEY=your-secret-access-key
Replace:
REGIONwith your bucket's AWS region (e.g.,us-east-1)YOUR-BUCKET-NAMEwith your bucket nameRESTIC_PASSWORDwith a strong password of your choice — this encrypts the backup data (save this password securely; without it, backups cannot be restored)
Initialize the backup repository
canasta backup init -i your-instance-id
Create a backup
canasta backup create -i your-instance-id -t my-first-backup
Verify
canasta backup list -i your-instance-id
Gitops considerations
If you are using canasta gitops, the backup credentials (RESTIC_*, AWS_*) are automatically detected as secrets and stored as encrypted placeholders in env.template. You do not need to add them to gitops/custom-secret-keys.
See GitOps guide for details.