Choose a development context
Releasev0.35.0 · cfeceb67
A context has its own configuration, Compose project, containers and volumes. Use contexts for separate environments, such as two MediaWiki checkouts. This is separate from a Docker context, which selects the Docker daemon.
Select a context for one command
Section titled “Select a context for one command”mw dev --context work mediawiki createmw dev --context work compose psmw dev --context work whereThe first command runs the usual setup for the work context. Choose a different HTTP port if another environment is already using the default port; see ports.
Select a context for a shell
Section titled “Select a context for a shell”export CONTEXT=workmw dev compose psmw dev --context other compose psunset CONTEXTAn explicit --context overrides CONTEXT. With neither set, the CLI uses default. CONTEXT is a shell environment variable, not a persisted mw config setting.
Keep configuration separate
Section titled “Keep configuration separate”Use the same context when changing settings and starting services:
mw dev --context work env set PORT 8088mw dev --context work mediawiki createContexts do not copy source code. If two contexts mount the same checkout, they share files such as LocalSettings.php, extensions and uploaded files stored in that checkout. Choose separate checkouts when you need independent source or settings.
To select a different Docker daemon, use Docker’s own docker context use or DOCKER_CONTEXT. That setting and the CLI’s --context can be used together.
Read this guide offline with mw help guides dev contexts.
Page views: —Sessions: —