PMTiles can be accessed directly from AWS S3 or S3-compatible storage (e.g., MinIO, DigitalOcean Spaces) using s3:// URLs.
Supported URL Formats:
- AWS S3:
s3://bucket-name/path/to/file.pmtiles - S3-compatible:
s3://endpoint-url/bucket-name/path/to/file.pmtiles
Authentication:
TileServer-GL uses the standard AWS credential chain:
- Environment variables:
AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION - AWS credentials file:
~/.aws/credentials (Linux/macOS) or C:\Users\USERNAME\.aws\credentials (Windows) - IAM roles (on EC2, ECS, or Lambda)
Configuration in config.json:
When defining S3 sources in the data section, use configuration properties for better control. These take precedence over URL query parameters.
| Property | Description |
|---|
s3Profile | Specifies the AWS credential profile to use. |
s3Region | Specifies the AWS region. Default: us-east-1. |
requestPayer | Enables "requester pays" buckets (boolean). Default: false. |
s3UrlFormat | Specifies how to interpret S3 URLs (e.g., aws). |
Using S3 in Style JSON:
When referencing S3 sources inside a style JSON, you must use the pmtiles:// prefix followed by the S3 URL. You can only use URL query parameters for configuration in style JSON (properties like s3Profile are not supported here).
// Recommended: Using configuration properties in config.json
"data": {
"us-west-tiles": {
"pmtiles": "s3://prod-bucket/tiles.pmtiles",
"s3Profile": "production",
"s3Region": "us-west-2"
}
}
// Using S3 in Style JSON (via query parameters)
"sources": {
"aws-tiles": {
"url": "pmtiles://s3://my-bucket/tiles.pmtiles?profile=production",
"type": "vector"
}
}