Simple and scalable PHP with serverless
Simplify your infrastructure and scale with ease.
Bref is an open-source project that helps you go serverless on AWS with PHP.
serverless.yml
service: demo
provider:
name: aws
functions:
web:
runtime: php-82-fpm
handler: public/index.php
events:
- httpApi: '*'Why Bref? Why serverless?
We're in 2026. Applications should scale automatically. Hosting should be reliable and cost-efficient. Infrastructure should accelerate development, not consume our time.
Bref deploys PHP applications to AWS Lambda and sets up the rest of the infrastructure using serverless services.
- Simple.
- Instead of setting up and maintaining servers, define your application in a simple
serverless.ymlfile. Then deploy to AWS by runningserverless deploy. - Scalable.
- Bref provides open-source runtimes to run PHP on AWS Lambda. AWS Lambda runs your code redundantly across data centers and scales in real-time. All automatically. Handle 1 request/second or 1000 with the same code.
- Cost-efficient.
- Instead of paying for servers that are idle most of the time, pay for the time the code is actually running. The AWS free tier even includes about 1 million free requests every month. Play with the serverless costs calculator.
- Extensible.
- Bref uses standard CloudFormation under the hood: you can use everything AWS has to offer. If you are a cloud expert, Bref also works with AWS CDK, Terraform, and more.
$ serverless deploy
Deploying demo to stage dev (us-east-1)
✔ Service deployed to stack demo-dev (31s)
endpoint: https://yti4le2q5.lambda-url.us-east-1.on.aws/
functions:
web: demo-dev-web (750 KB)
cron: demo-dev-cron (750 KB)
worker: demo-dev-worker (750 KB)
Use cases
Serverless means whatever you choose it to mean.
Run PHP as usual, like on any server. Except it scales (almost) infinitely and you don't maintain the infrastructure.
Lift-and-shift existing apps or build new ones with your favorite framework.
- Websites
- Run PHP websites with Laravel, Symfony or any other framework, with a worldwide CDN and your custom domain.
- HTTP APIs
- REST or GraphQL APIs deployed in seconds. Need more performance? Enable Laravel Octane or the Symfony equivalent.
- CLI commands
- Run DB migrations, admin commands, or any other CLI command from your machine or your CI/CD.
- Cron tasks
- Every day, every hour, every minute… Run CLI scripts, Symfony Console commands, or the Laravel Scheduler.
Or go the extreme opposite: build event-driven microservices with infinitely scalable cloud services like SQS and EventBridge.
Or anything in between, that works too.
- Job queues
- Run 1000 jobs with 1 worker in 1000 seconds, or with 1000 workers in 1 second. It's just as simple and it costs the same. SQS invokes your code directly, no long-running process to maintain.
- Event-driven microservices
- Decouple and scale microservices without container madness. Send messages to EventBridge and let it invoke your PHP classes directly. No integration to write.
- File processing
- S3 can invoke a PHP class whenever a new file is uploaded. Resize images, convert videos, generate PDFs…
- WebSockets
- AWS API Gateway manages the WebSocket connections for you. Send messages to your users in real-time.
They sponsor the open-source project ❤️
Premium sponsors
Gold sponsors
Become a sponsor and help Bref be a sustainable open-source project.
Happy users and community
“Bref is excellent. We've been running a Laravel app with it since 2020 and it's currently handling over 160 million requests per month without a hiccup.”

“Bref has been a boon for running our customer's applications. We've had a Laravel API on Bref for the last 12 months serve over 25 million requests with an average response time of 50ms.”

“Just finished migrating our production from Heroku to AWS Lambda via Bref. It'll save us around $2k a year 🤯”

“Every time I throw something up onto AWS Lambda in PHP using Bref I marvel at how mega-useful it is. If you haven’t checked out Bref you’re probably missing out”

“When your production website with Symfony, API Platform and Bref handles more than 500 simultaneous connections without flinching…”

“I’ve been running APIs and websites with Bref in prod for over a year now. It is indeed as simple as you describe it.”

“There is something amazing and magical about Bref and serverless deploying stuff to the cloud.”

“Happily using Bref since 2019 to process millions of requests, jobs and scheduled tasks. It powers the best technical accomplishment of my career and has made me a better software engineer and open-source contributor.”

“The team embraced Bref with lightning speed! We were able to roll out the first parts of our new event-driven architecture within days, crafting new features in a mere fraction of the time it used to take — truly mind-blowing!”

“An incredible project and one we're very proud to use in production for a recent eCommerce project we launched that saw 32 million Lambda invocations last month.”

“Bref defines how PHP should run on AWS Lambda. At Voxie, we sponsor Bref because it's more than a runtime — it's the best foundation for building scalable, efficient products on AWS Lambda.”

How teams use Bref to scale
Discover how teams use Bref to scale their PHP applications with serverless. From reducing costs to improving performance, serverless is simplifying the way developers build and deploy applications.
Treezor: a serverless banking platform
Treezor, a banking-as-a-service platform processing millions of transactions daily, successfully migrated its legacy PHP application to serverless using AWS Lambda and Bref. This transformation improved scalability, reduced response times by 2.5x, cut production alerts by up to 3x, and reduced transaction timeouts 10x.
How Craft CMS built Craft Cloud
Craft CMS built Craft Cloud, a serverless hosting platform to run Craft CMS projects at scale using AWS and Cloudflare. It uses Bref and AWS Lambda to host PHP applications, with each customer project isolated in its own environment and container. With over 310 million HTTP requests handled in a month, Craft Cloud proves that running PHP serverless is fast, scalable, and production-ready.


