What MediaWiki asks of the machine
The documented floor is small: 256 MB of memory and 351 MB of disk for a wiki on one computer, which the project says will not suffice for a busy public wiki or one with uploads.
| Component | What the project documents |
|---|---|
| PHP | 8.3.0 or newer for the 1.46 branch, which runs up to 8.5.x |
| Required PHP extensions | calendar, ctype, dom, fileinfo, iconv, intl, json, mbstring, openssl, sodium, xml, xmlreader |
| Recommended PHP extensions | apcu, curl |
| Database | MariaDB 10.3.0+ (recommended), MySQL 5.7.0+, PostgreSQL 10.0+ or SQLite 3.31.0+ |
| Web server | Apache or Nginx; any major server that runs a compatible PHP |
| Floor for one machine | 256 MB of memory, 351 MB of storage |
What grows is the database, which keeps every revision, and the images/ folder. Size the disk for those.
Pick a branch from the project's version lifecycle page. As this is written, 1.46 is the current stable branch, supported until July 2027, and 1.43 is the long-term support branch, supported until December 2027. Major releases come every six months, with security and bug-fix point releases planned each quarter.
Why a whole server suits a wiki
A wiki feels light until a template edit sets the job queue rebuilding links while a crawler walks every page's history. On a dedicated server every core, all the memory and all the disks are yours, with no other customer on the hardware, so those bursts compete only with your own wiki.
You also get root, which the MediaWiki manuals take for granted: a cron job, PHP upload limits, web-server rules. The port is unmetered, so a page that gets shared everywhere never becomes a bandwidth line on the invoice. The term is month to month.
The server that fits your wiki
- A wiki for one team or project. The compact cartridges are meant for a single job, and a wiki with its database is one job.
- A public wiki with uploads and steady readers. The everyday single-processor servers are what most sites, apps and databases need. Memory can be added later to the machine you already have, without a migration.
- Several wikis, a wiki farm or a very large history. The two-processor servers carry a busy database or a dozen sites without them fighting each other. If the database is the slow part, look at the NVMe dedicated servers.
Rack servers, blades and the m510 and m710x cartridges come with an out-of-band console, the screen and the power button, so a bad firewall rule does not lock you out; other cartridges have power control only. Reinstalls from the control panel are unlimited, and a ready server is handed over within 30 minutes of payment approval.
Up and running in an evening
- Install a web server, MariaDB and PHP with the extensions above from your distribution, checking that its PHP meets your branch's minimum (8.3.0 for 1.46), then download the MediaWiki tarball from mediawiki.org.
- Unpack it with
tar -xzvf mediawiki-*.tar.gz, move the folder into the web server's document root and rename it, for example tow. If you unpacked as root, give the folder to its proper owner withchown -R. - In the MariaDB client, create the database and a wiki-only user with a strong password of your own (statements below). The client logs them, password included, to
.mysql_history: delete and disable that file afterwards. - Open the installer in your browser, for example
/w/index.phpon your domain, and work through it. You create the first administrator account here, so finish it in one sitting rather than leaving a half-installed wiki on a public address. - Download the generated
LocalSettings.phpand put it in the wiki's base folder. It holds the database password in plain text: make it readable by the PHP user, not writable by PHP and not readable by anyone else.
CREATE DATABASE my_wiki;
CREATE USER 'wikiuser'@'localhost' IDENTIFIED BY 'database_password';
GRANT ALL PRIVILEGES ON my_wiki.* TO 'wikiuser'@'localhost' WITH GRANT OPTION;
Never point the wiki at the database root account, and never give its user the FILE privilege or any server-wide right; the security manual names FILE as a common cause of trouble. Tuning the database server itself is covered in our MariaDB server guide.
Close the doors a new wiki leaves open
By default MediaWiki's * group, which means everyone including visitors who are not logged in, holds both edit and createaccount. On a public address that invites spam bots. Decide who should write, then add the matching lines to LocalSettings.php:
# Require an account before editing
$wgGroupPermissions['*']['edit'] = false;
# Only administrators create accounts
$wgGroupPermissions['*']['createaccount'] = false;
# Or keep sign-up open behind a question your readers can answer
wfLoadExtensions([ 'ConfirmEdit', 'ConfirmEdit/QuestyCaptcha' ]);
$wgCaptchaClass = 'QuestyCaptcha';
$wgCaptchaQuestions = [
'What is the name of this wiki?' => $wgSitename,
];
ConfirmEdit ships with MediaWiki and by default asks on sign-up and on edits adding new external links; the project suggests QuestyCaptcha questions of your own, changed often, over its built-in test. Beyond that, $wgEmailConfirmToEdit makes people confirm an email address before editing (it does nothing unless $wgEmailAuthentication is on), AbuseFilter stops edits by rules on account age, user name or added links, and SpamBlacklist refuses edits that add listed URLs.
Email confirmation needs a wiki that can send mail. On our dedicated servers port 25 is open and outbound mail is allowed.
Fast pages: caching and the job queue
Turn on PHP's OPcache, then install APCu, on Debian or Ubuntu with sudo apt-get install php-apcu php-igbinary; MediaWiki finds it without configuration. For a wiki on one server the performance guide's basic object cache is $wgMainCacheType = CACHE_ACCEL; with $wgSessionCacheType = CACHE_DB; and $wgParserCacheType = CACHE_DB;. Past that, Memcached or Redis is the recommended main cache, and a caching proxy such as Varnish suits a large, mostly read wiki.
Background jobs, such as link updates after a template edit and notification emails, run during page views unless you move them. Set $wgJobRunRate = 0; and add the job queue manual's line to the crontab of the user the web server runs as, with your own paths and a log it can write: 0 * * * * /usr/bin/php /var/www/wiki/maintenance/runJobs.php --maxtime=3600 > /var/log/runJobs.log 2>&1. Hourly runs can delay emails by up to an hour; the same manual gives a systemd service that runs jobs continuously.
Uploads that do not become a hole
Uploads are off by default. Switch them on with $wgEnableUploads = true; and check that file_uploads = On in php.ini. PHP's defaults allow 2 MB per file (upload_max_filesize) and 8 MB per request (post_max_size): raise both, raise the web server's own limit (client_max_body_size on Nginx, LimitRequestBody on Apache), and set $wgMaxUploadSize as well past 100 MB.
The folder that receives files, images/ by default, must never run scripts. It ships with an .htaccess that hardens it, which only helps where Apache honours overrides; on anything else, turn off script execution for that folder in the server configuration yourself. Add file types one at a time, for example $wgFileExtensions[] = 'docx';, rather than switching off strict extension checks.
Backups and upgrades you can trust
A backup you can restore is three things taken together: the database, the images/ folder with its deleted files, and LocalSettings.php with your extensions and skins. We keep the hardware and the network running; the wiki and its backups are yours, so copy them off the machine. The backup manual suggests making the wiki read-only while the dump runs:
# In LocalSettings.php while dumping; remove it afterwards
$wgReadOnly = 'Dumping Database, Access will be restored shortly';
# Database (-p asks for the password)
mysqldump -h hostname -u userid -p --default-character-set=charset dbname > backup.sql
# Every page and revision as XML, from the maintenance folder
php dumpBackup.php --full > pagedump.xml
Take the names from LocalSettings.php. The XML dump lacks accounts and logs, so it supplements the SQL dump.
Subscribe to the mediawiki-announce list. A point release needs only new files. For a new branch: run the job queue dry, back up, unpack the release into a new, empty folder (never over the live one), copy LocalSettings.php, images/, extensions and skins across, run php maintenance/run.php update in the new folder, swap the folders and test. Keep the old folder outside the web root until you are sure, so going back is a rename plus restoring the database dump.
When your own server is the wrong answer
A private wiki for a handful of people may not need a whole machine: a Cloud VPS is a Linux virtual machine on a shared server, sold for jobs too small for one of their own (its outbound port 25 is closed by default). And if nobody on your team wants to own PHP, MariaDB and the upgrade cycle, self-hosting is the wrong buy: we do not run your software for you. If a wiki is already running elsewhere, our server migration help costs nothing.
Questions people ask
- Can MediaWiki run without MariaDB or MySQL?
- Yes. PostgreSQL 10 and later and SQLite 3.31 and later are supported, but the installation guide describes their support as limited and suggests them only when necessary. With SQLite the installer tries to keep the database folder outside the document root; if it ends up somewhere the web can read, move it.
- Which release should a new wiki start on?
- One the version lifecycle page lists as current stable, legacy or long-term support; never an unsupported one in production. A long-term branch suits a wiki you want to touch rarely, since 1.43 is supported until December 2027.
- How much memory does a self-hosted wiki need?
- The project documents 256 MB as the floor for one machine and says it will not suffice for a busy public wiki or one with uploads. Real use depends on traffic, extensions and the database, so start with headroom; memory can be added to the same dedicated server later.
- Will a traffic spike or a crawler raise my bill?
- No. Every dedicated server's port is unmetered: no transfer allowance, no overage line.
- Will you install and look after MediaWiki for me?
- No. You get root and install what the job needs; we keep the hardware and the network running. If an install goes wrong, reinstall the operating system from the control panel and start clean.