Getting Started

Installation and Setup

Install the dotEnv CLI, authenticate, and connect your organization in under five minutes.

Back to all guides

This guide walks you through installing the dotEnv CLI, authenticating against dotEnv Cloud, and confirming that your organization is connected. The CLI is a single, statically linked Go binary, so there is nothing to compile and no runtime to install.

Install the CLI

There are two release channels: stable (tagged releases) and nightly (the rolling build of main). Pick the install method that matches your platform.

terminal
# macOS / Linux (Homebrew)
brew tap dotenvcloud/tap
brew install dotenv
# Linux / Windows (install script)
curl -sSL https://dotenv.cloud/install.sh | bash
# Go toolchain
go install github.com/dotenvcloud/cli@latest

Verify the binary is on your PATH:

terminal
dotenv version

Initialize your configuration

Run dotenv init to create a local configuration file and set up your first account. The command is interactive and walks you through authentication, organization selection, and telemetry preferences.

terminal
# Interactive setup
dotenv init
# Overwrite an existing configuration
dotenv init --force

Authenticate

For local development, dotenv login uses OAuth2 by default. It opens your browser, grants access to every organization you belong to, and supports automatic token refresh.

terminal
# OAuth2 login (default)
dotenv login
# OAuth2 without opening a browser (prints the URL)
dotenv login --no-browser
# Check the current authentication status
dotenv login --status

For automation and CI/CD, authenticate with an organization API key instead. API-key authentication is scoped to a single organization and never opens a browser:

terminal
dotenv login --api-key

Configure with environment variables

Every setting can be supplied through an environment variable, which is the preferred approach for non-interactive environments. The variables the CLI reads are:

Variable Purpose
DOTENV_API_KEYOrganization API key used for authentication.
DOTENV_API_URLOverride the API base URL.
DOTENV_ORGANIZATIONForce a specific organization slug.
DOTENV_CONTEXTSelect a saved context.
DOTENV_CLIENT_KEYClient-managed encryption key value.
DOTENV_DEBUGEnable verbose debug output.

Confirm the connection

Finally, check that the CLI can talk to dotEnv Cloud and that your organization context is correct:

terminal
dotenv status
dotenv list projects

If dotenv status shows your account and organization, you are ready to go. Continue with Creating Your First Project to set up your hierarchy and push your first secrets.