KBilling Docs

Install KBilling on a VPS

Deploy KBilling with Nginx or Apache, PHP-FPM, a dedicated database user and a system cron.

Audience: Linux administratorsTime: 30–45 minutesRequires: root or sudo

Prepare the runtime

Provision PHP 8.2+, PHP-FPM, PDO MySQL, cURL, OpenSSL, JSON, mbstring and a web server. Use MySQL 8+ or MariaDB 10.5+ with InnoDB and utf8mb4. Package names differ between distributions, so verify extensions using the web-facing PHP runtime, not only the CLI binary.

Create an isolated database identity

CREATE DATABASE kbilling CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'kbilling_app'@'localhost' IDENTIFIED BY 'replace-with-a-long-random-password';
GRANT ALL PRIVILEGES ON kbilling.* TO 'kbilling_app'@'localhost';
FLUSH PRIVILEGES;

Deploy files

  1. Create a dedicated virtual-host document root.
  2. Extract the full stable package into that root.
  3. Set files to the web-service account only where KBilling needs to write. Do not make the complete tree world-writable.
  4. Point Nginx or Apache to index.php and deny direct access to configuration, logs, backups and private storage.
  5. Issue a TLS certificate and redirect HTTP to HTTPS.

Complete and verify

Run /install/, create the administrator, then add the cron entry using the same PHP version as the site.

*/5 * * * * /usr/bin/php /var/www/kbilling/crons/cron.php >/dev/null 2>&1
Reverse proxiesConfigure trusted proxy handling deliberately. Never trust arbitrary forwarded IP headers or the authority and API IP allowlists can be bypassed.