Overview
Discover what makes MediaWiki powerful
MediaWiki is a robust, open‑source wiki engine written primarily in PHP that powers Wikipedia and thousands of other knowledge bases. From a developer’s perspective, it is an extensible platform that exposes a rich API surface for programmatic interaction while remaining lightweight enough to run on modest shared‑hosting environments. The core of MediaWiki is a well‑structured MVC‑like architecture where PHP classes handle request routing, database abstraction, and template rendering. It uses a MySQL or MariaDB backend (optionally PostgreSQL) via the `Database.php` abstraction layer, enabling developers to swap storage engines with minimal code changes.
RESTful API
Event Hooks
Template System
Internationalization
Overview
MediaWiki is a robust, open‑source wiki engine written primarily in PHP that powers Wikipedia and thousands of other knowledge bases. From a developer’s perspective, it is an extensible platform that exposes a rich API surface for programmatic interaction while remaining lightweight enough to run on modest shared‑hosting environments. The core of MediaWiki is a well‑structured MVC‑like architecture where PHP classes handle request routing, database abstraction, and template rendering. It uses a MySQL or MariaDB backend (optionally PostgreSQL) via the Database.php abstraction layer, enabling developers to swap storage engines with minimal code changes.
Key Features
- RESTful API: Exposes endpoints for querying pages, editing content, retrieving revisions, and handling media uploads. The API supports JSON and XML formats, authentication via OAuth or cookie sessions, and can be extended with custom endpoints through the API‑extension framework.
- Event Hooks: A comprehensive hook system (
$wgHooks) allows developers to inject logic at almost any point in the request lifecycle—e.g., before saving a page, after rendering, or during user authentication. Hooks are implemented as PHP callbacks and can be bundled into extensions. - Template System: Uses a lightweight Twig‑like syntax (
{{ }}) for page templates, enabling developers to create reusable UI components and themes. Themes can be swapped by altering the$wgDefaultSkinvariable. - Internationalization: Built‑in language packs and message files (
.json) make it trivial to localize the UI or add custom messages for extensions.
Technical Stack
| Layer | Technology |
|---|---|
| Runtime | PHP 8.x (recommended), Apache/Nginx or FastCGI |
| Database | MySQL 5.7+, MariaDB, PostgreSQL (via extension) |
| Caching | Memcached or Redis for page caching and session storage |
| Search | Built‑in full‑text search, optionally backed by ElasticSearch or Solr |
| Deployment | Docker images (mediawiki/standalone, mediawiki/apache) and Helm charts for Kubernetes |
The core is distributed under the GPL‑2.0-or-later license, allowing unrestricted modification and redistribution.
Core Capabilities
- Page Revisioning: Every edit creates a new revision with metadata (user, timestamp, comment). Developers can access the full revision history via the API or directly through
RevisionStore. - Structured Data: The “Semantic MediaWiki” extension adds RDF support, enabling SPARQL queries and graph data integration.
- User Management: Role‑based permissions (
$wgGroupPermissions) and OAuth support for single‑sign‑on scenarios. - File Handling: Media uploads are stored on the filesystem or cloud storage; the
FileAPI exposes thumbnails, metadata, and MIME type detection.
Deployment & Infrastructure
MediaWiki can be deployed on any LAMP stack, but for production workloads a typical setup includes:
- Web Server: Nginx or Apache with PHP‑FPM.
- Database Cluster: Read replicas for scaling reads; automatic failover via Galera or Percona XtraDB.
- Cache Layer: Redis for session and page caching; Memcached as an alternative.
- Search Backend: ElasticSearch or Solr for full‑text indexing; optional for smaller sites.
- Containerization: Official Docker images support multi‑stage builds; Kubernetes manifests allow horizontal scaling of stateless web pods while persisting data to a shared volume.
Horizontal scaling is achieved by adding more PHP workers behind the web server and replicating the database. The stateless nature of PHP requests makes it straightforward to add caching layers or CDN front‑ends.
Integration & Extensibility
- Extensions: Thousands of community extensions exist, ranging from UI tweaks (
Vector) to advanced features likeVisualEditor. Extensions are installed by dropping a folder into theextensions/directory and adding an entry to$wgExtensionCredits. - API Extensions: Developers can create custom API modules by extending
ApiBase, exposing new verbs and parameters. - Webhooks: While not native, the
EventBusextension allows integration with external services via HTTP callbacks on events such as page creation or deletion. - Custom Themes: Skinning is achieved by implementing the
Skininterface; developers can create responsive designs or integrate with third‑party CSS frameworks.
Developer Experience
- Documentation: The official developer portal provides comprehensive guides, API references, and extension authoring tutorials. Inline code comments in the source are abundant.
- Community: A vibrant mailing list, IRC channel (
#mediawiki-dev), and GitHub issue tracker ensure rapid support. Security advisories are published promptly. - Configuration: All settings reside in
LocalSettings.php; most can be overridden via$wgvariables or environment‑specific config files. - Testing: MediaWiki ships with PHPUnit tests and a Docker test harness; developers can run
phpunitagainst the core or their extensions.
Use Cases
- Enterprise Knowledge Bases: Integrate with LDAP for authentication and use Semantic MediaWiki to expose structured data to internal dashboards.
- Developer Documentation: Pair with
VisualEditorand the “API” extension to auto‑generate API docs from code comments. - Community Portals: Host localized forums with custom skins and user groups; leverage the event hook system to notify external services on content updates.
- Education Platforms: Use MediaWiki as a collaborative learning environment, with extensions for quizzes and grading.
Advantages
| Aspect | Why MediaWiki
Open SourceReady to get started?
Join the community and start self-hosting MediaWiki today
Related Apps in other
Immich
Self‑hosted photo and video manager
Syncthing
Peer‑to‑peer file sync, no central server
Strapi
Open-source headless CMS for modern developers
reveal.js
Create stunning web‑based presentations with HTML, CSS and JavaScript
Stirling-PDF
Local web PDF editor with split, merge, convert and more
MinIO
Fast, S3-compatible object storage for AI and analytics
Weekly Views
Repository Health
Information
Explore More Apps
µStreamer
Fast MJPEG streaming from V4L2 devices

Citadel
All-in-one collaboration platform with rooms architecture
wallabag
Save web pages for distraction‑free reading anytime, anywhere
Serendipity
Reliable, extensible PHP blog engine for self‑hosted sites
OpenProject
Collaborative project management for secure, on‑premises teams
Plone
Secure, modern CMS built on Python and React