Skip to main content
Set each pgw serve setting in an optional YAML file or in an environment variable. To name the file, run pgw serve --config <path>. Without --config, pgw reads config.yaml from the folder where you run it, if it exists. At startup, pgw logs the file that it read, or none.
  • A named file must exist, hold one YAML document, and contain only known keys.
  • Environment variables, from the shell or the .env file, override the file. See The .env file for the order.
  • pgw uses the default only for a key that neither source sets. A key set to 0 keeps that value. A value outside the range stops pgw at startup with a message that names the key.
  • A duration is a number with a unit, such as 100ms, 30s, 10m, or 168h. Write zero as 0s.
  • A list variable, such as PGW_WEBPUSH_HOSTS, takes its entries separated by commas.
  • A true or false variable takes true or false, or 1 or 0.

Network and names

Storage and TLS

Calls

App connections

REGISTER limits and bans

Pushes

Managed mode

Logging

Secrets

These settings have no YAML key. Set them in the shell or the .env file. A configuration file that sets one, such as bootstrap_token, fails as an unknown key.

Push services for testing

These settings send pushes to a mock push service instead of APNs and FCM, so that you can test a client app. They have no YAML key.
Don’t set these variables in production. Every push, with its device token, goes to the named host. pgw logs push services replaced, for testing at startup when any of them is set.

Example

/etc/pgw/config.yaml:
pgw init writes a config.yaml that sets hostname and data_dir and lists every other setting, commented out, with its default.

Next steps

The .env file

Check which source wins when the shell, .env, and the configuration file set the same setting.

Tune the host

Raise the open-file limit before you raise app_max_connections.