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.

Ubuntu/Debian

On Ubuntu 22+ and Debian 11+, you can install the required packages using APT.

On Ubuntu 20, install PHP using apt, and install Composer 2 using the documented process.

Fedora

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

Mac

You can install the required packages using Homebrew.

Windows

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

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.

If you already have an SSH key set up for Wikimedia Gerrit, clone MediaWiki using SSH. If not, you can clone the repository using HTTPS and set up an SSH key once you're ready to submit a patch.

Cloning MediaWiki takes a few minutes. While you're waiting, create a Wikimedia developer account if you don't already have one, and get started setting up Wikimedia Gerrit.

Using SSH

Using HTTPS

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 to see your MediaWiki instance.

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 Visual Editor 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.