Skip to main content

Choose Your Platform

Cloudstic CLI provides native installation methods for all major platforms. Choose the method that works best for your system:
The easiest way to install Cloudstic on macOS is via Homebrew:
# Install Cloudstic
brew install cloudstic/tap/cloudstic
# Upgrade to the latest version
brew upgrade cloudstic

# Uninstall
brew uninstall cloudstic

Pre-built Binary

Download the latest release for your architecture:
curl -L https://github.com/cloudstic/cli/releases/latest/download/cloudstic_darwin_arm64.tar.gz | tar xz
sudo mv cloudstic /usr/local/bin/
chmod +x /usr/local/bin/cloudstic

Verify Installation

Confirm that Cloudstic is installed correctly:
cloudstic version
You should see output similar to:
cloudstic 1.2.0 (commit a1b2c3d, built 2025-03-01T10:30:00Z)
Installation successful! You’re ready to initialize your first repository.

Build from Source

For developers or users who want to build from the latest source code:
1

Install Go 1.21 or later

Download and install Go from golang.org
2

Clone the repository

git clone https://github.com/cloudstic/cli.git
cd cli
3

Build the binary

go build -o cloudstic ./cmd/cloudstic
This creates a cloudstic binary in the current directory.
4

Install the binary (optional)

sudo mv cloudstic /usr/local/bin/
Or add the current directory to your PATH.
# Run all tests
go test -v -race -count=1 ./...

# Run the full check script (fmt + lint + test + coverage)
./scripts/check.sh
E2E tests require Docker for Testcontainers (MinIO, SFTP). They skip gracefully if Docker is unavailable.

Shell Completions

Cloudstic supports tab-completion for commands, flags, and values in bash, zsh, and fish.

Load completion for current session

source <(cloudstic completion bash)

Load completion permanently

echo 'source <(cloudstic completion bash)' >> ~/.bashrc
Bash completions require the bash-completion package:
  • macOS: brew install bash-completion
  • Debian/Ubuntu: apt install bash-completion

Configuration Directory

Cloudstic stores OAuth tokens and state files in a platform-specific directory:
PlatformDefault Path
Linux~/.config/cloudstic/
macOS~/Library/Application Support/cloudstic/
Windows%AppData%\cloudstic\
Override the config directory by setting the CLOUDSTIC_CONFIG_DIR environment variable:
export CLOUDSTIC_CONFIG_DIR=/custom/path/to/config
This directory contains:
  • google_token.json — Google Drive OAuth token (if using Google Drive sources)
  • onedrive_token.json — OneDrive OAuth token (if using OneDrive sources)
  • State files — For incremental backups (change tokens, delta links)

Environment Variables

Simplify your workflow by setting default values via environment variables. This is especially useful for automation:
~/.bashrc or ~/.zshrc
# Storage backend configuration
export CLOUDSTIC_STORE=s3
export CLOUDSTIC_STORE_PATH=my-backup-bucket
export CLOUDSTIC_STORE_PREFIX="laptop/"

# S3 credentials (or use AWS CLI profiles)
export AWS_ACCESS_KEY_ID=your-access-key
export AWS_SECRET_ACCESS_KEY=your-secret-key
export CLOUDSTIC_S3_REGION=us-east-1

# Encryption
export CLOUDSTIC_ENCRYPTION_PASSWORD="my secure passphrase"

# Source defaults
export CLOUDSTIC_SOURCE=gdrive-changes
With these set, commands become much shorter:
# Instead of:
cloudstic backup -store s3 -store-path my-bucket -source gdrive-changes -encryption-password "..."

# Just run:
cloudstic backup
See the User Guide for the complete list of supported environment variables.

Next Steps

Troubleshooting

Problem: Shell can’t find the cloudstic binary.Solution: Make sure the installation directory is in your PATH:
# Check your PATH
echo $PATH

# Add /usr/local/bin to PATH (if missing)
export PATH="/usr/local/bin:$PATH"

# For Go installs, ensure GOPATH/bin is in PATH
export PATH="$HOME/go/bin:$PATH"
Add the export statement to your ~/.bashrc, ~/.zshrc, or ~/.profile to make it permanent.
Problem: Binary is not executable.Solution: Add execute permissions:
chmod +x /usr/local/bin/cloudstic
Problem: brew install cloudstic/tap/cloudstic fails.Solution: Update Homebrew and try again:
brew update
brew install cloudstic/tap/cloudstic
Problem: Build fails with Go version error.Solution: Upgrade Go to version 1.21 or later:
# Check current version
go version

# Download latest from https://golang.org/dl/
If you encounter issues not covered here, please report them at github.com/cloudstic/cli/issues.