Install dotenvx where you need it.

npm install @dotenvx/dotenvx --save
npx dotenvx help


dotenvx is made with javascript – so you can use it just like you use dotenv – as a drop-in replacement.

npm install @dotenvx/dotenvx --save
// index.js

console.log(`Hello ${process.env.HELLO}`)

Find the @dotenvx/dotenvx package here.


Installing with brew is the most straight forward global install:

# install with Homebrew and then use the dotenvx command
brew install dotenvx/brew/dotenvx

Find the dotenvx brew tap here.


After brew our script is easiest. With curl:

curl -sfS | sh

Or with wget:

wget -qO- | sh

Read the script here.


We also provide a docker image for your convenience:

docker run -it --rm -v $(pwd):/app dotenv/dotenvx help
docker run -it --rm -v $(pwd):/app dotenv/dotenvx run -- node index.js

Or in any image:

FROM node:latest
RUN echo "HELLO=World" > .env && echo "console.log('Hello ' + process.env.HELLO)" > index.js
RUN curl -sfS | sh
CMD ["dotenvx", "run", "--", "echo", "Hello $HELLO"]

GitHub Releases

You can also download straight from GitHub Releases.

curl -L -o dotenvx.tar.gz "$(uname -s)-$(uname -m).tar.gz"
tar -xzf dotenvx.tar.gz
./dotenvx help


Download the windows executable directly from the releases page.

(unzip to extract dotenvx.exe)


Heroku Buildpack

For our Heroku friends, we have a heroku buildpack.

heroku buildpacks:add

The dotenvx binary will be available to your deployment so that you can use it in your Procfile like so.

# Procfile
web: dotenvx run -- node index.js


dotenvx is a standalone binary, so (if you want) you can just download it directly:

# download it to `./dotenvx`
curl -sfS --proto '=https'$(uname)/$(uname -m).tgz | tar xz

# install it to `/usr/local/bin/dotenvx`
sudo install -m 755 dotenvx /usr/local/bin

# check it works
dotenvx help

Download a specific version:

# download version 0.6.9
curl -sfS --proto '=https' "$(uname)/$(uname -m).tgz?version=v0.6.9" | tar xz

# check the version
./dotenvx --version

Npm local

Use dotenvx locally as a cli in your node project.

npm i @dotenvx/dotenvx --save
  "scripts": {
    "start": "./node_modules/.bin/dotenvx run -- node index.js"
  "dependencies": {
    "@dotenvx/dotenvx": "^0.6.0"

Npm global

You can also install globally using npm's --global flag.

npm install @dotenvx/dotenvx --global
dotenvx help


Or prefer to run as needed, uses npx.

npx @dotenvx/dotenvx help


pkgx is a single, standalone binary that can run anything. Since it can run anything, it can run dotenvx:

pkgx npx @dotenvx/dotenvx help