Skip to main content
The .env file sits in the application root, next to artisan. It holds server-level settings: the site address, the database, and the cache, queue and mail drivers. Everything an owner changes day to day, such as channel keys, AI keys, payment gateways and SMTP, lives in the admin panel and is stored in the database instead.
.env contains secrets. Keep it out of the public web folder, out of shared backups and out of version control.

Edit the file

1

Open the file

Open .env with your hosting file manager or over SSH. Do not rename it or move it.
2

Change the value

Put a value in quotes when it contains spaces or a #. Leave a key out entirely to use its default.
3

Reload the configuration

If you ever ran php artisan config:cache on the server, run php artisan config:clear afterwards. Otherwise the change applies on the next request.

Screens that write to .env

Three places in MagicPost change the file for you, so PHP must be able to write to it. The installer checks this on its Permissions step.

Application

The address you type in a browser must match APP_URL. System health shows a Site address warning when the page was opened at one host while APP_URL names another, because posts sent in the background and links in emails use APP_URL.

Database

The installer saves your answers by replacing the existing DB_* lines, so those lines must already exist in .env. See Installation problems.

Sessions

Cache and locks

See Cache and optimisation.

Queue

How the scheduler and the queue work together is covered in Cron and queue.

Mail

These values are the fallback. Once a host is saved under Admin → Backend Settings → SMTP Settings, that saved row overrides them for every email. See Email and SMTP.

Files and storage

Read File storage before relying on the s3 disk.

Video processing

See Video processing.

Logging

Redis

Only needed if you choose redis for the cache or the queue.

Plugin license checks

These tune how plugin license keys entered in Admin → Plugins are verified.

Laravel Pulse

MagicPost includes Laravel Pulse. Its PULSE_* keys (PULSE_ENABLED, PULSE_PATH, PULSE_STORAGE_DRIVER, PULSE_STORAGE_KEEP, PULSE_INGEST_DRIVER, PULSE_INGEST_BUFFER, PULSE_INGEST_KEEP, PULSE_DB_CONNECTION, PULSE_REDIS_CONNECTION, PULSE_CACHE_DRIVER, PULSE_SERVER_NAME, PULSE_SERVER_DIRECTORIES, PULSE_DOMAIN, and the PULSE_*_ENABLED, PULSE_*_SAMPLE_RATE, PULSE_*_THRESHOLD and PULSE_*_LOCATION options for each recorder) are defined in config/pulse.php. The defaults work as they are. The /pulse dashboard is open only when APP_ENV is local, because the application defines no access rule of its own.

Keys you do not need

config/services.php lists GOOGLE_*, FACEBOOK_*, TWITTER_* and LINKEDIN_* client keys. MagicPost overwrites them at runtime with the values saved under Admin → Backend Settings → Auth Settings, so set social login there, not in .env.