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
To connect PocketBase to your S3 bucket, you'll need the following information:
-
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.
- Example:
-
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
- Example:
-
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" }
- Example:
-
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)
- Example:
-
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)
- Example: