Article
Friday, September 25, 2026

Ghostable + Lerd: Run Commands Without Exporting .env

Run PHP and Artisan commands through Lerd with Ghostable environment values, without exporting a plaintext .env file.

Ghostable + Lerd: Run Commands Without Exporting .env

Ghostable now works with Lerd to run PHP and Artisan commands using your Ghostable environment values, without exporting a plaintext .env file first.

If you use Lerd for local development, you can keep your configuration in Ghostable and pass it directly to the command that needs it.

Run your commands with Ghostable

From a project already set up with Ghostable and Lerd, wrap your command with ghostable env run:

ghostable env run --env local -- lerd php artisan migrate:status

Ghostable decrypts the local environment on your machine, and Lerd passes those values into the PHP command inside its container. Use your own environment name and make sure its database settings are reachable from Lerd.

The same pattern works for other PHP and Artisan commands. When a command needs only a few variables, add --only to select the Ghostable keys it receives.

Support is available in Ghostable CLI 3.1.1 with Lerd 1.35.0. Ghostable handles Lerd's environment passthrough automatically.

Configuration for the command you run

The values are passed to the command you launch. This does not configure PHP-FPM web requests or Lerd's background workers, and it does not change processes that are already running.

Your values stay encrypted in .ghostable/ until Ghostable decrypts them locally for use. No hosted Ghostable service receives your plaintext secrets. The command receives plaintext at runtime, so application code can still log or write it to disk. Laravel's config:cache, for example, writes resolved configuration to a file.

To get started, follow the Ghostable new-project guide, then use the wrapper above with your Lerd commands.

Want product news and updates?

Sign up for our newsletter.

Email Address

We care about your data. Read our privacy policy.