Environment Variables
You can configure Martin using environment variables, but only if the configuration file is not used. The configuration file itself can use environment variables if needed. See configuration section on how to use environment variables with config files. See also SSL configuration section below.
Environment var Config File key | Example | Description |
---|---|---|
DATABASE_URL connection_string | postgresql:// postgres@localhost/db | Postgres database connection |
DEFAULT_SRID default_srid | 4326 | If a PostgreSQL table has a geometry column with SRID=0, use this value instead |
PGSSLCERT ssl_cert | ./postgresql.crt | A file with a client SSL certificate. docs |
PGSSLKEY ssl_key | ./postgresql.key | A file with the key for the client SSL certificate. docs |
PGSSLROOTCERT ssl_root_cert | ./root.crt | A file with trusted root certificate(s). The file should contain a sequence of PEM-formatted CA certificates. docs |
AWS_LAMBDA_RUNTIME_API - | If defined, connect to AWS Lambda to handle requests. The regular HTTP server is not used. See Running in AWS Lambda |
To access PMTiles via S3, we also support the following configuration options:
Environment var Config File key | Example | Description |
---|---|---|
AWS_ACCESS_KEY_ID - | AKIAEXAMPLE12345678 | AWS access key ID used for authenticating requests when using long-term or temporary credentials. |
AWS_SECRET_ACCESS_KEY - | wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY | AWS secret access key paired with the access key ID. |
AWS_SESSION_TOKEN - | FwoGZXIvYXdzEF0aD... | Session token used with temporary security credentials (e.g., from AWS STS). Required if you’re using AssumeRole . |
AWS_PROFILE - | default | Specifies which named profile to use from the AWS credentials/config files. |
AWS_REGION - | us-west-2 | Sets the AWS region to send requests to, e.g., us-east-1 , eu-central-1 . |
AWS_SKIP_CREDENTIALS pmtiles.skip_credentials | true | Disable credential loading and to send requests anonymously for publicly available buckets. Default: true |
AWS_S3_FORCE_PATH_STYLE pmtiles.force_path_style | true | Forces the AWS SDK to use path-style URLs for S3 like s3.amazonaws.com/bucket/key instead of virtual-hosted style. Useful for local S3-compatible services like MinIO. |