Laravel 12, PHP 8.4, MySQL 8.4
Consistent dev/production setup for Laravel 12 with Railway deployment
Laravel-12
legierski/laravel-12-railway
Just deployed
MySQL-84
mysql:8.4
Just deployed
/var/lib/mysql
Deploy and Host Laravel 12, PHP 8.4, MySQL 8.4 on Railway
Laravel 12 is the latest version of the popular PHP framework, featuring enhanced performance and modern syntax. This template combines it with PHP 8.4's cutting-edge features and MySQL 8.4's improved performance, all configured with Docker Sail for consistent development environments.
About Hosting Laravel 12, PHP 8.4, MySQL 8.4
This template provides a minimal Laravel 12 application stack with Docker containerization via Laravel Sail. It includes a pre-configured MySQL 8.4 database, PHP 8.4 runtime with all necessary extensions, and nginx web server. The setup ensures identical environments between local development and Railway production deployment, eliminating the common "works on my machine" problem. Railway automatically handles container orchestration, scaling, and SSL certificates.
Common Use Cases
- Modern web applications requiring the latest Laravel features
- API backends with high-performance database requirements
- Full-stack applications needing consistent dev/prod environments
- Rapid prototyping with professional deployment infrastructure
Dependencies for Laravel 12, PHP 8.4, MySQL 8.4 Hosting
- Docker and Docker Compose (for local development)
- PHP 8.4 with required extensions (PDO, MySQL, mbstring, etc.)
Deployment Dependencies
Implementation Details
The template includes a railway.toml
configuration file that automatically deploys using Docker Compose:
[build]
dockerComposeFile = "docker-compose.yml"
dockerComposeService = "app"
The Laravel AppServiceProvider automatically forces HTTPS URLs when deployed to production environments, ensuring proper asset loading and security.
Why Deploy Laravel 12, PHP 8.4, MySQL 8.4 on Railway?
Railway deploys Docker containers directly, allowing this template to run the same environment locally and in production. The railway.toml
configuration automatically uses your docker-compose setup, eliminating environment differences.
Template Content
Laravel-12
legierski/laravel-12-railwayMySQL-84
mysql:8.4