Skip to content

Projects, environments, sections and variables

The content of a vault is organized in four levels: project → environment → section → variable. Each environment produces one .env file.

Vault
└── Project api
├── Environment production → /srv/api/.env on web-1
│ ├── Section General
│ │ ├── APP_ENV=production
│ │ └── LOG_LEVEL=info
│ └── Section database
│ ├── DB_HOST=db.internal
│ └── DB_PASS=********
└── Environment staging → /srv/api-staging/.env on web-2

A project is an application or a service. Only its name is required; the other fields describe it and are written as comments in the header of every .env file it generates:

FieldNotes
NameRequired.
Author, Organization, License, URLFree text.
DateYYYY-MM-DD.
DescriptionSeveral lines.
Unix groupGroup given to deployed files; never written in the file.

Deleting a project deletes its environments, sections, variables and history.

An environment is one deployment of a project: production, staging, local… Its name is unique within the project, ignoring case. It also says where its .env file goes:

FieldMeaning
ServerBlank for this machine (a local deploy), or an SSH destination: a host alias from ~/.ssh/config, user@host, or ssh://user@host:port.
Target pathRequired. The directory the file is written into; it must exist.
File nameBlank for .env.

Every environment is created with a default section, General.

A section groups related variables, for example everything about the database. In the .env file each section is a titled block, in the order of the environment, General first.

A section can have an optional comment of several lines, written under its title in the .env file, so you do not have to comment every key. General can be given a comment but can be neither renamed nor deleted. Deleting another section deletes its variables.

A variable belongs to a section and has:

FieldMeaning
KeyAn environment variable name: a letter or _, then letters, digits or _. Stored and shown in uppercase.
ValueAny text, possibly several lines.
CommentOptional, written as # … right before the variable in the .env file.
SecretMasks the value everywhere until it is revealed. See Secrets and masking.
StateEnabled, disabled or commented. See Variable states.

The key is unique within the environment, not only within the section, because the .env file is flat. A variable can be moved to another section of its environment; it goes to the end of that section.

Every record also keeps its audit: who created it and when, and who modified it last and when, shown in the variable detail.