Deployment guide

MediaWiki

Overview

MediaWiki is the open-source wiki engine that powers Wikipedia and thousands of knowledge bases. It gives teams a collaborative, version-controlled documentation platform with page histories, talk pages, categories, full-text search and a large extension ecosystem.

This SecureAnyCloud image installs MediaWiki 1.43 LTS on a full LAMP stack from the Ubuntu 24.04 repositories: nginx, PHP 8.3-FPM and MariaDB. The entire headless install runs at build time, so there is no web wizard.

What you get:

  • MediaWiki 1.43 LTS served on port 80 by nginx through the PHP 8.3-FPM FastCGI socket, with short article URLs (/wiki/Article_Name)
  • MariaDB on loopback, with its data directory on a dedicated Azure data disk
  • A dedicated Azure data disk at /var/lib/mediawiki for the MariaDB database and the wiki uploads (the images/ directory)
  • A per-VM database password, fresh MediaWiki secret keys and a unique administrator account, all generated on the first boot of every VM
  • nginx.service, php8.3-fpm.service and mariadb.service as enabled, active systemd units
  • 24/7 SecureAnyCloud support

Prerequisites

You need an active Azure subscription, an SSH key pair, and a VNet with a subnet in the target region.

Standard_B2ms (2 vCPU / 8 GiB RAM) is a good starting size.

Configure the network security group (NSG) to allow inbound 22/tcp from your management network and 80/tcp for the MediaWiki web interface. For public exposure, put TLS in front of the wiki (see Enabling HTTPS in Step 10).

Step 1 - Deploy from the Azure Marketplace

Sign in to the Azure Portal, choose Create a resource, search the Marketplace for MediaWiki by SecureAnyCloud, and select Create.

On the Basics tab, pick your subscription, resource group, region and size. Under Administrator account, choose SSH public key and paste your key. Under Inbound port rules, allow SSH (22) and HTTP (80).

Review the dedicated data disk on the Disks tab, then select Review + create and Create.

Step 2 - Deploy from the Azure CLI

Accept the Marketplace terms once per subscription, create the VM, then open port 80.

# Accept the Marketplace terms once per subscription (required before the first CLI deploy)
az vm image terms accept --urn sac1647283583153:mediawiki-ubuntu-24-04:default:latest
az vm create \
  --resource-group <your-rg> \
  --name mediawiki \
  --image sac1647283583153:mediawiki-ubuntu-24-04:default:latest \
  --size Standard_B2ms \
  --admin-username azureuser \
  --ssh-key-values ~/.ssh/id_ed25519.pub \
  --vnet-name <your-vnet> --subnet <your-subnet> \
  --public-ip-sku Standard
az vm open-port --resource-group <your-rg> --name mediawiki --port 80 --priority 1010

Step 3 - Connect to your VM

Connect over SSH with the key you supplied at deployment.

ssh azureuser@<vm-public-ip>

Step 4 - Confirm the LAMP stack is running

On first boot, the VM rotates the MediaWiki database password, regenerates the secret keys, resets the administrator account to a fresh per-VM password, sets the wiki URL to your VM's public IP and starts the stack. Check that all three services are running:

systemctl is-active nginx php8.3-fpm mariadb

All three report active.

Then confirm the component versions and that the wiki Main Page answers on port 80:

php -v | head -1 mariadb --version curl -s -o /dev/null -w 'HTTP %{http_code}\n' http://127.0.0.1/wiki/Main_Page

The Main Page returns HTTP 200.

Step 5 - Retrieve the administrator password

The administrator account is unique to your VM and is generated on first boot. Read the credentials file as root:

sudo cat /root/mediawiki-credentials.txt

The file contains the login (Admin), the wiki URL and a unique password. After your first sign-in, change the password and add an email address in your preferences.

Step 6 - Browse to your wiki

Browse to http://<vm-public-ip>/. The root URL redirects to the canonical Main Page at /wiki/Main_Page.

The image ships with a sample Main Page, so you see a complete wiki immediately rather than a blank page.

Step 7 - Sign in

Browse to http://<vm-public-ip>/index.php?title=Special:UserLogin and sign in with Admin and the password from the credentials file.

Step 8 - Create and edit pages

To create or edit a page, browse to it and choose Edit (or Create). MediaWiki uses wikitext: == Heading == for sections, '''bold''' for bold, [[Page Name]] for internal links and * item for bullet lists. Enter a summary and select Save changes.

Review every edit across the wiki from Special:RecentChanges. Each entry links to the page, the diff and the contributing user. This is the core of MediaWiki's version control.

Step 9 - The dedicated data disk

The MariaDB database and the wiki uploads (the images/ directory) live on a dedicated Azure data disk mounted at /var/lib/mediawiki, separate from the OS disk. This keeps your content independent of the OS image and lets you resize the disk as your wiki grows. Confirm the mount:

df -h /var/lib/mediawiki findmnt /var/lib/mediawiki

Step 10 - Enabling HTTPS

For any public deployment, put TLS in front of MediaWiki. Point a DNS A record at your VM's public IP, then install a certificate with Certbot and its nginx plugin. Run these steps on your VM, substituting your own domain and email address for the example values.

  • Install Certbot: sudo apt-get update && sudo apt-get install -y certbot python3-certbot-nginx
  • Obtain and install a certificate for your domain by running Certbot with the nginx plugin for your-domain.example.com. Supply your contact email when prompted.
  • After issuance, set $wgServer = "https://your-domain.example.com"; in /var/www/mediawiki/LocalSettings.php so that generated links use https://.

Certbot installs a renewal timer automatically, so certificates renew without further action.

Step 11 - Maintenance

  • Updates. The OS continues to receive unattended security updates. To upgrade MediaWiki itself, replace the code tree and run php /var/www/mediawiki/maintenance/run.php update. See the MediaWiki upgrade documentation for details.
  • Backups. Back up the MariaDB wiki database (for example with mysqldump) and the /var/lib/mediawiki/images directory. Together they hold all of your content and uploads.
  • Logs. Web server logs are under /var/log/nginx/. For application-level logs, enable MediaWiki debug logging with $wgDebugLogFile in LocalSettings.php.

Support

This image is maintained by SecureAnyCloud with 24/7 support. For help with the image, contact sales@secureanycloud.com.

MediaWiki is a trademark of the Wikimedia Foundation. SecureAnyCloud is not affiliated with or endorsed by the Wikimedia Foundation or the MediaWiki project.

Deploy on Azure

Launch MediaWiki on Ubuntu 24.04 LTS on Azure with 24/7 support from SecureAnyCloud.

View this image

Need Help?

Our support team is available 24/7.

sales@secureanycloud.com

Deploy on Azure