This guide covers how to install and run Secrets using pre-compiled binaries from GitHub Releases. This is a great option if you don't want to use Docker but still want a quick and easy installation.
-
Go to the GitHub Releases page.
-
Download the archive for your operating system and architecture (e.g.,
secrets_Linux_x86_64.tar.gz). -
Extract the archive:
tar -xzf secrets_Linux_x86_64.tar.gz
-
Move the
secretsbinary to a directory in yourPATH(e.g.,/usr/local/bin):sudo mv secrets /usr/local/bin/
It's recommended to verify the checksum of the downloaded archive:
-
Download the
checksums.txtfile from the same release. -
Run the verification command:
sha256sum --ignore-missing -c checksums.txt
Expected output:
secrets_Linux_x86_64.tar.gz: OK
-
Initialize environment:
# Generate a 32-byte base64 key for localsecrets KMS export KMS_KEY=$(openssl rand -base64 32) export KMS_PROVIDER=localsecrets export KMS_KEY_URI=base64key://$KMS_KEY
-
Generate master key:
secrets create-master-key --id default --kms-provider localsecrets --kms-key-uri "$KMS_KEY_URI" > .env
-
Configure database: Edit the
.envfile to include your database connection string:echo "DB_DRIVER=postgres" >> .env echo "DB_CONNECTION_STRING=postgres://user:password@localhost:5432/mydb?sslmode=disable" >> .env
-
Bootstrap:
set -a; source .env; set +a secrets migrate secrets create-kek --algorithm aes-gcm
-
Start the server:
secrets server