Documentation
Setup

Setup

To use Bref, you will need an AWS account and the serverless CLI. Let's get started:

AWS account

Bref deploys your applications to your AWS account. To create one, go to aws.amazon.com (opens in a new tab) and click Sign up.

AWS has a generous free tier that will usually allow you to deploy your first serverless applications for free.

Serverless CLI

Bref relies on the Serverless framework (opens in a new tab) and AWS access keys to deploy applications. You will need to install the serverless CLI using NPM:

npm install -g serverless@3

Bref is compatible with Serverless Framework v3 and v4. Note that Serverless Framework v4 has proven to be very unstable and is no longer open-source. We recommend using v3 for the best experience.

If you don't want to install serverless via NPM, you can install it as a standalone binary by following this documentation (opens in a new tab).

AWS credentials

Finally, we need AWS credentials so that the serverless CLI can deploy to AWS.

If you have already set up AWS credentials on your machine (for example if you use the aws CLI), you can skip this step.

  • Create AWS access keys

  • Set up those keys by running:

    serverless config credentials --provider aws --key "key" --secret "secret"

    This will store the credentials in ~/.aws/credentials (the official file for AWS credentials (opens in a new tab)). This is the same as running the aws configure command with the aws CLI.

    Alternatively (for example in CI/CD), you can store credentials in environment variables:

    export AWS_ACCESS_KEY_ID=key
    export AWS_SECRET_ACCESS_KEY=secret

What's next?

That's it, you're ready to use Bref!

Bref is compatible with PHP 8.0 or greater. If you are using PHP 7.4, Bref v1 (previous major version) will be installed instead.