Project:Development environments

This page coordinates the documentation of MediaWiki development environments on MediaWiki.org.

Key pages

 * Main off-wiki page for setting up a development environment
 * Only covers MediaWiki-Docker: "an extendable local development environment based on Docker Compose. This environment provides PHP, Apache, Xdebug and a SQLite database"
 * Links to How to become a MediaWiki hacker
 * Not translatable
 * Next steps after setup:
 * Shell into container
 * Run PHPUnit tests
 * Run Selenium tests
 * Run API integration tests
 * Install Vector skin
 * Install EventLogging extension
 * Run Xdebug

How to become a MediaWiki hacker
 * Main on-wiki page for setting up a development environment, via Developer hub
 * Covers how to "learn the basic skills needed to contribute to development"
 * Covers these options:
 * MediaWiki Docker: "setup a MediaWiki installation quickly and are not planning on installing many extensions."
 * mwcli: "sets up Docker with a few simple commands and provides basic orchestration functionality between MediaWiki, MySQL, ElasticSearch, Memcached, and other types of containers"
 * MediaWiki Vagrant: "saves you installation and configuration time compared to manually adding extensions in a Docker or local installation, but it runs a bit slower"
 * Local installation: "will take much more time to set up than Docker or Vagrant"
 * Links to (among others):
 * Manual:How to debug
 * Manual:Unit testing
 * Gerrit/Tutorial

MediaWiki-Docker
 * Subpages
 * Includes extension-specific subpages, such as MediaWiki-Docker/Extension/VisualEditor, which partially duplicates instructions from extension pages, such as Extension:VisualEditor
 * |MediaWiki-Docker/Extension/ContentTranslation|MediaWiki-Docker/Extension/CentralAuth|MediaWiki-Docker/Extension/VisualEditor|MediaWiki-Docker/Extension/WikibaseMediaInfo|MediaWiki-Docker/Extension/Citoid Comparison of pageviews for some extension subpages
 * Instructions for using a database other than SQLite: MediaWiki-Docker/Configuration_recipes/Alternative_databases

Related pages:
 * Download
 * Software bundles
 * Manual:System administration
 * Manual:FAQ
 * Comparison of distribution options
 * Template:InstallationNav

Cloning MediaWiki core
Requires:
 * git

MediaWiki Docker
Setup time: ~15 minutes

Requires:
 * 
 * Docker Desktop (proprietary) or Docker Engine (Linux only)

mwcli
Requires:
 * 
 * Docker Desktop (proprietary) or Docker Engine (Linux only)
 * gitlab:releng/cli

MediaWiki Vagrant
Setup time: ~20 minutes

Requires:
 * 
 * VirtualBox
 * Vagrant
 * NFS (Linux)
 * Cloning mediawiki/vagrant

Local installation (manual)
Requires:
 * 
 * web server
 * PHP
 * database server

[Experimental] Local installation (quickstart)
Requires:
 * 
 * PHP
 * Composer

Install PHP
The latest MediaWiki requires PHP 7.4.3+.

Mac:

PHP has come preinstalled on Mac since 2001, otherwise it can be installed using Homebrew.

Linux:

To install PHP 7.4.3+ on Ubuntu versions prior to 20, use a personal package archive such as.

Install composer
Mac:

Linux:

To install Composer 2 on Ubuntu versions prior to 22, use the documented process.

Install MediaWiki
This command is a pre-configured alias for, via.

Start webserver
This command is an alias for, via. At this point, users can view their local MediaWiki instance running at http://localhost:4000, with the fallback skin.

Installing a skin
Updating LocalSettings.php must be done after installing MediaWiki.

Developer Satisfaction Survey/2023/Developer environments

 * "My biggest issue with our dev environments is the fragmentation"
 * Comments about dev environment documentation: negative:6; positive: 0
 * "Ease of use" was the number one priority for dev environments. The most common "other" priority was using a debugger. In contrast, portability was ranked low as a priority.
 * 57 people reported using a Docker-based environment, while 45 people reported using a "self-created environment".