# Share a private key

[← Back to Docker Compose](https://dotenvx.com/docs/docker-compose.md#share)

Share the encrypted .env file through git and the development key through your team's approved private channel.

```console
$ dotenvx keypair DOTENV_PRIVATE_KEY
```

Your teammate saves the value in an ignored .env.keys file:

```dotenv
DOTENV_PRIVATE_KEY="your-shared-private-key"
```

They use the main compose.yaml:

```console
$ docker compose --env-file .env.keys up --build
$ docker compose --env-file .env.keys down
```

Keep .env.keys out of git and Docker images. Anyone retaining the key can still decrypt the file after repository access is removed.
