Environment Variables: The Ten You Actually Need
A short list of the environment keys that matter on day one, and safe defaults for everything else.
Put the queue worker under a process manager such as systemd or Supervisor, otherwise emails and webhooks will quietly pile up.
Before you start
Launch Crate needs PHP 8.2 or newer, a database and somewhere to run a queue worker. Everything else is optional and can be added later.
Most installs take under ten minutes on a fresh server. The web installer checks requirements, writes the environment file and creates the first admin.
- PHP 8.2+ with intl, mbstring and gd
- MySQL 8, PostgreSQL 14 or SQLite 3.35+
- A process manager for the queue worker
- One cron entry for the scheduler
“Simplicity is prerequisite for reliability.”
— Edsger W. Dijkstra, EWD 498 (1975)
Step by step
We recommend starting with SQLite for local development and switching to MySQL or PostgreSQL before launch; the migration command handles the move.
APP_ENV=production
APP_URL=https://shop.example.com
DB_CONNECTION=mysql
QUEUE_CONNECTION=redis
MAIL_MAILER=smtp
Troubleshooting
Keep your environment file out of version control and back it up somewhere safe; it holds the keys that decrypt your data.
If the installer stops at the requirements screen, the message names the missing PHP extension and the package that provides it.
Scheduled tasks run from a single cron entry that calls the scheduler every minute; there is no need to add one line per job.
File permissions trip up more installs than anything else: the web server needs write access to storage and the cache folder, nothing more.
How we work on posts like this
Mistakes stay visible. If a post turns out to be wrong, we correct it in place, mark the correction and explain what we got wrong, rather than quietly swapping the text. Readers trust a build log more when they can see it being honest about its errors.
Questions or a better approach? Leave a comment below, or reply to the build-log email and we will fold the best ideas into the next release.
Clear, practical and no fluff. Thank you.
Same here, this saved me an afternoon.
Seconding this request.
It worked for me on 3.1 after running the upgrade command.
Agreed, the screenshots help a lot.
Thanks for reading! Yes, that is on the roadmap for the next point release.
Great write-up. Would love a follow-up on how you handle this with multiple environments.
Would you share the full config file? The snippet is helpful but I am missing context.
Seconding this request.
We switched to this approach after the last post and support tickets dropped noticeably.
Would you share the full config file? The snippet is helpful but I am missing context.
This is exactly the checklist I needed. Printing it and taping it next to my monitor.