Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Register

MediaWiki Engine Installing and Configuring

LawrenceLawrence Member
edited May 2020 in Web Applications


MediaWiki is free and open-source wiki software and it is the same software used by Wikipedia. It is fully dynamic and runs on a LAMP stack, taking advantage of the PHP language and the MySQL database backend. With easy installation and configuration, MediaWiki is a good solution when you need a familiar, full-featured dynamic wiki engine.


The only requirements are to have a user with sudo privileges (root is fine) and Apache, PHP, and MySQL installed on your VPS.

Tutorial on how to create a new user and grant him sudo privileges can be found here.

In this tutorial we will be using Ubuntu 16.04, however, you should be able to use all our offered Ubuntu and Debian versions.

In Time4VPS you are able to install Ubuntu 16.04 template really easy and fast, only with few mouse clicks:
  1. Login to the Client Area;
  2. Select at the top of menu the "My Services > VPS" tab;
  3. Press the "Manage" button at the service table;
  4. Press the "Install OS" button;
  5. Choose Ubuntu 16.04 operating system, agree with warning and press "Continue";
  6. Wait for 5-10 minutes and refresh VPS management page.

Updating System

First things first. Like always, first of all, we recommend to update and upgrade your server.
apt-get update
apt-get upgrade -y

LAMP installation:

For starters, you will need to install Apache, PHP and MySQL (LAMP) stack. This can be done with the help of tasksel tool:

sudo apt install tasksel
sudo tasksel install lamp-server

To begin, download the latest MediaWiki package. You can find the download location for the releases by visiting the MediaWiki homepage.

Go to web-accessible DocumentRoot, in our case it is:

cd /var/www/html/

Use wget to download the latest package:


Decompress the package by using the tar command, as shown below:

tar -xvzf mediawiki-1.30.2.tar.gz

Move the uncompressed mediawiki-1.30.2 directory into your html/ folder, renaming the directory to mediawiki/ in the process.

mv mediawiki-1.30.2 mediawiki
The name of the directory beneath the html/ will determine the path to your wiki. In this case, the wiki would be located at mediawiki/.

The config/ directory inside the mediawiki/ directory needs to allow MediaWiki to write to it during the installation process. Change into the mediawiki/ directory and run the following chmod command:
cd mediawiki
chmod a+w mw-config
mbstring extension needed for MediaWiki is a non-default extension. This means it is not enabled by default. You must explicitly enable the module with commands:
apt-get install php-mbstring php-xml -y
service apache2 restart


On your browser go to your_domain/mediawiki and click the “Please set up the wiki first” link. The setup page contains everything you need to complete the installation.

Now proceed with the configuration, enter such information as database name, username, and password, and so on.

After completing the installation form and submitting it, you will arrive at the “MediaWiki Installation” page. An automatic file download should be initiated. Save or open the file. Now, get back to SSH access on your VPS. Create a LocalSettings.php file:
nano /var/www/html/mediawiki/LocalSettings.php
Upload the contents of the previously saved or opened file to the LocalSettings.php file and save it.
Since the LocalSettings.php file will contain your MySQL password, make sure to restrict access to it:
chown root:www-data /var/www/html/mediawiki/LocalSettings.php
chmod 640 /var/www/html/media/wiki/LocalSettings.php
MediaWiki is now successfully installed and configured! Now you have powerful and at same time easy to use wiki engine.

Sign In or Register to comment.


Learn how to install a web and database server, email, FTP client or other applications. Discover and share information on server security or optimization recommendations.
Feel free to join our constantly expanding community, participate in discussions, strengthen your knowledge on Linux and Windows server management!
© 2013 - 2024 Time4VPS. All rights reserved.

Get In Touch