Skip to content

Self-host MediaWiki

updated Sep 2026prices checked · Jul 2026Install verified on Ubuntu 26.04 · Sep 2026 · how we test
We earn commissions when you shop through the links below. Full disclosure →

The PHP wiki engine behind Wikipedia, licensed GPL-2.0-or-later and built for large public knowledge bases: wikitext markup, categories, templates, full revision history, and a vast extension ecosystem. It runs on MariaDB/MySQL (recommended), PostgreSQL, or SQLite, and its own documentation recommends no Docker image for third-party production use — the Docker Hub image is community-maintained and the install still ends with you saving a generated LocalSettings.php.

Key facts

CategoryWiki & docs
LicenseGPL-2.0-or-later
StackPHP, MariaDB
Min RAM512 MB
Official imageno
Measured idle RAM106 MB
Difficulty
Our recommendation

Pick MediaWiki when you are building a public, encyclopedia-shaped knowledge base — categories, templates, full revision history, wikitext markup and the largest extension ecosystem of any wiki — and you are comfortable operating a classic PHP + MariaDB application. For a small team's internal docs it is more machinery than you need; BookStack or DokuWiki get you there with far less to run.

What you need

  • Any VPS with at least 512 MB of RAM
  • A domain you control — most self-hosted setups need HTTPS in front of them
  • About an afternoon — budget time for troubleshooting
Where to host itaffiliate disclosure
Hetzner Cloudrun it on
From $23.59/mo · 2 vCPU / 4 GB / 80 GB · EU + US
Get Hetzner Cloud (opens in new tab)
Kamaterafree trial
From $4/mo · 1 vCPU / 1 GB / 20 GB · US + EU + Asia
Start free on Kamatera → (opens in new tab)
DigitalOceanalso works on
From $6/mo · 1 vCPU / 1 GB / 25 GB · US + EU + Asia
Deploy on DigitalOcean → (opens in new tab)

Paid link — we earn a commission if you shop through it.

Install

Run these commands on your server:

# MediaWiki — the community-maintained Docker Hub image with MariaDB (no image is recommended by upstream for production)
mkdir -p mediawiki && cd mediawiki
cat > docker-compose.yml <<'EOF'
services:
  mediawiki:
    image: mediawiki:1.46
    restart: unless-stopped
    ports: ["8080:80"]
    depends_on: [database]
    volumes:
      - images:/var/www/html/images
      # after the web installer, save LocalSettings.php next to this file and uncomment:
      # - ./LocalSettings.php:/var/www/html/LocalSettings.php
  database:
    image: mariadb
    restart: unless-stopped
    environment:
      MYSQL_DATABASE: my_wiki
      MYSQL_USER: wikiuser
      MYSQL_PASSWORD: change-me
      MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
    volumes: ["db:/var/lib/mysql"]
volumes:
  images:
  db:
EOF
docker compose up -d   #  →  http://SERVER_IP:8080  — run the installer (DB host: database), download LocalSettings.php, mount it, restart

What you take on

MediaWiki is battle-tested, but it is the least turnkey install in this hub:

non-negotiablemediawiki.org states that no official Docker image is recommended for hosting a third-party production instance and calls the Docker Hub image unofficial, used at your own risk; that image is maintained by the MediaWiki and Docker communities rather than by Wikimedia's release process.
non-negotiableThe install is two-phase: run the web installer, download the generated LocalSettings.php, mount it into the container and restart. Until you do, the wiki is not configured.
non-negotiableThe image ships only the PHP extensions MediaWiki core needs (plus ImageMagick, so thumbnailing works); Docker Hub says it does not include extensions required by popular plugins — those mean building your own image FROM this one.
non-negotiableUpstream's recommended minimum is 256 MB of RAM for a single-computer website — web server, PHP and database together — and it says that will not suffice for a busy public site or one with uploads enabled. Our 512 MB floor adds headroom over that figure for the two-container setup; it is our margin, not a documented number.

An alternative to

Head-to-head

More in Wiki & docs

We use analytics cookies (Google Analytics, PostHog) to see which guides are useful. No ad networks, no cross-site tracking. See our privacy policy.