How to Install MediaWiki on Rocky Linux 10

MediaWiki is a free and open-source wiki software package written in PHP. It powers some of the largest wiki websites like Wikipedia and many others. In this guide, we’ll walk you through installing the latest version of MediaWiki (1.43.1) on Rocky Linux 10.


Prerequisites

  • A system running Rocky Linux 10
  • A working LAMP stack (Apache, MariaDB, PHP)
    Click here to set up the LAMP Stack on Rocky Linux 10.
  • PHP 8.2 or later (but not 8.4 as MediaWiki doesn't support it yet)Click here to Install_PHP_8_2_in_Rocky_Linux_10
  • root or sudo access

Create a Database for MediaWiki

Login to MariaDB:

mysql -u root -p

Inside the MariaDB shell:

CREATE DATABASE mediawiki;
CREATE USER 'mediawikiuser'@'localhost' IDENTIFIED BY 'StrongPasswordHere';
GRANT ALL PRIVILEGES ON mediawiki.* TO 'mediawikiuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;

🔐 Replace StrongPasswordHere with a secure password.


Step 3: Download and Extract MediaWiki

Download the latest version of MediaWiki:

cd /var/www/html
wget https://releases.wikimedia.org/mediawiki/1.43/mediawiki-1.43.1.tar.gz

Extract and rename the folder:

sudo dnf install -y tar
tar -xvzf mediawiki-1.43.1.tar.gz
mv mediawiki-1.43.1 mediawiki

Step 4: Set Permissions

Set proper ownership for the MediaWiki directory:

chown -R apache:apache /var/www/html/mediawiki
chmod -R 755 /var/www/html/mediawiki

Apply SELinux context (if enabled):

chcon -R -t httpd_sys_rw_content_t /var/www/html/mediawiki

Step 5: Configure Apache

Create a configuration file for MediaWiki:

vi /etc/httpd/conf.d/mediawiki.conf

Paste the following content:

<VirtualHost *:80>
    ServerAdmin admin@example.com
    DocumentRoot /var/www/html/mediawiki
    ServerName your-domain.com

    <Directory /var/www/html/mediawiki/>
        Options FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog /var/log/httpd/mediawiki_error.log
    CustomLog /var/log/httpd/mediawiki_access.log combined
</VirtualHost>

Replace your-domain.com with your actual domain or server IP.

Save and exit.


Step 6: Enable and Restart Apache

Start Apache and enable it on boot:

systemctl restart httpd
systemctl enable httpd

Also, allow HTTP traffic through the firewall:

firewall-cmd --permanent --add-service=http
firewall-cmd --reload

Step 7: Web Installer

Now open your browser and go to:

http://your-server-ip/mediawiki

You should see the MediaWiki setup wizard. Follow the on-screen instructions to:

  • Set up your wiki name and admin account
  • Configure database access (use the DB name mediawiki, user mediawikiuser, and password you set)
  • Download LocalSettings.php and upload it to /var/www/html/mediawiki/

MediaWiki Interface Screenshots


✅ You’ve successfully installed MediaWiki 1.43.1 on Rocky Linux 10!

Need help? Reach out to us via a Support Ticket.


CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME for 10% off!

1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month

Available Locations: LAX | MIA | ATL | FRA | AMS