Two things to have in place before the first backup: an S3 bucket with an IAM policy, and AWS credentials on the Pi. The installer checks everything and walks you through it โ from a clean Pi to a scheduled nightly backup in under 10 minutes.
Three things to have in place before running install.sh. The installer verifies all three and will tell you what's missing.
You need an AWS account and an S3 bucket in your chosen region. Create the bucket in the S3 console or with the CLI:
aws s3 mb s3://your-bucket-name --region af-south-1
Configure AWS credentials on the Pi. Use the minimum required permissions. Create an IAM user or role with this policy:
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:DeleteObject",
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::your-bucket-name",
"arn:aws:s3:::your-bucket-name/*"
]
}]
}
Then configure credentials on the Pi:
aws configure # or set AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY in environment
Your backup contains secrets: .env files, SSH keys, database data, API tokens. Enable default encryption before the first backup. It costs nothing and takes 30 seconds.
aws s3api put-bucket-encryption \ --bucket your-bucket-name \ --server-side-encryption-configuration \ '{"Rules":[{"ApplyServerSideEncryptionByDefault":{"SSEAlgorithm":"AES256"}}]}'
Use SSE KMS instead of AES256 if you need CloudTrail audit trails or cross account key management. The backup does not encrypt client side. S3 managed encryption is the recommended baseline.
One install script handles dependencies, AWS verification, lifecycle policy, cron scheduling, and a dry run test.
SSH into your Pi and paste one command. It detects your hardware, installs dependencies, prompts for your S3 bucket and region (creates the bucket if it doesn't exist), configures cron, runs a dry-run test, then offers to run a real backup immediately.
curl -sL pi2s3.com/install | bash
Force an immediate backup to confirm everything works end to end. You'll get a push notification when done.
bash ~/pi2s3/pi-image-backup.sh --force
bash ~/pi2s3/pi-image-backup.sh --list 2026-04-16/ 3.4 GB raspberrypi (nvme0n1, mmcblk0) 2026-04-15/ 3.3 GB raspberrypi 2026-04-14/ 3.3 GB raspberrypi
If you use multiple AWS accounts, set a profile in config.env:
AWS_PROFILE="pi-backup" # in config.env
bash ~/pi2s3/install.sh --status # cron, log tail, dependency versions bash ~/pi2s3/install.sh --upgrade # git pull + redeploy