Jump to navigation Jump to search

This page provides a step-by-step instruction how to install a basic version of Wikibase. It just explains the minimal configuration needed for Wikibase. If you're interested in a more advanced configuration, please refer to the advanced configuration guide.



Technically, Wikibase is an extension (actually two extensions) to MediaWiki, so you need to set up MediaWiki first.

Warning Warning: Please be aware that Wikibase is currently not maintaining compatibility with older versions of MediaWiki! A recent version of Wikibase will most likely not work with an older version of MediaWiki. Vice versa an old version of Wikibase may not work with a recent MediaWiki version. Either use the most recent versions of MediaWiki and Wikibase (master branches) or make sure you download the appropriate branch of Wikibase that matches your version of MediaWiki!


The easiest way to install all all dependencies of Wikibase is using Composer. Here you can find installation instructions for Composer.


A basic installation of Wikibase is pretty much straight forward and basically consists of 4 steps:

  1. getting Wikibase
  2. fetching dependencies
  3. modifying LocalSettings.php
  4. running some maintenance scripts.

The following guide will lead you through these steps.

Meet the prerequisites[edit]

Make sure you've set up MediaWiki and installed Composer.

Fresh MediaWiki

Get Wikibase[edit]

Download the version of Wikibase that matches your Mediawiki installation into the extensions folder of your MediaWiki installation. There are several ways to download Wikibase.

Using the wrong version of Wikibase for your Mediawiki installation will result in errors. Be aware that the latest version of Wikibase will not work with Mediawiki version 1.30.0 (latest stable version).

Download from Git[edit]

  • For getting the latest version of Wikibase, do:
cd extensions
git clone
cd Wikibase
git submodule update --init --recursive # get the dependencies using submodules
  • For getting a specific version of Wikibase you have to specify the branch you want to download:
cd extensions
git clone -b REL1_29
Note: REL1_29 branch seems to be broken
  • To install Wikibase for Mediawiki version 1.30.0 (latest stable version) use branch REL1_30.
git clone -b REL1_30

Make sure the folder you just downloaded is called Wikibase and located in extensions/

Download archive[edit]

  • Instead of using Git you can alternatively download an archive with the latest version of Wikibase or choose to download a specific version of Wikibase.
  • Make sure you extract the archive into a new folder called Wikibase inside the extensions folder of your MediaWiki installation.

Fetch all dependencies[edit]

Using the composer-merge-plugin

Include the following into composer.local.json at the root of your mediawiki installation:

  "extra": {
    "merge-plugin": {
      "include": [

and run from the root of your mediawiki installation using just one of these methods:

# if composer is available as a binary
composer install --no-dev
# if you downloaded composer.phar
php composer.phar install --no-dev
# Or use dockerized version (does not require PHP or composer installed)
docker run -it --rm --user $(id -u):$(id -g) -v ~/.composer:/tmp -v $(pwd):/app install --no-dev

Adjust your LocalSettings.php[edit]

Add the following lines to LocalSettings.php of your MediaWiki installation. You have three options, depending on whether you want to enable Wikibase Repository, Wikibase Client or both of them.

Enable Wikibase Repository only[edit]

$wgEnableWikibaseRepo = true;
$wgEnableWikibaseClient = false;
require_once "$IP/extensions/Wikibase/repo/Wikibase.php";
require_once "$IP/extensions/Wikibase/repo/ExampleSettings.php";

Enable Wikibase Client only[edit]

$wgEnableWikibaseRepo = false;
$wgEnableWikibaseClient = true;
require_once "$IP/extensions/Wikibase/client/WikibaseClient.php";
require_once "$IP/extensions/Wikibase/client/ExampleSettings.php";

Enable Wikibase Repository and Wikibase Client[edit]

$wgEnableWikibaseRepo = true;
$wgEnableWikibaseClient = true;
require_once "$IP/extensions/Wikibase/repo/Wikibase.php";
require_once "$IP/extensions/Wikibase/repo/ExampleSettings.php";
require_once "$IP/extensions/Wikibase/client/WikibaseClient.php";
require_once "$IP/extensions/Wikibase/client/ExampleSettings.php";

Run the setup scripts[edit]

Finally, you have to run some maintenance scripts.

For Wikibase Repository and Wikibase Client[edit]

  • Run the database update script of your MediaWiki installation:
php maintenance/update.php
  • Run the script that populates the sites table:
cd extensions/Wikibase
php lib/maintenance/populateSitesTable.php

For Wikibase Repository only[edit]

  • Run
cd extensions/Wikibase
php repo/maintenance/rebuildItemsPerSite.php

For Wikibase Client only[edit]

  • If you want to run a Wikibase Client, you'll also need to run the script that populates the interwiki table:
cd extensions/Wikibase
php client/maintenance/populateInterwiki.php

For Wikibase Repository and Wikibase Client[edit]

cd extensions/Wikibase
php repo/maintenance/rebuildItemsPerSite.php
php client/maintenance/populateInterwiki.php

Verify your installation[edit]

Wikibase Repository[edit]

To verify your Wikibase Repository installation, in your MediaWiki go to Special:NewItem and you should be able to create your first Item. Enter a label and optional description and aliases and hit Create. You should be redirected to the item page.

Special:NewItem special page
Your first item

Wikibase Client[edit]

If you've enabled Wikibase Client and everything is correct, you should see an "Add links" link in the languagelinks section in the sidebar of the main page.

First Item page

For developers[edit]


An easy way to set up a developer environment for Wikibase is to use one of the wikibase_repo or wikidata role in MediaWiki-Vagrant#wikidata. They are set up as plain instances including all dependent components, and provides a quick way to get ready for hacking on Wikibase code. The wikibase_repo role provides a simple environment where there is a single repo instance accessible as (HHVM) or at (PHP5). The wikidata role provides a complex environment where there are both repo and client instances. The English client instance is accessible at (HHVM) and the repo instance is at (HHVM). For the wikibase_repo role the sources of the Wikibase extension can be found under /mediawiki/extensions/Wikibase and sources of dependent components are under /mediawiki/extensions/Wikibase/vendor, while for the wikidata role the sources are under /mediawiki/extensions/WikidataBuildResources/extensions.


This repository contains an example docker compose file and docker images. Following these instructions, you'll be able to install a stand-alone instance of Wikibase – the collaborative structured data engine behind Wikidata – as well as fully functional SPARQL endpoint and query service, complete with a data visualization frontend and query helper (similar to the Wikidata Query Service).


There are not so many languages I can set labels for in a new item[edit]

Make sure you installed Extension:UniversalLanguageSelector

There are no sites I can set in a new item[edit]

One or more of the following may help:

php lib/maintenance/populateSitesTable.php
php repo/maintenance/rebuildItemsPerSite.php