---
title: "Deploy Laravel 12, PHP 8.4, MySQL 8.4"
description: "Consistent dev/production setup for Laravel 12 with Railway deployment"
category: "Other"
url: https://railway.com/deploy/laravel-12-php-84-mysql-84
---

# Deploy Laravel 12, PHP 8.4, MySQL 8.4

Consistent dev/production setup for Laravel 12 with Railway deployment

**[Deploy Laravel 12, PHP 8.4, MySQL 8.4 on Railway](https://railway.com/template/laravel-12-php-84-mysql-84)**

- **Creator:** Peter Legierski
- **Category:** Other
- **Total deploys:** 133

## Template content

### Laravel-12

- **Source:** legierski/laravel-12-railway
- **Public domain:** Yes

### MySQL-84 https://devicons.railway.app/i/mysql.svg

- **Image:** mysql:8.4
- **Start command:** `docker-entrypoint.sh mysqld --innodb-use-native-aio=0 --disable-log-bin --performance_schema=0 --innodb-buffer-pool-size=1G`

## Documentation

# 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

- [Laravel Sail Documentation](https://laravel.com/docs/sail)
- [Railway Docker Deployment Guide](https://docs.railway.com/guides/dockerfiles)

### Implementation Details

The template includes a `railway.toml` configuration file that automatically deploys using Docker Compose:

```toml
[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.

## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/laravel-12-php-84-mysql-84
