Local development quickstart

This page is a quickstart guide to setting up a local development for MediaWiki using PHP and Composer.

1. Install prerequisites
MediaWiki requires PHP 7.4.3+ and Composer 2.

Linux
On Ubuntu 22+ or Debian 11+, install the required packages using APT.

On Ubuntu 20, install PHP from APT, but install Composer from getcomposer.org/download.

On Fedora 35+, install the required packages using DNF.

Mac
Install the required packages using Homebrew.

Windows
You have the option to use the Windows Subsystem for Linux and follow the Linux instructions on this page. Or, to install MediaWiki directly on Windows, install the required packages using Chocolatey.

To load the required PHP extensions, edit your php.ini file, and uncomment the following lines. To find the location of php.ini, run, and look for Loaded Configuration File.

2. Clone MediaWiki
Use Git to clone the MediaWiki core repository and the default skin.

Cloning MediaWiki takes a few minutes. While you're waiting, create a Wikimedia developer account if you don't already have one.

3. Install dependencies
From within MediaWiki's root directory, use Composer to install MediaWiki's dependencies.

4. Install MediaWiki
Install MediaWiki with PHP's built-in SQLite database.

5. Start server
Start PHP's built-in webserver, and open localhost:4000 in a browser to see your MediaWiki instance. To log in as an administrator, use username Admin and password adminpassword.

Next steps

 * Take a tour of the MediaWiki codebase – Familiarize yourself with MediaWiki's core code by learning about entry points and top-level directories.
 * Run unit tests – MediaWiki uses the PHPUnit framework for unit and integration testing of PHP code. Read the docs to run tests and find information about writing tests.
 * Install extensions – Add extensions, like VisualEditor and Echo, to your development environment. See Manual:Developing extensions to learn about how extensions work.
 * Debug your code – Learn how to configure debugging aids, and debug MediaWiki code step-by-step with XDebug.
 * Submit a patch – Explore good first bugs, and set up access to Wikimedia Gerrit to submit a patch.