Skip to main content

Environment variables

Both the Paybill server and client requires some environment variables to start running.

If you have any questions feel free to join our Discord Community or send us an email at info@paybill.dev.

Paybill server

Paybill host ( required )

variabledescription
PAYBILL_HOSTthe public URL of Paybill client ( eg: https://app.paybill.dev )

Application Secret ( required )

Paybill server uses a secure 64 byte hexadecimal string to encrypt session cookies. You should set the environment variable APP_KEY.

tip

If you have openssl installed, you can run the following commands to generate the value for APP_KEY.

For APP_KEY use openssl rand -hex 64

Database configuration ( required )

Paybill server uses PostgreSQL as the database.

variabledescription
PG_HOSTpostgres database host
PG_DBname of the database
PG_USERusername
PG_PASSpassword
PG_PORTport
tip

If you are using docker-compose setup, you can set PG_HOST as postgres which will be DNS resolved by docker

info

If you intent you use the DB connection url and if the connection does not support ssl. Please use the below format using the variable DATABASE_URL. postgres://username:password@hostname:port/database_name?sslmode=disable

Check for updates ( optional )

Self-hosted version of Paybill pings our server to fetch the latest product updates every 24 hours. You can disable this by setting the value of CHECK_FOR_UPDATES environment variable to 0. This feature is enabled by default.

Marketplace

Enable Marketplace plugin developement mode ( optional )

Use this environment variable to enable/disable the developement mode that allows developers to build the plugin.

variablevalue
ENABLE_MARKETPLACE_DEV_MODEtrue or false

Enable Paybill Database (required)

variabledescription
PB_DBDefault value is paybill_db
PB_DB_HOSTdatabase host
PB_DB_USERdatabase username
PB_DB_PASSdatabase password
PB_DB_PORTdatabase port
tip

The database name provided for PB_DB will be utilized to create a new database during server boot process in all of our production deploy setups. Incase you want to trigger it manually, use the command pnpm db:create on Paybill server.

SENTRY DNS ( optional )

variabledescription
SENTRY_DNSDSN tells a Sentry SDK where to send events so the events are associated with the correct project

SENTRY DEBUG ( optional )

Prints logs for sentry.

variabledescription
SENTRY_DEBUGtrue or false. Default value is false

NODE_EXTRA_CA_CERTS (optional)

Paybill needs to be configured for custom CA certificate to be able to trust and establish connection over https. This requires you to configure an additional env var NODE_EXTRA_CA_CERTS to have absolute path to your CA certificates. This file named cert.pem needs to be in PEM format and can have more than one certificates.

variabledescription
NODE_EXTRA_CA_CERTSabsolute path to certificate PEM file ( eg: /Paybill/ca/cert.pem )

Disable telemetry ( optional )

Pings our server to update the total user count every 24 hours. You can disable this by setting the value of TELEMETRY_ENABLED environment variable to off. This feature is enabled by default.

Paybill client

Server URL ( optionally required )

This is required when client is built separately.

variabledescription
PAYBILL_SERVER_URLthe URL of Paybill server ( eg: https://server.paybill.dev )

Server Port ( optional)

This could be used to for local development, it will set the server url like so: http://localhost:<PAYBILL_SERVER_PORT>

variabledescription
PAYBILL_SERVER_PORTthe port of Paybill server ( eg: 8000 )

Log file path ( Optional )

If a log file path is specified in environment variables, a log file containing all the data from audit logs will be created at the specified path. The file will be updated every time a new audit log is created.

VariableDescription
LOGGER_BASE_PATHthe path where the log file will be created ( eg: storage/logs/)

Configuring the Default Language

To change the default language, set the LANGUAGE variable to your desired language code.

VariableDescription
LANGUAGELANGUAGE_CODE

Available Languages with their codes and native names:

LanguageCodeNative Name
EnglishenEnglish
FrenchfrFrançais
SpanishesEspañol
ItalianitItaliano
IndonesianidBahasa Indonesia
UkrainianukУкраїнська
RussianruРусский
GermandeDeutsch

For instance, to set the language to French, you can set the LANGUAGE variable to fr.

info

The option to set a default language is not available on cloud version of Paybill.