跳到主内容

Store files in Amazon S3

This guide explains how to store the uploaded files of Casdoor, such as avatars, in Amazon S3.


Learning outcomes​

  • Create an access key and prepare the bucket.
  • Add Amazon S3 as a storage provider in Casdoor.
  • Serve the files through a VPC endpoint or CloudFront.

What you need​

  • An AWS account and an S3 bucket
  • Administrator access to the Casdoor admin console

Prepare AWS​

  1. Create an access key and a secret access key. 见 管理访问密钥。

  2. In the Permissions of the bucket, turn off Block all public access, or add a bucket policy that allows Casdoor, and save.

    Block all public access turned off

  3. In Object Ownership, turn on ACLs and set the ownership that you need.

    ACLs turned on

在 Casdoor 中添加提供商​

  1. In the Casdoor admin console, go to Identity > Providers and add a provider.

  2. Set Category to Storage and Type to AWS S3.

  3. Fill in the fields:

    字段在 AWS / S3 中必需
    Client IDAccess key是
    Client secretSecret access key是
    EndpointEndpoint是
    Endpoint (Intranet)VPC endpoint不
    BucketBucket name是
    Path prefix—不
    DomainCloudFront domain不
    Region IDAWS region是

    For the format of the endpoint, see Website endpoints.

    Amazon S3 provider in Casdoor

  4. Save the provider.

Optional settings​

See also​