Skip to main content
When you finish this page, pgw runs on a server as its own system user, starts at boot, and has its first tenant. If you haven’t seen pgw work yet, run the quickstart first. It takes less time and needs nothing that this page sets up. The install puts files in these places:

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 pgw-linux-amd64, and the SHA256SUMS file from the download page. Then verify the checksum.
Each file that you downloaded shows 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 user:
pgw doesn’t start when the key file’s group or other users have any access.
Back up the master key. Without it, pgw can’t read the credentials that it stored.
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 hostname to start. Create /etc/pgw/config.yaml, and set hostname to the DNS name that apps connect to:
Without 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

When a check fails, the status is 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:
Save the value of 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.