Skip to content

Instantly share code, notes, and snippets.

@nivethan-me
Created June 14, 2025 11:49
Show Gist options
  • Save nivethan-me/2695c13127a539963d7d5f7a9d3c231f to your computer and use it in GitHub Desktop.
Save nivethan-me/2695c13127a539963d7d5f7a9d3c231f to your computer and use it in GitHub Desktop.
Setup AWS S3 with PocketBase for File Storage

Setup AWS S3 with PocketBase for File Storage

This Gist will walk you through setup PocketBase to use an AWS S3 bucket for file storage.

documentation : https://pocketbase.io/docs/files-handling/#storage-options

Understanding the S3 Configuration Parameters

To connect PocketBase to your S3 bucket, you'll need the following information:

  1. Endpoint: The specific service endpoint for your S3 bucket.

    • Example: s3.us-east-1.amazonaws.com
    • Reference: AWS S3 Endpoints
    • Note: This is often derived from your bucket's region.
  2. Bucket: The name of your S3 bucket where files will be stored.

    • Example: dev-geminate-pms-media
    • Reference: AWS S3 Bucket Naming Rules
    • AWS CLI Command: aws s3 ls (lists your buckets)
    • CLI Output Example:
      2024-09-29 19:24:36 bucket-name-1
      2024-11-25 15:35:26 bucket-name-2
      2025-03-04 10:53:26 bucket-name-3
      2025-01-24 11:23:04 bucket-name-4
      
  3. Region: The AWS region where your S3 bucket is located.

    • Example: ap-south-1
    • Reference: AWS S3 Regions
    • AWS CLI Command: aws s3api get-bucket-location --bucket your-bucket-name --profile your-aws-profile
    • CLI Output Example:
      {
          "LocationConstraint": "ap-south-1"
      }
  4. Access Key: Your AWS access key ID. This is part of an IAM user's credentials with appropriate permissions to access the S3 bucket.

    • Example: OAW8CJAL7H4GGD22GCEP
    • Reference: aws_access_key_id (from your AWS IAM user credentials)
  5. Secret: Your AWS secret access key. This is the confidential part of an IAM user's credentials.

    • Example: OShe9nMh4uzceMPqitCOMWxxO0T4l8HzfZkTJITM
    • Reference: aws_secret_access_key (from your AWS IAM user credentials)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment