Deploy Laravel Applications
Prerequisites
- Laravel application in a Git repository
- HCS account with Applications access
- Domain name (optional)
Deployment Steps
-
Login to HCS Dashboard
- Navigate to the dashboard
- Sign in with your credentials
-
Create New Application
- Click “Create New Application”
- Select “Laravel” as your application type
- Connect your Git repository
-
Configure Build Settings
- Set Build Pack to
nixpacks
- Add required environment variables
- Configure nixpacks.toml
- Set Build Pack to
-
Deploy Your Application
- Click “Deploy” to start the build process
- Wait for build and deployment to complete
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 the required environment variables
- Add
nixpacks.toml
with the following configuration - Set
Ports Exposes
to80
Environment Variables
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:
All-in-one container
If you would like to start queue worker, scheduler, etc within one container (recommended), then you can place a nixpacks.toml
inside your repository with the following value.
Inertia SSR
If you are using Inertia.js with server-side rendering, you should add another worker in your nixpacks.toml
file to automatically start your SSR server.