Contents
Infisical lets you store API keys and database passwords in one place and pass them to your app as environment variables when it starts. Start by running it on your own computer with Docker Compose and storing only dummy values.
This review is for developers who keep secrets in .env files and want a safer setup. After reading it, you can do the following:
- Run Infisical on your own computer and store a dummy secret
- Start an app with the CLI and pass it the stored values as environment variables
- Use
infisical scanto check a repository for leaked secrets
What Infisical does
The official docs and README list these secrets management features:
- Per-environment secrets: Each project holds separate values for environments such as development and production. Every change creates a new version, and you can roll back to an earlier state
- Runtime delivery: Apps fetch secrets through the CLI, SDKs, agents, Kubernetes, or CI/CD. Infisical can also sync secrets to GitHub, Vercel, AWS Secrets Manager, and other platforms
- Rotation: Infisical replaces credentials, such as database credentials, with new values on a schedule
- Access control: Roles (RBAC) decide which values people and machine identities can read or change
- Audit logs: Infisical records who did what. The docs say this needs a Pro or higher paid plan, and self-hosted instances need an Enterprise license
- Secret scanning: Infisical can monitor GitHub, GitLab, and Bitbucket repositories, and the CLI can scan local files and Git history. CLI scans run locally and don’t need an Infisical login
The same platform also covers certificates, key management (KMS), and privileged access management.
Why this is safer than a .env file in the repository
The official docs describe Infisical Secrets Management as a replacement for .env files, hardcoded credentials, and secrets shared over channels such as Slack. They name committing a .env file and printing environment variables to a CI log as common ways secrets leak. With Infisical, the server stores the values encrypted, and the app receives only what it needs when it starts. You no longer keep a .env file next to your code, so there is nothing to commit by accident. Roles also limit who can read each environment.
Infisical Cloud and self-hosting
You can use Infisical Cloud (app.infisical.com), run by the vendor, or run Infisical in your own environment. The docs say both offer the same core features. With the cloud version, the vendor handles upgrades and operations. When you self-host, you keep your own data, and you handle upgrades, monitoring, and backups. Self-hosting options include Docker, Docker Compose, Kubernetes, and a Linux package.
The license depends on the directory. Most of the repository is under the MIT license. The ee directories, which hold paid Enterprise features, use a separate Enterprise license that requires a valid subscription for production use. The license allows copying and modifying that code for development and testing without a subscription.
Try it safely on your own computer
Don’t put real passwords or API keys in while you are trying it out. Use dummy values such as test-1234. The official Docker Compose setup is meant for trials and small deployments, not for high-availability production.
-
Install Docker and Docker Compose. The official minimum is 2 CPU cores, 4 GB of RAM, and 20 GB of disk.
-
In a working folder, download the Compose file and the settings file.
curl -o docker-compose.prod.yml https://raw.githubusercontent.com/Infisical/infisical/main/docker-compose.prod.yml curl -o .env https://raw.githubusercontent.com/Infisical/infisical/main/.env.example -
The
ENCRYPTION_KEYandAUTH_SECRETin.envare sample values marked as unsafe for production. Even for a trial, replace them with values fromopenssl rand -hex 16(ENCRYPTION_KEY) andopenssl rand -base64 32(AUTH_SECRET). -
Start Infisical.
docker compose -f docker-compose.prod.yml up -d -
Open
http://localhost:80in a browser and create the admin account. The first user to sign up becomes the instance administrator, so do this before anyone else can reach it. -
Create a project and add one dummy value, such as
DUMMY_API_KEY, to the Development environment.
Common tasks: pass values with the CLI
The CLI has official packages for each OS.
| OS | Install command |
|---|---|
| macOS | brew install infisical/get-cli/infisical |
| Windows | winget install infisical (Scoop also works) |
| Debian/Ubuntu | Run the official setup script, then sudo apt-get install -y infisical |
| Others | The docs cover npm (npm install -g @infisical/cli), RedHat-based systems, Alpine, and Arch Linux |
Check the install with infisical --version. Then use these commands:
| Task | Command |
|---|---|
Log in (use --domain for a self-hosted instance) |
infisical login --domain http://localhost:80 |
| Link the current folder to a project | infisical init |
| Start an app with secrets as environment variables | infisical sm run -- npm run dev |
| Pick an environment and check a value | infisical sm run --env=dev -- printenv DUMMY_API_KEY |
| Scan a repository’s history | infisical scan --verbose |
| Install a hook that scans before each commit | infisical scan install --pre-commit-hook |
CLI version 0.43.145 and earlier don’t have sm. Use infisical run instead of infisical sm run, or upgrade the CLI.
infisical scan finds leaks, like Gitleaks and TruffleHog do. Infisical’s secrets management keeps the values out of the repository to begin with, so using both covers prevention and detection.
Cautions
- When you self-host,
ENCRYPTION_KEYprotects every secret. The docs warn that without this key you can’t decrypt secrets even if you restore the database. Back it up along with the database. - The self-hosted
.envholds this key and other important values. As the docs say, don’t commit it to version control, and restrict access with something likechmod 600 .env. - The PostgreSQL volume (
pg_data) holds all encrypted secrets. Deleting it loses your data. - Over
http://, the CLI sends secrets unencrypted. Usehttp://localhostonly on your own computer, and usehttps://when other machines connect. - Store only dummy values while testing. If you tested with a real key, replace that key afterward.
- Some features, such as audit logs, need a paid plan or an Enterprise license. Check the official pricing page to see which plan includes the features you need.
Read next
Sources
- GitHub: LICENSEgithub.com/Infisical/infisical/blob/main/LICENSE
- GitHub: Enterprise license for the ee directorygithub.com/Infisical/infisical/blob/main/backend/src/ee/LICENSE.md
- Docs: Cloud vs. self-hostinginfisical.com/docs/documentation/getting-started/concepts/deployment-models
- Docs: Deploy Infisical with Docker Composeinfisical.com/docs/self-hosting/deployment-options/docker-compose
- Docs: Environment variables (self-hosted)infisical.com/docs/self-hosting/configuration/envars
- Docs: Install the CLIinfisical.com/docs/cli/install
- Docs: CLI referenceinfisical.com/docs/cli/reference
- Docs: Inject secrets into local developmentinfisical.com/docs/documentation/guides/local-development
- Docs: Manage secretsinfisical.com/docs/documentation/getting-started/choose-a-product/secrets-management/overview
- Docs: Secret rotationinfisical.com/docs/documentation/platform/secret-rotation/overview
- Docs: Audit logsinfisical.com/docs/documentation/platform/audit-logs
- Docs: Role-based access controlsinfisical.com/docs/documentation/platform/access-controls/role-based-access-controls
- Docs: Detect leaked secretsinfisical.com/docs/documentation/getting-started/choose-a-product/secret-scanning
Checked on 2026-10-25
Similar tools
Gitleaks
Impact Local onlyA command-line tool that finds passwords, API keys, and tokens that have slipped into Git repositories and files.
- Purpose
- Defense
- Type
- Command line
- Difficulty
- Beginner
- License
- PermissiveMIT
- Category
- Vulnerability scanning