Deploy MediaWiki

The wiki software behind Wikipedia, on the official image with MySQL

Deploy MediaWiki

Just deployed

/var/lib/mysql

Just deployed

/data

Deploy and Host MediaWiki on Railway

MediaWiki is the free, open-source wiki software that runs Wikipedia. It stores pages in a database, keeps the full revision history of every edit, and supports templates, categories, file uploads, search and thousands of extensions. Teams use it to build documentation sites, knowledge bases and community wikis.

About Hosting MediaWiki

Hosting MediaWiki needs a PHP web server, a MySQL or MariaDB database, and persistent storage for uploads and the LocalSettings.php configuration file. Normally you run a web installer, download the generated LocalSettings.php and copy it to the server. This template does that for you. At first start it runs maintenance/install.php with all bundled extensions, creates an Admin user with a generated password, and keeps settings and uploads on a volume. Every later start runs the database updater, so moving to a newer image migrates the schema. $wgServer follows the Railway domain.

Common Use Cases

  • Internal documentation and team knowledge base
  • Public or community wiki for a product, game or project
  • Private notes wiki with page history and file attachments

Dependencies for MediaWiki Hosting

  • MediaWiki 1.46.2 (official mediawiki Docker image, Apache + PHP 8.3)
  • MySQL 8.4 LTS

Deployment Dependencies

Implementation Details

First login: open the Railway domain and log in as Admin. The password is the MW_ADMIN_PASSWORD variable on the MediaWiki service. Change it under Preferences. The variable is only read on the first start.

Safe by default: anonymous visitors can read but not edit, and only admins can create accounts (Special:CreateAccount). To change that, set these variables on the MediaWiki service and redeploy:

  • MW_ANON_EDIT=true lets logged-out visitors edit pages
  • MW_OPEN_SIGNUP=true lets anyone create an account
  • MW_PRIVATE_WIKI=true hides all pages from logged-out visitors

Other optional variables: MW_SITE_NAME (default My Wiki), MW_ADMIN_USER (default Admin) and MW_LANG (default en) apply to the first start only. If you add a custom domain, set MW_SERVER=https://wiki.example.com.

Storage: LocalSettings.php (it holds the wiki's secret key) and all uploads live on the MediaWiki volume at /data, and pages live in MySQL. Back up both. Email isn't configured, so password-reset mails aren't sent until you add $wgSMTP settings to /data/LocalSettings.php (for example over railway ssh).

Why Deploy MediaWiki on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying MediaWiki on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


Template Content

More templates in this category

View Template
Libredesk - Complete Setup
Complete self-hosted omnichannel customer support desk.

codestorm
2
View Template
Paperless-ngx
Paperless-ngx — document management with OCR and full-text search

INAPP
1
View Template
Instatic CMS - Postgres
Design, build and manage powerful static sites from state-of-the-art CMS

Instatic
168