Overview
Thecloudstic init command bootstraps a new Cloudstic repository by creating encryption key slots and writing the repository configuration marker. This command must be run before your first backup.
Basic Usage
Encryption Modes
Password-Based Encryption (Recommended)
-encryption-key, -kms-key-arn, etc.), no password is prompted unless you explicitly pass -prompt.
Platform Key + Password (Multi-Factor)
For maximum security, combine a platform key with an interactive password. Both are required to decrypt:Platform Key Only
With Recovery Key
Generate a 24-word BIP39 recovery phrase during initialization:Unencrypted Repository (Not Recommended)
Command Flags
boolean
default:"false"
Generate a 24-word BIP39 recovery key during initialization. The recovery phrase is displayed once and allows you to recover your repository if you lose your password or platform key.
boolean
default:"false"
Create an unencrypted repository. Not recommended unless you have a specific reason (e.g., data is pre-encrypted, testing, or compliance requirements).
boolean
default:"false"
Force an interactive password prompt even when other credentials (e.g.
-encryption-key, -kms-key-arn) are already provided. Use this to add a password layer on top of a platform or KMS key.boolean
default:"false"
Disable all interactive prompts. If no encryption credentials are provided and
--no-prompt is set, init fails with an error instead of prompting for a password. Useful for scripts and CI/CD pipelines.Global Flags (All Commands)
string
default:"local:./backup_store"
Storage backend URI. Formats:
local:<path>, s3:<bucket>[/<prefix>], b2:<bucket>[/<prefix>], sftp://[user@]host[:port]/<path>.string
default:""
Platform key as 64 hexadecimal characters (32 bytes). Used for platform-managed encryption in automated environments.
string
default:""
Repository password for password-based encryption. If not provided and no other credentials are set, and running interactively, you will be prompted.
string
default:""
AWS KMS key ARN for envelope encryption. Requires AWS credentials with KMS decrypt permissions.
string
default:""
AWS region for KMS operations. Defaults to AWS SDK’s standard discovery logic if not provided.
string
default:""
Custom endpoint URL for KMS operations (e.g., for local testing with LocalStack).
boolean
default:"false"
Log detailed operations.
boolean
default:"false"
Suppress progress output (keeps final summary).
boolean
default:"false"
Write the command result as JSON to stdout instead of the human-readable initialization summary.
boolean
default:"false"
Log every store request with network call details, timing, and sizes.
S3-Specific Flags
string
default:""
S3-compatible endpoint URL (for MinIO, Cloudflare R2, DigitalOcean Spaces, etc.).
string
default:"us-east-1"
S3 region.
string
default:""
S3 access key ID.
string
default:""
S3 secret access key.
SFTP Store Credentials
string
default:""
SFTP store password.
string
default:""
Path to SSH private key for SFTP store authentication.
string
default:""
Path to custom
known_hosts file for host key validation.boolean
default:"false"
Skip host key validation (INSECURE).
Backblaze B2 Flags
string
default:""
Backblaze B2 application key ID.
string
default:""
Backblaze B2 application key.
Examples
Local Repository with Password
S3 Repository with Recovery Key
MinIO/S3-Compatible Storage
SFTP Repository
Backblaze B2
Behavior
Encryption Key Slots
When you initialize an encrypted repository, Cloudstic:- Generates a random 32-byte master key
- Wraps the master key with your password or platform key using strong KDF (Argon2id for passwords)
- Stores the encrypted key slot(s) under
keys/in the repository - Derives an HMAC dedup key from the master key for content-addressing without exposing plaintext hashes
Adopting Existing Key Slots
If key slots already exist in the store (e.g., from a previous partial init or if you are adding new credentials),cloudstic init --adopt-slots will verify you can unlock them with the provided credentials and automatically create new slots for any additional credentials provided in the command line.
Repository Already Initialized
Runninginit on an already initialized repository exits immediately:
Troubleshooting
Error: encryption is required by default
-prompt to explicitly request one.
Error: encryption password cannot be empty
-password flag.
Error: passwords do not match
Invalid —encryption-key
-encryption-key must be exactly 64 hexadecimal characters (0-9, a-f). Generate with:
Related Commands
- cloudstic backup: Create your first backup after initializing
- cloudstic key add-recovery: Add a recovery key to an existing repository
- cloudstic key passwd: Change the repository password
- cloudstic check: Verify repository integrity