Download MediaWiki
You can obtain MediaWiki by cloning the Git repository or downloading a release archive.- Git (Gerrit)
- GitHub Mirror
- Release Archive
The canonical source is Wikimedia’s Gerrit instance:
Install Dependencies with Composer
MediaWiki uses Composer to manage its PHP dependencies. If you cloned from Git, you must runcomposer install before the wiki will work.
require section of composer.json into the vendor/ directory, and registers the MediaWiki\Composer\ autoloader.
The
pre-install-cmd hook runs MediaWiki\Composer\VersionChecker::onEvent to validate your PHP version before installation proceeds. If your PHP version is below 8.2.0, Composer will abort with an error.Run the Installer
Choose between the web-based installer and the CLI installer.Web-Based Installer
Place files on your web server
Copy or move the MediaWiki directory into your web server’s document root (e.g.
/var/www/html/wiki).Open the installer in your browser
Navigate to your wiki’s URL. If
LocalSettings.php does not yet exist, MediaWiki automatically redirects to the setup wizard at mw-config/index.php.Fill in the form with your database credentials, wiki name, and administrator account details.Download LocalSettings.php
At the end of the wizard, MediaWiki generates a
LocalSettings.php file for you to download. Place this file in the root of your MediaWiki installation.CLI Installer
Themaintenance/install.php script provides a fully scriptable installation path. It is invoked via the maintenance/run.php dispatcher:
MyWiki) and the admin username (Admin).
Full list of CLI options:
| Option | Default | Description |
|---|---|---|
--server | http://localhost | Base URL of the web server |
--scriptpath | /<dirname> | Relative path of the wiki in the URL |
--lang | en | Wiki content language |
--dbtype | mysql | Database type (mysql, postgres, sqlite) |
--dbserver | localhost | Database host name or IP |
--dbport | 5432 | Database port (PostgreSQL only) |
--dbname | my_wiki | Database name |
--dbpath | $IP/data | Path for the SQLite database file |
--dbprefix | (none) | Optional table name prefix |
--installdbuser | root | DB user used for the install step |
--installdbpass | (none) | Password for the install DB user |
--dbuser | wikiuser | DB user for normal wiki operations |
--dbpass | (none) | Password for the normal wiki DB user |
--dbpassfile | (none) | Read --dbpass from a file |
--pass | (required) | Administrator account password |
--passfile | (none) | Read --pass from a file |
--confpath | $IP | Directory to write LocalSettings.php into |
--dbschema | mediawiki | PostgreSQL schema name |
--with-extensions | (flag) | Detect and include installed extensions |
--extensions | (none) | Comma-separated list of extensions to enable |
--skins | (all) | Comma-separated list of skins to enable |
--with-developmentsettings | (flag) | Load DevelopmentSettings.php from LocalSettings.php |
--env-checks | (flag) | Run environment checks only, make no changes |
SQLite Quick-Install (Development)
Thecomposer.json scripts section includes a one-command SQLite install for local development:
cache/. The wiki is served at http://localhost:4000 with an empty script path.
Start the Development Server
After installing, start PHP’s built-in web server with:http://localhost:4000.
The built-in PHP server is for development only. For production, use Apache or Nginx.
Docker (Development)
Adocker-compose.yml is provided for containerized development. It uses Wikimedia’s official PHP 8.3 FPM image with an Apache frontend:
- Wiki served at
http://localhost:8080 - Database: SQLite stored at
/var/www/html/w/cache/sqlite - Admin credentials:
Admin/dockerpass - Log directory:
/var/www/html/w/cache
mediawiki-jobrunner service handles background job processing.