Before you begin
-
A 64-bit Linux host, amd64 or arm64, with systemd, a public IP address, and a DNS name, such as
pgw.example.com. -
These ports open on the host:
- A PBX that the host can reach.
Install pgw
1
Download and check the binary
Download the binary for your platform, such as Each file that you downloaded shows
pgw-linux-amd64, and the SHA256SUMS file from the download page. Then verify the checksum.OK.2
Install the binary
3
Create the user and folders
pgw needs no root rights, so give it a system user of its own. That user owns the data folder and can read the configuration folder:
4
Create the master key
pgw encrypts the push credentials and SIP passwords in its database with the master key, 32 random bytes in base64. Anyone who has the key file and the database can read those secrets, so make the key file readable only by the pgw doesn’t start when the key file’s group or other users have any access.
pgw user:5
Create the bootstrap token
The bootstrap token is the server’s own password. It authorizes the few commands that belong to no tenant: creating the first tenant, reloading the certificate, and managing bans. It must have at least 32 characters:
6
Create the configuration file
Besides the master key, pgw needs only its Without
hostname to start. Create /etc/pgw/config.yaml, and set hostname to the DNS name that apps connect to:tls_cert_file and tls_key_file, pgw serves a self-signed certificate, which apps reject. You install a certificate after the first start.7
Start pgw
Create the systemd unit and start pgw, as described in Run pgw under systemd. Then run
journalctl -u pgw. The log shows serving a self-signed certificate, which apps reject, and then pgw ready with the addresses that pgw listens on. Without pgw ready, the log’s last line says why pgw didn’t start.8
Check that pgw is ready
503 and the body names the failed check.Create the tenant
A tenant is your workspace in pgw, and every later command authenticates with its API key.pgw bootstrap creates the tenant and prints the key once. pgw stores only a hash of it, so you can’t read it again. These commands put the key in PGW_API_KEY for this shell:
PGW_API_KEY somewhere safe before you close the shell.
pgw bootstrap works once. After a tenant exists, it fails:
Next steps
Install a TLS certificate
Replace the self-signed certificate, which apps reject.
Configure apps for pgw
Register your app’s push credentials, so that its devices can register through pgw.