[39] How to Install MediaWiki on Raspberry-Pi

—Walk Through Starts Here—

SSH to your Raspberry Pi

ssh pi@your-ip-address

Ensure the Raspberry-Pi is up-to-date

sudo apt update
sudo apt upgrade

Install the LAMP Stack on the Raspberry Pi
sudo apt-get install apache2 mariadb-server php php-mysql libapache2-mod-php php-xml php-mbstring php-apcu php-intl imagemagick inkscape php-gd php-cli php-curl php-bcmath git

sudo service apache2 reload

Download and extract MediaWiki
You can find the latest version here -> https://www.mediawiki.org/wiki/Download

As of writing this, the latest version is 1.36.1

cd /tmp/

wget https://releases.wikimedia.org/mediawiki/1.36/mediawiki-1.36.1.tar.gz

tar -xvzf /tmp/mediawiki-*.tar.gz

sudo mkdir /var/lib/mediawiki

sudo mv mediawiki-*/* /var/lib/mediawiki

sudo ln -s /var/lib/mediawiki /var/www/html/mediawiki

Configuring the MariaDB Database

sudo mysql -u root -p

Note: If you have not configured password it will be blank, so just press enter.

Create the User
mysql> CREATE USER 'wikidbadmin'@'localhost' IDENTIFIED BY 'YourPasswordHere';

Create the Database
mysql> CREATE DATABASE hendgrow_wiki;

mysql> use hendgrow_wiki;

Give the new user access to the new database
mysql> GRANT ALL ON hendgrow_wiki.* TO 'wikidbadmin'@'localhost';

mysql> commit;

mysql> quit;

Open your web browser and navigate to your server
Example: http://your-ip-address/mediawiki/

Our example: http://192.168.2.200/mediawiki/

You should see the following:

Download the “Localsettings.php” and copy it to your servers base wiki installation folder.

Refresh your browser. you should see page below.