MCPSERV.CLUB
LibreKB

LibreKB

Self-Hosted

Open-source, self-hosted knowledge base in PHP and MySQL

Stale(68)
50stars
0views
Updated Aug 5, 2025

Overview

Discover what makes LibreKB powerful

LibreKB is a lightweight, self‑hosted knowledge base system written in **PHP 8+** and backed by a **MySQL** database. At its core, it exposes a set of CRUD endpoints for articles, categories, and users while providing a responsive front‑end powered by **Bootstrap** and an admin panel that leverages **TinyMCE** for rich text editing. The application follows a classic Model–View–Controller (MVC) pattern, with the PHP code organized into modules for authentication, article management, and configuration. This structure keeps the core logic isolated from presentation, making it straightforward for developers to extend or replace individual components.

Language & Runtime

Framework

Database

Web Server

Overview

LibreKB is a lightweight, self‑hosted knowledge base system written in PHP 8+ and backed by a MySQL database. At its core, it exposes a set of CRUD endpoints for articles, categories, and users while providing a responsive front‑end powered by Bootstrap and an admin panel that leverages TinyMCE for rich text editing. The application follows a classic Model–View–Controller (MVC) pattern, with the PHP code organized into modules for authentication, article management, and configuration. This structure keeps the core logic isolated from presentation, making it straightforward for developers to extend or replace individual components.

Architecture

  • Language & Runtime: PHP 8.0+ with Composer‑managed dependencies (e.g., TinyMCE, Bootstrap assets).
  • Framework: A custom lightweight MVC framework rather than a full‑stack solution, which keeps the footprint small and eliminates unnecessary abstractions.
  • Database: MySQL (or MariaDB) with a single schema that stores users, groups, articles, and configuration settings.
  • Web Server: Apache or any server that can execute PHP scripts; the .htaccess file handles pretty URLs.
  • Front‑end: Bootstrap 5 for responsive layouts, jQuery for DOM manipulation, and TinyMCE as the WYSIWYG editor.
  • Email: PHP’s mail() function is used for password resets; developers can swap this out with an SMTP library if needed.

Core Capabilities

  • REST‑like API: While the public interface is rendered server‑side, all CRUD operations are available through AJAX calls that return JSON. This allows developers to build SPA front‑ends or integrate LibreKB into existing workflows.
  • User & Group Management: Built‑in role‑based access control lets admins define permissions at the group level (e.g., editors, viewers).
  • Search & Categorization: Full‑text search is implemented via MySQL’s MATCH ... AGAINST, and categories can be nested to arbitrary depth.
  • Extensibility Hooks: The core emits events (article_created, user_registered) that can be listened to by plugins or custom scripts.
  • Webhooks: A configurable webhook endpoint can be set to notify external services on article updates or user registrations.

Deployment & Infrastructure

LibreKB is intentionally minimalistic to run on shared hosting, VPS, or Docker. A single docker-compose.yml is provided in the repository for quick containerization:

services:
  librekb:
    image: librekb/libreKB:latest
    ports:
      - "8080:80"
    volumes:
      - ./data:/var/www/html/data

The application scales horizontally by sharing a MySQL instance and static assets via a CDN. Because it is stateless beyond the database, adding more web‑server replicas behind a load balancer requires only replicating the code base and mounting shared storage for uploads.

Integration & Extensibility

Developers can extend LibreKB in several ways:

  • Plugins: The plugins/ directory contains a simple autoloader. Any PHP file that registers itself with the event system becomes active without modifying core files.
  • Custom API Endpoints: Adding a new endpoint is as simple as creating a controller method and updating the routing table.
  • Theme Override: The templates/ folder can be copied to a custom theme directory, where developers replace Bootstrap classes or add Vue.js components.
  • Third‑Party Auth: By overriding the authentication layer, OAuth or SAML can be integrated with minimal changes.

Developer Experience

The project ships with comprehensive documentation on docs.librekb.com, a dedicated GitHub Discussions forum for questions, and an open‑source license (GPL‑3.0) that encourages community contributions. Configuration is handled via a single config.php file, exposing options such as updateCheck, database credentials, and branding colors. The codebase follows PSR‑4 autoloading conventions, making it IDE-friendly and easy to navigate. Community support is active; pull requests are reviewed promptly, and the issue tracker is used for feature requests and bug reports.

Use Cases

  • Internal Help Desk: Small teams can deploy LibreKB on a shared host to provide self‑service documentation without investing in commercial knowledge‑base platforms.
  • Developer Documentation: Projects that need a lightweight, versioned docs site can use LibreKB’s article system and export capabilities.
  • Customer Support Portals: Companies can brand LibreKB to match their product and expose it as a knowledge hub for end users.
  • Educational Resources: Instructors can host course materials and FAQs, leveraging the category hierarchy for module organization.

Advantages

LibreKB offers a balance of simplicity and flexibility that appeals to developers who want full control over their data. Its lightweight PHP core keeps resource usage low, while the event system and plugin directory enable rapid feature expansion. The GPL‑3.0 license removes vendor lock‑in, and the absence of a “Powered by” watermark ensures a clean professional appearance. Compared to heavier CMS‑based knowledge bases, LibreKB requires fewer dependencies and is easier to audit for security vulnerabilities.

Open SourceReady to get started?

Join the community and start self-hosting LibreKB today

Weekly Views

Loading...
Support Us

Featured Project

$30/month

Get maximum visibility with featured placement and special badges

Repository Health

Loading health data...

Information

Category
other
License
GPL-3.0
Stars
50
Technical Specs
Pricing
Open Source
Database
MySQL
Supported OS
LinuxWindows
Author
michaelstaake
michaelstaake
Last Updated
Aug 5, 2025