Table of Contents
Wikibase
Wikibase is a data repository for Mediawiki.
There are two main methods of installation
- As a Mediawiki extension
Mediawiki extension
Visit the download page and fetch the correct version.
This guide details the steps required to install the extension which is also outlined below with Mediawiki 1.43.
Extract
Enter the mediawiki installation directory and extract the archive into the extensions directory
cd /var/www/htdocs/www.examle.com/w tar zxvf ~/Wikibase-REL1_43-XXXXXXX.tar.gz -C extensions chown -R www-data:www-data extensions/Wikibase
Composer
From the mediawiki directory run composer. Composer ought to have been installed setting up Mediawiki.
rm -f composer.lock composer install --no-dev
Settings
Update the LocalSettings.php file to enable the extension.
wfLoadExtension('WikibaseRepository', "$IP/extensions/Wikibase/extension-repo.json");
require_once "$IP/extensions/Wikibase/repo/ExampleSettings.php";
Maintenance
Run the initial maintenance scripts to build the database tables to prepare the site.
php maintenance/run.php update php maintenance/run.php ./extensions/Wikibase/lib/maintenance/populateSitesTable.php php maintenance/run.php ./extensions/Wikibase/repo/maintenance/rebuildItemsPerSite.php php maintenance/run.php populateInterwiki
Wikibase docker deployment
This setup requires a modern version of docker to be installed and was tested on Debian bookworm on a dual core VM with 12GB of RAM.
Fetch
git clone https://github.com/wmde/wikibase-release-pipeline
Copy config
ln -s wikibase-release-pipeline/deploy cd deploy cp template.env .env
Edit config
vi .env
METADATA_CALLBACK=false # Public hostname configuration. WIKIBASE_PUBLIC_HOST=wikibase.example.com WDQS_PUBLIC_HOST=query.example.com # MediaWiki / Wikibase user configuration. MW_ADMIN_NAME=username MW_ADMIN_EMAIL=email@example.com MW_ADMIN_PASS=changemetoatleast10chars # MediaWiki / Wikibase database configuration. DB_NAME=dbname DB_USER=dbuser DB_PASS=changemetoatleast10chars
Run
All the following are executed within the deploy directory.
Foreground
First run in foreground.
docker compose up
Wait until install process is complete and press d to detach.
Close down the deployment.
docker compose down
Closing is needed to allow us to fix the configuration and is absolutely necessary if you have configure IPv6 (see below).
Fix
A recent bug will write config files as the root user.
sudo chown -R $USER:$GROUP config/
Restart
Restart the docker and everything should work as normal with LocalSettings and IPv6 if required.
docker compose up
Apply the wdqs fix below.
Misc
Update
docker compose up --pull always
Background
docker compose up --detach
Stop
docker compose down
Query
Example
PREFIX wd: <https://wikibase.example.com/entity/>
SELECT * WHERE {
wd:Q1 ?p ?o
}
BUG
After inserting data into an empty instance the query engine will need to be synchronised due to a bug, the following script has been provided.
#! /bin/sh # Stop the stock updater docker compose stop wdqs-updater # Start an updater with force sync settings docker compose run --rm wdqs-updater /wdqs/runUpdate.sh -h http://\$WDQS_HOST:\$WDQS_PORT -- --wikibaseUrl \$WIKIBASE_SCHEME://\$WIKIBASE_HOST --conceptUri \$WIKIBASE_CONCEPT_URI --entityNamespaces \$WDQS_ENTITY_NAMESPACES --init --start $(date +%Y%m%d000000) # As soon as you see "Sleeping for 10 secs" in the logs, press CTRL-C to stop it again # Start the stock updater again docker compose start wdqs-updater
Delete
Special:Nuke
Settings
vi LocalSettings.php
Eg.
# Disable reading by anonymous users #$wgGroupPermissions['*']['read'] = false; # Disable anonymous editing $wgGroupPermissions['*']['edit'] = false; # Prevent new user registrations except by sysops $wgGroupPermissions['*']['createaccount'] = false;
The entrypoint copies the settings file in config into the working directory at start up.
Proxy
Restart proxy if it fails to connect to Wikibase
docker compose restart traefik
Uninstall
docker compose down --volumes
rm -vf config/{LocalSettings.php,wikibase-php.ini,wdqs-frontend-config.json}
IPv6
Setting up wikibase with IPv6 is undocumented, but the following works:
/etc/docker/daemon.json
{
"ipv6": true,
"fixed-cidr-v6": "fd00:db8:1::/64",
"ip6tables": true,
"experimental": false,
"registry-mirrors": ["https://registry.ipv6.docker.com"],
"dns": ["2001:4860:4860::8888", "2001:4860:4860::8844"]
}
6.0.0
docker-compose.yml.diff-
--- docker-compose.yml.orig 2026-03-02 06:51:41.443108398 +0000
+++ docker-compose.yml 2026-03-02 06:04:51.862305459 +0000
@@ -165,9 +165,9 @@
# enable accesslog
- "--accesslog.format=common"
# http endpoint
- - "--entrypoints.web.address=:80"
+ - "--entrypoints.web.address=[::]:80"
# https endpoint
- - "--entrypoints.websecure.address=:443"
+ - "--entrypoints.websecure.address=[::]:443"
- "--entrypoints.websecure.asdefault"
- "--entrypoints.websecure.http.tls.certresolver=letsencrypt"
# http to https redirect
@@ -189,8 +189,8 @@
# - "--log.level=DEBUG"
restart: unless-stopped
ports:
- - 80:80
- - 443:443
+ - "[::]:80:80"
+ - "[::]:443:443"
# traefik dashboard
# - 8080:8080
volumes:
@@ -210,3 +210,11 @@
quickstatements-data:
# C. REVERSE PROXY AND SSL SERVICES DATA
traefik-letsencrypt-data:
+
+networks:
+ default:
+ enable_ipv6: true
+ ipam:
+ driver: default
+ config:
+ - subnet: "fd00:db8:2::/64"
7.0.0
docker-compose.override.yml
services:
mysql:
healthcheck:
interval: 24h
start_interval: 20s
start_period: 1m
wikibase:
links:
- mysql
healthcheck:
interval: 24h
start_interval: 10s
start_period: 5m
elasticsearch:
healthcheck:
interval: 24h
start_interval: 10s
start_period: 2m
wdqs:
healthcheck:
start_interval: 10s
start_period: 2m
wikibase-jobrunner:
healthcheck:
interval: 24h
start_interval: 10s
start_period: 5m
quickstatements:
healthcheck:
interval: 24h
start_interval: 10s
start_period: 2m
networks:
default:
enable_ipv6: true
ipam:
driver: default
config:
- subnet: "fd42:0002:0002::/64"
driver_opts:
com.docker.network.bridge.name: "wikibase"
com.docker.network.bridge.enable_icc: "true"

