Cli/guide/Docker-Development-Environment/First-Setup

mwcli contains a MediaWiki-Docker-Dev like developer environment.

If you haven't used this development environment before, then this is the guide for you!

If you already have a LocalSettings.php file from a previous developer environment, see the LocalSettings.php section below before starting.

MediaWiki services
You can get started with a basic MediaWiki installation, first creating the needed services.

You will be guided through a setup wizard that covers:


 * What port you want the development environment to run on.
 * Where you want the MediaWiki code to be stored (You can choose an existing directory)
 * If you want to clone MediaWiki code, if it doesn't already exist in the selected directory.
 * If you want to clone the Vector skin, if it doesn't already exist.
 * If you want to clone from Github for extra speed (remote will be set to Gerrit after).
 * If you want to do a shallow clone for extra speed.
 * How you want to interact with Gerrit in the future via git (ssh or http).

At which point the wizard will either clone some code, or fail.

Once completed you should be able to see a few running services

with output that looks something like this:

Database
mwcli enables the use of multiple different databases, but for the purposes of the first setup guide, we will focus on MySQL.

You can start a MySQL service that MediaWiki can use with the following command:

You should again be able to see some new services running:

Don't worry about the mysql-replica service that has exited, this is to be expected.

MediaWiki installation
The development environment automatically sets various MediaWiki settings, such as database details. In order to do this, it needs a "shim" at the top of your LocalSettings.php file.

When starting with a fresh install this will be created by the setup wizard as part of the installation step.

If you have an existing LocalSettings.php please read this guide (LINK TODO)

Install MediaWiki with a mysql backend using the following command:

This will:


 * As you about creating a LocalSetting.php file if needed
 * Run a composer install if needed
 * Run the MediaWiki install.php to create database tables
 * Run the MediaWiki update.php to perform any other needed updates

After completion, you should see some output that will guide you to the wiki.

You can then navigate to your site