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
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.
Create an unencrypted repository. Not recommended unless you have a specific reason (e.g., data is pre-encrypted, testing, or compliance requirements).
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.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)
Storage backend URI. Formats:
local:<path>, s3:<bucket>[/<prefix>], b2:<bucket>[/<prefix>], sftp://[user@]host[:port]/<path>.Platform key as 64 hexadecimal characters (32 bytes). Used for platform-managed encryption in automated environments.
Repository password for password-based encryption. If not provided and no other credentials are set, and running interactively, you will be prompted.
AWS KMS key ARN for envelope encryption. Requires AWS credentials with KMS decrypt permissions.
AWS region for KMS operations. Defaults to AWS SDK’s standard discovery logic if not provided.
Custom endpoint URL for KMS operations (e.g., for local testing with LocalStack).
Log detailed operations.
Suppress progress output (keeps final summary).
Write the command result as JSON to stdout instead of the human-readable initialization summary.
Log every store request with network call details, timing, and sizes.
S3-Specific Flags
S3-compatible endpoint URL (for MinIO, Cloudflare R2, DigitalOcean Spaces, etc.).
S3 region.
S3 access key ID.
S3 secret access key.
SFTP Store Credentials
SFTP store password.
Path to SSH private key for SFTP store authentication.
Path to custom
known_hosts file for host key validation.Skip host key validation (INSECURE).
Backblaze B2 Flags
B2 requires
B2_KEY_ID and B2_APP_KEY environment variables.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