Most users won't need to manage local development ENVKEYs manually. As long as an app has a
.envkey file and you have the EnvKey App and CLI installed, your development environment with will be loaded automatically. If that's the case, you can follow the Integration Quickstart to connect to an EnvKey environment.
In some situations, like when you're using containers in development or developing on a VM (whether local or remote), it might not be practical to install the EnvKey App and CLI on the OS running your program. In that case, you can generate a local development
ENVKEY instead and use that to connect to your development environment.
It might also be easier to use a local development
ENVKEY if you're using a web server like Apache or FastCGI that runs processes under its own OS user like
www-data. That's because loading EnvKey development config automatically without a local development
ENVKEY requires access to the
$HOME/.envkey directory of the OS user that installed EnvKey, which the web server's user typically doesn't have.
Open up the EnvKey App, sign in, select the application you want to integrate with in the sidebar, and then select the
ENVKEYs tab. Assuming you have permission to manage servers, you'll see a
Local Keys section at the top. Click the
Generate Local Key button, then copy the generated ENVKEY.
Or you can use the EnvKey CLI:
envkey local-keys create
ENVKEYinto a file at:
$HOME/.envkey/apps/$APP_ID.env. $APP_ID should be replaced with your app's id: look for it in the UI or CLI output after generating a local key.
Note: this option typically won't work with web servers like Apache or FastCGI that run under a different OS user
.envfile in the home directory:
Note: this option also typically won't work with web servers like Apache or FastCGI that run under a different OS user
ENVKEYas an environment variable that will be visible to your app.
ENVKEYinto a version-control-ignored
.envfile at the root of your project.
From there, follow the integration quickstart from the 'Integrate with your app' section.
Updated 6 months ago