Guides / Secrets Management

How to Install & Set Up SOPS

Install SOPS to encrypt values inside YAML/JSON/ENV files so secrets can live safely in Git, using an age key.

Updated 20264-step setupDownload SOPS →

Prerequisites

  • ✓A Linux/macOS host
  • ✓An encryption key — age, GPG, or a cloud KMS

Install SOPS

Linux (binary)
curl -LO https://github.com/getsops/sops/releases/download/v3.9.0/sops-v3.9.0.linux.amd64
sudo mv sops-v3.9.0.linux.amd64 /usr/local/bin/sops
sudo chmod +x /usr/local/bin/sops
macOS (Homebrew)
brew install sops age

Create an age key and encrypt a file

terminal
age-keygen -o key.txt          # prints the public key
export SOPS_AGE_KEY_FILE=$PWD/key.txt
sops --encrypt --age age1examplepublickey... secrets.yaml > secrets.enc.yaml

Edit and verify

terminal
sops --version
sops secrets.enc.yaml          # opens decrypted in your editor
!

The binary download above is the same file for RHEL and Ubuntu — SOPS ships no distro-specific packages, just this and Homebrew.

Build from source

SOPS is Go, so a fresh build via the toolchain is straightforward and genuinely how the release binaries are produced.

terminal
go install github.com/getsops/sops/v3/cmd/sops@latest

Documentation & Knowledge Base

Official DocumentationSOPS Documentation →Knowledge Base & CommunitySOPS GitHub Discussions →
Download SOPS— all versions & official links→

Related Guides

OpenBaoInstall guide →HashiCorp VaultInstall guide →External Secrets OperatorInstall guide →

Need SOPS deployed and managed for you?

We're OpenStack Dev — we design, deploy, and operate production DevOps infrastructure.

Get in TouchAll Install Guides