Manage a site environment file

Learn how to review a site's .env file in Herne. This demonstration uses invented content and redacted placeholders, which are not usable configuration. We do not save a file, submit a helper, generate a key or run application commands.

Demonstration: Herne 3.55.43, English interface and narration, fictional Northstar Studio content. Redacted placeholders are not usable settings. Actual product views are rendered with synthetic data; no application file is read or written, no helper is submitted and no key, cache, Redis or worker operation runs. Written guidance and selectable subtitles are available in six languages.

Watch the walkthrough

English audio · 6 min 35 sec · Subtitles in all six site languages.

1. Open the correct environment file

Learn how to review a site's .env file in Herne. This demonstration uses invented content and redacted placeholders, which are not usable configuration. We do not save a file, submit a helper, generate a key or run application commands.

Open the intended site, then choose Runtime and .env. Check the domain and the Editing path before reading or changing anything. This editor targets the site's web root environment file. It is separate from the panel's configuration and may differ from another deployment directory.

Viewing and saving require the corresponding site permissions. The editor displays plain text; secret values are not automatically masked. Keep an approved private copy before editing. Do not include real keys or database passwords in recordings, screenshots or support messages. Our visible redacted strings are fictional placeholders.

Runtime menu showing .env for fictional studio.example.test.

2. Prepare a complete file change

The file exists badge reports presence only. It does not validate values or application health. A missing file opens an empty editor; an existing empty file can also contain no settings. The example button appears only when the site's .env.example is available. Do not treat either starting point as production ready.

Start from the complete current file for this application. Keep the prior copy private and make one intended change at a time. Review database connections, application settings and quoting without replacing unrelated values. The panel does not create an automatic backup or version history for this editor.

Our unsaved example changes only APP_NAME from Northstar Studio to Northstar Studio Preview, preserving quotation marks around spaces. Typing does not save automatically. Compare the entire proposed file with the private prior copy. This fictional edit illustrates the review process and is not an instruction to rename a live application.

Missing .env badge and empty editor for the fictional site.
Existing fictional environment file with redacted key and password placeholders; not usable configuration.
Unsaved fictional APP_NAME change with the rest of the environment file retained.

3. Distinguish Save from loading a template

Save .env replaces the whole file, not just the changed line. Control or Command plus S also submits the form. Empty content can replace the file with an empty file. The one megabyte text limit is not a syntax or application check. Save success confirms writing, not a working application.

Load from .env.example opens a confirmation that warns about replacing the editor content. Cancel keeps the current editor. Confirming loads the complete template into a new editor response; it does not merge with current settings or save the application file. Preserve any unsaved work privately before using this action.

The loaded from example notice means review and save are still separate steps. A template may have an empty APP_KEY, local mode, debug enabled or different database settings. Compare it with the existing application configuration. Saving the template unchanged could lose essential values and expose debugging information on a live site.

Confirmation warning that loading .env.example replaces the editor content.
Fictional template loaded for review, with empty APP_KEY and a separate Save .env button.

4. Review the Redis helper carefully

Apply Redis defaults also has a confirmation here. Its source is the persisted .env, then .env.example if needed, or empty content if neither exists. It does not use the current unsaved editor text. Keep a private draft copy first; do not save unfinished production changes merely to feed this helper.

The helper sets seven fixed defaults: Redis for cache, sessions and queues, the PHP Redis client, a loopback host, a null password and the standard Redis port. Matching key lines are replaced and missing keys are added. Other lines remain. Review the exact values in the table; these defaults do not fit every server.

Check the actual Redis endpoint, credentials, PHP client support and application isolation through prefixes or logical databases. Plan for existing sessions and queued jobs before changing drivers. The helper does not install Redis, create private storage, migrate data, flush a shared server or restart workers. A remote or protected backend needs its own reviewed settings.

Key Helper value
CACHE_STORE redis
SESSION_DRIVER redis
QUEUE_CONNECTION redis
REDIS_CLIENT phpredis
REDIS_HOST 127.0.0.1
REDIS_PASSWORD null
REDIS_PORT 6379

The helper matches lines beginning exactly with a key followed by =, with no leading indentation. Commented lines, export forms and spaced assignments are not normalized. Review duplicate or alternate assignments in the complete file before saving.

Redis confirmation describing editor changes, before any helper submission.
Seven Redis defaults loaded into the fictional editor, awaiting review and a separate Save.

5. Preserve keys and plan cache activation

Redis defaults loaded into the editor means the helper result is only a preview. Review the complete file, including unchanged database and application values, and reconcile any private draft edits. Only the separate Save .env action writes it. The file exists badge still says nothing about whether the proposed backend works.

Preserve the existing APP_KEY when reviewing templates or helper output. Generating a key for a missing initial configuration is different from replacing an established key. A key change can invalidate sessions and make older encrypted data unreadable without the old key. Key rotation needs a separate reviewed recovery plan; this editor does not protect it automatically.

Saving the file does not rebuild Laravel's cached configuration. Despite the current tip's wording, config:cache rebuilds the configuration cache; config:clear removes it. A cached application may keep using old settings until the appropriate activation step. Choose the authorized application procedure separately; neither command runs when you save this editor.

Framework references: Laravel Configuration, Laravel Encryption.

6. Activate, verify and recover

Check the project path before using a site Artisan or deployment flow; its working directory may differ from this editor's path. Permissions and safety checks still apply. Long running workers can retain old configuration and need a planned refresh through their management flow. Saving here does not restart workers or confirm backend connectivity.

After an approved real save, reopen the file privately to confirm the intended content. Then complete the agreed activation procedure and a limited application check for the changed feature. Review sanitized logs if needed. File presence and a successful write do not prove that database access, sessions, cache or queues are healthy.

If the application fails after saving, preserve the error context without secrets and follow the reviewed recovery plan. The editor provides no automatic rollback. Restore the approved private prior file only when appropriate, then repeat activation and verification. Loading a template or clearing the editor is not recovery of the previous configuration.

Herne documentation