MediaWiki, the software behind Wikipedia, is a solid choice for an internal knowledge base, product documentation or a community wiki. Softaculous installs it on cPanel hosting in a few minutes. Most of its configuration lives in one file, LocalSettings.php, so this guide shows the key lines to change.
Before you start
- A subdomain such as
wiki.example.comwith a valid SSL certificate. - A supported PHP version with
intl,mbstring,xmlandfileinfoenabled in Select PHP Version. - Decide who may read and edit: everyone, registered users, or only invited staff.
Install MediaWiki
- Open cPanel → Software → Softaculous Apps Installer, search for MediaWiki (category Wikis) and click Install.
- Installation URL:
https://, the subdomain, empty directory. - Set the wiki name, admin username and a strong password.
- Click Install, then open the wiki and log in.
Lock down editing
A public wiki that anyone can edit attracts spam within days. Open LocalSettings.php in the wiki folder with File Manager and add at the end:
Only logged-in users can edit:
$wgGroupPermissions['*']['edit'] = false;Disable open registration (admins create accounts):
$wgGroupPermissions['*']['createaccount'] = false;For a private internal wiki, also block reading for anonymous visitors:
$wgGroupPermissions['*']['read'] = false;
$wgWhitelistRead = [ 'Special:UserLogin' ];Create user accounts at Special:CreateAccount while logged in as admin.
Tip: For an extra layer, protect the whole subdomain with Directory Privacy so only your team can even reach the login page.
Enable file uploads
$wgEnableUploads = true;
$wgFileExtensions = [ 'png', 'jpg', 'jpeg', 'gif', 'webp', 'pdf' ];Uploads are stored in the images folder and count toward your disk quota. The maximum size follows PHP's upload_max_filesize.
Password resets and watchlist notifications need working email. Set the sender and SMTP in LocalSettings.php:
$wgEmergencyContact = 'wiki@example.com';
$wgPasswordSender = 'wiki@example.com';
$wgSMTP = [
'host' => 'ssl://server-hostname',
'IDHost' => 'example.com',
'port' => 465,
'auth' => true,
'username' => 'wiki@example.com',
'password' => 'MAILBOX-PASSWORD'
];Create the mailbox first in Email Accounts.
Updates and backups
- Enable minor auto-upgrades in Softaculous; see auto-upgrade settings.
- Before major MediaWiki upgrades, back up with Softaculous; after upgrading, run
php maintenance/run.php update(older versions:php maintenance/update.php) in Terminal if the wiki asks for it. - Extensions in
extensions/must be updated to match the core version.
Troubleshooting
- Blank page after editing LocalSettings.php: a PHP syntax error; check the error log and fix the last change.
- Spam accounts: disable registration as above and delete spam users and pages.
- Uploads fail: check the extension list and PHP upload limits.
