Guide

How to share .env files with your team securely

Pasting a .env file into Slack works until someone leaves, a laptop is lost, or a secret ends up in a screenshot. Here is how to give a team one encrypted source of truth instead.

The problem

A shared .env file gets copied: into chat history, email, a wiki page, a teammate's downloads folder. Every copy is a place a secret can leak, and none of them can be revoked or audited.

It also drifts. One developer rotates a key, nobody else hears about it, and the next deploy breaks. Onboarding means hunting down whoever has the latest version.

How to do it with SnapEnv

  1. Put the variables in one place

    Create a project in SnapEnv and paste your existing .env into the bulk import area, or push it from the terminal. Values are encrypted with AES-256-GCM before they are stored.

    snapenv push --env dev
  2. Give each person the access they need

    Invite teammates to the workspace and set a project role. Developers get write access on unprotected environments and none on protected ones such as prod, unless you grant it explicitly.

  3. Let everyone pull instead of copying

    Each teammate installs the CLI, authenticates with an access token, and pulls the current values into their own .env.

    curl -fsSL https://get.snapenv.io/install.sh | sh
    snapenv login --token snp_live_xxxxxxxxxxxx
    snapenv pull --env dev
  4. Rotate or revoke without a scavenger hunt

    Change a value once and everyone gets it on their next pull. Remove a person or revoke a token and their access ends. Every pull, push and change is recorded in an append-only audit log.

Frequently asked questions

Is it safe to share a .env file over Slack or email?

It is risky. Chat and email keep copies indefinitely, can be searched by anyone with access, and cannot be revoked. A secrets manager keeps a single encrypted copy and records who accessed it.

Should I commit .env files to git?

No. Anything committed stays in history even after you delete it. Keep .env in .gitignore and distribute values through a secrets manager instead.

How does a new teammate get the right variables?

They are invited to the workspace, install the CLI and run snapenv pull for the environment they have access to. No one has to send them a file.

Can I limit who sees production values?

Yes. Environments can be protected, and production is protected by default. Developer and Read-only members get no access to protected environments unless an Owner or Admin grants it.

Free for small teams. Set up in minutes.

3 projects, 3 members, full CLI and Kubernetes operator. No credit card.