🧩 Installing Semantic MediaWiki in Docker
15 Nov 2025
Add Semantic MediaWiki to Docker MediaWiki, fix version mismatches and keep it smooth.
- Enable Semantic MediaWiki
In your LocalSettings.php, add:
wfLoadExtension( 'SemanticMediaWiki' );
enableSemantics( 'your_wiki_name' );Run the update script:
php maintenance/update.phpInstall Semantic MediaWiki via Composer:
composer require mediawiki/semantic-media-wiki:"^5.0.2"- Update Docker for latest PHP
After enabling Semantic MediaWiki, update Docker to use the latest PHP (see official Docker images for reference).
Then restart services:
docker compose down
docker compose pull
docker compose up -d --build
- Fix common errors
- Error: Class "SMWDIProperty" not found
Search for references:
grep -R "SMWDIProperty" .
If found → replace with:
\SMW\DIProperty
If not found → update PageForms branch:
cd /var/www/html/w/extensions/PageForms
git pull origin REL1_41
- Error: SMWRequestOptions mismatch
sed -i 's/new SMWRequestOptions()/new \\SMW\\RequestOptions()/g' \
extensions/PageForms/includes/PF_ValuesUtils.php \
extensions/PageForms/specials/PF_CreateTemplate.php
sed -i 's/@param SMWRequestOptions/@param \\SMW\\RequestOptions/g' \
extensions/PageForms/includes/PF_ValuesUtils.php
✅ Your Docker-based MediaWiki now has Semantic MediaWiki configured and ready.
Bonus: Offline Access with Kiwix 🌐💾
Want to access your MediaWiki content offline? Check out Kiwix. Kiwix lets you download and browse Wikipedia, Wikis, and other large knowledge bases without an internet connection. Perfect for workshops, remote locations, or when Wi-Fi disappears mid-edit.