MediaWiki Guide — The Wiki Engine Behind Wikipedia
MediaWiki is the wiki engine that runs Wikipedia — one of the most visited websites in the world. Think of it as a living encyclopedia: anyone can create and edit pages, and every change is tracked forever. If WordPress is for blogging and Drupal is for enterprise content, MediaWiki is for collaborative knowledge building.
What You’ll Learn
- MediaWiki’s wiki-based content model and page history
- Writing and formatting pages with wiki markup
- Templates, categories, and namespaces
- Extensions and skin customization
- User permissions and anti-spam measures
Why Wiki-Based CMS Matters
Traditional CMS platforms have one author (or a small team) creating content for readers. MediaWiki inverts this: every reader can be an author. Changes are tracked, reviewed, and reversible. This model powers Wikipedia, but also internal company wikis, documentation sites, and knowledge bases.
DodaTech uses wiki-style documentation internally — every team member can update technical specs, and changes are tracked with full history, similar to how Durga Antivirus Pro maintains its threat documentation.
flowchart LR
A["CMS Overview"] --> B["MediaWiki<br/><strong>You are here</strong>"]:::current
B --> C["Choose Your CMS"]
classDef current fill:#38bdf8,color:#0f172a,stroke-width:2px;
Installation
MediaWiki requires a web server with PHP and a database (MySQL or MariaDB):
# Download the latest version
wget https://releases.wikimedia.org/mediawiki/1.42/mediawiki-1.42.1.tar.gz
tar -xvzf mediawiki-1.42.1.tar.gz
mv mediawiki-1.42.1 /var/www/html/wiki
# Point your browser to https://yourserver/wiki/
# Follow the web installer — it creates the database tables
# and generates a LocalSettings.php configuration fileAfter installation, protect LocalSettings.php — it contains your database password:
chmod 600 /var/www/html/wiki/LocalSettings.phpPage Structure
MediaWiki stores content in a database, not files. Each page has a title (used in the URL) and wikitext content:
https://yourserver/wiki/index.php/Page_TitleEvery page has a history tab showing all revisions:
== Section Heading ==
This is a paragraph with '''bold text''' and ''italic text''.
* Bullet list item
* Another item
# Numbered list item
## Nested item=== Linking Between Pages ===
[[Page Title]] # Link to another wiki page
[[Page Title|display text]] # Link with custom label
[[Category:Tutorials]] # Add page to a categoryTemplates
Templates are reusable wiki snippets stored in the Template: namespace:
{{Infobox software
| name = MyApp
| developer = DodaTech
| latest = 2.0
| license = MIT
}}Call a template with {{TemplateName|param=value}}. Templates can include conditional logic and default parameter values, making them powerful for consistent page layouts.
Namespaces
Namespaces organize different types of content:
| Namespace | Purpose | Example |
|---|---|---|
| Main (no prefix) | Articles | Page_Title |
Talk: | Discussion about an article | Talk:Page_Title |
User: | Personal user pages | User:JohnDoe |
Template: | Reusable wiki snippets | Template:Infobox |
Category: | Content categories | Category:Tutorials |
Help: | Help documentation | Help:Editing |
User Permissions
Configure access in LocalSettings.php:
// Allow anyone to read, require login to edit
$wgGroupPermissions['*']['read'] = true;
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['user']['edit'] = true;
// Create a private wiki (login required for everything)
$wgGroupPermissions['*']['read'] = false;
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['user']['read'] = true;
$wgGroupPermissions['user']['edit'] = true;Extensions
MediaWiki has thousands of extensions. Essential ones:
// VisualEditor — WYSIWYG editing (like WordPress)
wfLoadExtension( 'VisualEditor' );
// Scribunto — Lua scripting for advanced templates
wfLoadExtension( 'Scribunto' );
// Page Forms — Create form-based page creation
wfLoadExtension( 'PageForms' );Install by downloading the extension into extensions/ directory and adding wfLoadExtension() to LocalSettings.php.
Common Mistakes
1. Forgetting to Back Up LocalSettings.php
This file contains your database credentials and all configuration. Without it, your wiki won’t work. Keep a secure backup.
2. Allowing Open Registration Without Anti-Spam
A default MediaWiki install lets anyone register. Add CAPTCHA and email confirmation:
wfLoadExtension( 'ConfirmEdit' );
$wgCaptchaTriggers['edit'] = true;
$wgCaptchaTriggers['create'] = true;
$wgEmailConfirmToEdit = true;3. Ignoring Caching
MediaWiki can be slow without caching. Enable file cache or Redis:
$wgMainCacheType = CACHE_ACCEL; // APCu
$wgMainCacheType = CACHE_REDIS; // Redis
4. Using Rich Text When Plain Text Would Do
Not every page needs complex formatting. Simple wikitext is faster to write, easier to diff, and renders quicker than template-heavy pages.
Practice Questions
What makes MediaWiki different from WordPress? Answer: MediaWiki is built for collaborative content creation. Every page has a full revision history, and anyone can edit. WordPress is built for one-to-many publishing with a single author.
What is a namespace in MediaWiki? Answer: A namespace is a prefix that categorizes pages (e.g.,
Talk:,User:,Template:). Each namespace serves a different purpose and can have different permissions.How do templates work in MediaWiki? Answer: Templates are reusable wiki snippets stored in the
Template:namespace. They are included in pages using{{TemplateName}}syntax and can accept parameters.Challenge: Set up a MediaWiki wiki, create 3 interlinked pages, add a category, and create a template for an infobox with name, version, and license parameters.
FAQ
Try It Yourself
- Install MediaWiki on a local server or hosted environment
- Create a Main Page with links to 3 sub-pages
- Add a category and create a template
- Install the VisualEditor extension
- Configure user permissions to require login for editing
What’s Next
| Topic | Description |
|---|---|
| DokuWiki | Flat-file wiki alternative to MediaWiki |
| WordPress | Blog and traditional CMS platform |
| PHP | Server-side language MediaWiki is built on |
| MySQL | Database engine used by MediaWiki |
| HTML | Understanding wiki output structure |
What’s Next
Congratulations on completing this MediaWiki tutorial! Here’s where to go from here:
- Practice daily — Consistency is more important than long study sessions
- Build a project — Apply what you learned by building something real
- Explore related topics — Check out other tutorials in the same category
- Join the community — Discuss with other learners and share your progress
Remember: every expert was once a beginner. Keep coding!
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro