Installing Mediawiki on the Raspberry Pi 3

Home / Installing Mediawiki on the Raspberry Pi 3

This article documents how I installed MediaWiki on my Raspberry Pi 3 to use as a personal wiki. MediaWiki is the wiki software package that is used by Wikipedia.

This is part of my ongoing series about creating the Ultimate Raspberry Pi 3 Home Server. I'm using a Raspberry Pi 3 Model B with Raspbian Jesse. I won't talk about the basics of setting up a Pi and its OS because there are tons of other articles on the internet for that. Just use google.

It should be noted that by installing MediaWiki, you will be installing a full-fledged LAMP server on your pi.

Installation Instructions

First, make sure the packages on the Pi are up-to-date:

  • sudo apt-get update
  • sudo apt-get upgrade
  • sudo apt-get install mediawiki - Install MediaWiki
  • In the middle of the MediaWiki installation, you will be asked to set a new password for MySQL
  • After the installation finishes, we need to edit the apache.conf file. Open the file using your favorite text editor (I will use nano):

    sudo nano /etc/mediawiki/apache.conf

    Uncomment the line "#Alias /mediawiki /var/lib/mediawiki" by removing the "#" at the start. This is what the entirety of my apache.conf looks like after the change:

  • sudo apt-get install php-apc imagemagick - Install php-apc for object caching and Imagemagick for thumbnailing
  • sudo apache2ctl restart - Restart the apache server
  • Now we'll need to configure apache to host the Mediawiki site:

    sudo nano /etc/apache2/ apache2.conf

    At the end of the file, enter the following line:

    Include /etc/mediawiki/apache.conf

    Next, enter the following two commands:

    Now we need to set up the wiki. We can do this by opening a browser and connecting to the pi's web server: [Raspberry Pi's IP Address]/mediawiki/. For example, I entered the following in my browser address bar to connect to the wiki through the Apache server:

    Your IP address is probably different. Search google if you need to learn how to find your Pi's IP address.

    Once you enter the address you should the bolded words "Mediawiki" along with its logo. Below, you should see a link that says something like "Set up the wiki". Click that link. Follow the instructions to set up MediaWiki. They are very straightforward for the most part. Here are some guidelines for the setup steps that might be more confusing

    Connect to database

    Database type: Leave as MySQL
    Database host: Leave as localhost
    Database name: Change it to whatever. I usually leave it as "my_wiki"
    Database table prefix: Leave it blank
    Database username: Leave as root
    Database password: Set this to the password you entered at the beginning of the installation process when you were asked for a MySQL password

    Database Settings

    Leave the checkbox labeled "Use the same account as for installation" checked
    Storage engine: Leave as InnoDB
    Database Character Set: Leave as Binary


    Name of wiki: Name your wiki whatever you want
    Project Namespace: Leave as default (Same as the wiki name)
    Administrator Account: Setup a username, password, and email for your wiki admin account.

    There is an option at the bottom asking if you want to be asked more questions. I personally skip this past and select "I'm bored already, just install the wiki".

    On the final 'Install' page, click Continue. This will begin the installation, which can take a while. After it's complete, you should see a window that says "Congratulations". That's it! You're done.

    Leave a Reply

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