How to Install Mediawiki on a Ubuntu

If you want to install MediaWiki on Ubuntu, this guide will help you get started. MediaWiki is a free and open-source wiki software package that can be used to create and manage online information. It’s an excellent tool for developing and managing your website or blog.

This is a guide to installing MediaWiki on Ubuntu from scratch. this video shows you how to install all the prereqs, configure the database, PHP settings, and everything to get the Wiki loading in your web browser.

How to Install MediaWiki on Ubuntu: A Detailed Procedure

MediaWiki is a free and open-source software that powers Wikipedia and many other websites. This guide provides a step-by-step procedure for installing MediaWiki on an Ubuntu server. The guide assumes that you have a basic understanding of Linux commands and have sudo privileges on the server.


  1. Ubuntu Server: A running instance of Ubuntu (18.04 or later is recommended).
  2. SSH Access: Secure Shell (SSH) access to your Ubuntu server.
  3. LAMP Stack: Linux, Apache, MySQL, and PHP installed on your server.

Step 1: Update Ubuntu Packages

Firstly, update the package list and upgrade the installed packages to their latest versions.

sudo apt update sudo apt upgrade

Step 2: Install Apache Web Server

If Apache is not already installed, you can install it using the following command:

sudo apt install apache2

Step 3: Install MySQL Database Server

Install MySQL by executing the following command:

sudo apt install mysql-server

Step 4: Secure MySQL Installation

Run the MySQL security script to secure your database.

sudo mysql_secure_installation

Follow the prompts to set a root password and secure your MySQL installation.

Step 5: Install PHP

MediaWiki requires PHP to function. Install PHP and some additional modules with the following command:

sudo apt install php php-mysql php-xml php-mbstring

Step 6: Download MediaWiki

Navigate to the web root directory and download the latest version of MediaWiki.

cd /var/www/html wget

Step 7: Extract MediaWiki Archive

Extract the downloaded tarball and move the contents to a new directory.

tar xzvf mediawiki-*.tar.gz mv mediawiki-1.35.0/* /var/www/html/

Step 8: Create a MySQL Database

Log in to MySQL and create a new database for MediaWiki.

mysql -u root -p 
GRANT ALL PRIVILEGES ON mediawiki.* TO 'wikiuser'@'localhost' IDENTIFIED BY 'password'; 

Step 9: Run MediaWiki Installation Script

Open a web browser and navigate to http://your_server_ip/. Follow the on-screen instructions to complete the MediaWiki installation.

Step 10: Configure Apache

Finally, configure your Apache server to serve the MediaWiki site. Edit the Apache configuration file as needed.

Advanced Customization and Integration of MediaWiki on Ubuntu

Once you’ve successfully installed MediaWiki on your Ubuntu server, you may want to explore advanced customization options and integration with other software to enhance its capabilities. This guide will walk you through some of these advanced steps.

Customizing MediaWiki Appearance

Install Themes

  1. Download Theme: Download your desired MediaWiki theme from the MediaWiki Skins directory.
  2. Upload to Server: Upload the theme folder to /var/www/html/skins/ on your server.
  3. Edit LocalSettings.php: Open the LocalSettings.php file and add the following line to activate the theme:php

Customize Logo

  1. Upload Logo: Upload your custom logo to /var/www/html/resources/assets/.
  2. Edit LocalSettings.php: Add the following line to change the logo:php
$wgLogo = "$wgResourceBasePath/resources/assets/your_logo.png";

Extending MediaWiki Functionality

Install Extensions

  1. Download Extension: Download your desired extension from the MediaWiki Extensions directory.
  2. Upload to Server: Upload the extension folder to /var/www/html/extensions/.
  3. Activate Extension: Open LocalSettings.php and add the following line:php

Integration with Other Software

LDAP Integration

  1. Install LDAP Extension: Follow the steps above to install the LDAP Authentication extension.
  2. Configure LDAP: Add the LDAP configuration to your LocalSettings.php file. This will include the LDAP server details and user credentials.

Visual Editor

  1. Install Parsoid: Visual Editor requires Parsoid to run. Install it using:bash
sudo apt install parsoid

  1. Configure Parsoid: Edit the Parsoid settings to point it to your MediaWiki API.
  2. Activate Visual Editor: Install and activate the Visual Editor extension as described above.

Backup and Restore


  1. Backup Database: Use mysqldump to backup your MediaWiki database.bash
mysqldump -u root -p mediawiki > mediawiki_backup.sql 

Backup Files: Archive the MediaWiki installation directory.

tar czvf mediawiki_files_backup.tar.gz /var/www/html/


Restore Database: Use mysql to restore the database

mysql -u root -p mediawiki < mediawiki_backup.sql

Restore Files: Extract the archived files back into the MediaWiki installation directory.

Advanced customization and integration can significantly extend the capabilities of your MediaWiki installation. Whether you’re looking to change the appearance, add new features, or integrate with other platforms, these steps offer a solid foundation.

Elsewhere On TurboGeek:  How To Install Xrdp Server On Ubuntu 14.04 Unity


Richard Bailey, a seasoned tech enthusiast, combines a passion for innovation with a knack for simplifying complex concepts. With over a decade in the industry, he's pioneered transformative solutions, blending creativity with technical prowess. An avid writer, Richard's articles resonate with readers, offering insightful perspectives that bridge the gap between technology and everyday life. His commitment to excellence and tireless pursuit of knowledge continues to inspire and shape the tech landscape.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

Translate ยป