Laravel
A guide on how to deploy Laravel with Coolify
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling.
Example repository here.
Requirements
- Set
Build Pack
tonixpacks
- Set
APP_KEY
- Set
Ports Exposes
to80
If you configured your application before version beta.184 and set the
NIXPACKS_PHP_ROOT_DIR
and NIXPACKS_PHP_FALLBACK_PATH
environment
variables, you need to remove them.
Other components
If your application needs a database or Redis, you can simply create them beforehand in the Coolify dashboard.
You will receive the connection strings which you can use in your application and set them as environment variables:
DB_CONNECTION=mysql
DB_HOST=<DB_HOST>
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=
REDIS_HOST=<REDIS_HOST>
REDIS_PASSWORD=null
REDIS_PORT=6379
There is a known limitation with nixpacks and Laravel. You cannot connect to the database without exposing it to the internet. We are working on a solution.
More details here.