From the creator of DOTENV 20.4k

Dotenv. Extreme.

Cross platform. Multi-environment. Encrypted.

Run on Anything

Whether you're using Node, Python, Ruby, Docker, CI, or AI agents, dotenvx works the same way. No custom integrations required. It just works – anywhere.

“It has cross-platform and cross-language support so you can use it with Node.js, Python, Ruby, Go, Rust, and more.”

Rebecca Deprey Rebecca Software Engineer
$ echo "HELLO=Dotenvx" > .env
$ echo "console.log('Hello ' + process.env.HELLO)" > index.js
$ dotenvx run -- node index.js
⟐ injected env (1) from .env
Hello Dotenvx

Multiple Environments

Development, production, agents, or anywhere in between. Load the right .env file with a single flag.

“You can deploy env files to prod now? Creators of dotenv have been working on dotenvx which encrypts your env variables.”

Zaid Zaid Founder, Scira.ai
$ echo "HELLO=Production" > .env.prod
$ echo "console.log('Hello ' + process.env.HELLO)" > index.js
$ dotenvx run -f .env.prod -- node index.js
⟐ injected env (1) from .env.prod
Hello Production

Encrypt in One Command

Add encryption to your .env files with a single command. Generate a public/private keypair and securely share encrypted secrets without changing your workflow.

“Dotenvx is the strongest option for sharing .env files. It’s a tool that lets you commit .env files to Git while keeping them encrypted. Same convenience, almost zero leak risk.”

コムテ Comte Founder, Izanami
$ dotenvx encrypt -f .env.prod
$ cat .env.prod
#/-------------------[DOTENV_PUBLIC_KEY]--------------------/
#/            public-key encryption for .env files          /
#/       [how it works](https://dotenvx.com/encryption)     /
#/----------------------------------------------------------/
DOTENV_PUBLIC_KEY_PROD="03d4b0d392c92320fe751163293282bc434f38d7fe72a0429c3e449f312abd5121"

# .env.prod
HELLO=encrypted:BH1SPwuO10wBx/V1in3L9Hgkcap75QKIiMXUXqniJDd9xA6WJwvWedyuvRk0M1HdZt9MlvFMUHrqmuwzE0dPDEcpvx4MIMhSJzzSyGbwdFniJ1pjqjEqjRkQfdroB6iOVZR8UmsyaJcz/18=

$ dotenvx run -f .env.prod -- node index.js
⟐ injected env (2) from .env.prod
Hello Production

Drop-In for Dotenv

Install and use it in code just like dotenv. Or install the CLI globally and unlock dotenv for any language, framework, or platform.

$ npm install @dotenvx/dotenvx --save

// swap require('dotenv').config() for:
require('@dotenvx/dotenvx').config()
// or import '@dotenvx/dotenvx/config' // for esm

Dotenvx is a really smart concept. Instead of plaintext .envs, secrets are encrypted files. Agents can't read them, and they're shippable to cloud runners with a single key.

I love .env files.

They work everywhere: local development, CI, containers, servers, cloud platforms, and even agents. Easy to get started with, yet flexible enough for advanced use cases, few tools are as practical as they are elegant.

But they've had a downside. Plaintext. Plaintext secrets have spread quietly across laptops, repositories, CI systems, chat messages, screenshots, and production machines. But the answer is not replacing them, a universal standard with more complicated platforms and solutions. The answer is securing them.

That's why I built dotenvx and why I continue to build it. I care about .env files and want to see them secured. I want to see them have a bright future and you along with them.

Thank you and please enjoy dotenvx.

Free & open source above Professional security below
PROFESSIONAL SECURITY

Armored
Keys

Private keys. Off device. Under guard.