When you install MediaWiki, new user registration is enabled by default. Anyone can create an account and start editing. That’s fine for a public wiki, but not always what you want — especially for a private or company wiki where you want to control who has access.
There’s no toggle for this in the settings UI, but it’s a single line in the config file.
Disable registration
Add this line to your LocalSettings.php file:
$wgGroupPermissions['*']['createaccount'] = false;
This tells MediaWiki to deny the createaccount permission to the * group (which means all users, including unauthenticated visitors).
Allow only certain users to create accounts
If you want only logged-in users to be able to create new accounts (for example, so existing users can invite others):
$wgGroupPermissions['*']['createaccount'] = false;
$wgGroupPermissions['user']['createaccount'] = true;
Or if you want only sysops (admins) to create accounts:
$wgGroupPermissions['*']['createaccount'] = false;
$wgGroupPermissions['sysop']['createaccount'] = true;
After making the change, clear the MediaWiki cache if needed (php maintenance/runJobs.php) and the login/register page will immediately reflect the new permissions.
Enjoy!