How to install MediaWiki on Debian 13

Published: June 24, 2026

Here's how to install MediaWiki on a desktop computer running Debian 13 (Trixie). These instructions are partially based on the Running MediaWiki on Debian or Ubuntu instructions from the MediaWiki Wiki. I've extended these instructions to show you how to configure MediaWiki to use SQLite1 and create your first page.

I've tested these instructions on a Debian 13 VM with Gnome on UTM on macOS Sequioa.

The installation consists of 3 steps:

Configure Apache HTTP server

Here, you'll configure the Apache HTTP server on your computer to work with PHP files and display MediaWiki correctly.

Open the Gnome Terminal.

Open a terminal on your Debian 13 desktop computer

Open a terminal on your Debian 13 desktop computer Open in new tab (full image size 95 KiB)

Check if your operating system's packages are up to date by running the following two commands:

$ sudo apt update
$ sudo apt upgrade

When you run commands with sudo in front of them, Debian prompts you for your current user's password. Enter your password and press the Enter key.

Run sudo apt update and sudo apt upgrade

Run sudo apt update and sudo apt upgrade Open in new tab (full image size 107 KiB)

Run the following command to install all packages that MediaWiki needs to run2:

$ sudo apt install --yes apache2 mariadb-server php \
  php-mysql libapache2-mod-php php-xml php-mbstring php-sqlite3 php-intl

Wait for the installation to finish.

Screenshot showing apt finishing installing MediaWiki packages

Screenshot showing apt finishing installing MediaWiki packages Open in new tab (full image size 163 KiB)

In your terminal, enter the following command to edit your the Apache HTTP server PHP settings:

$ EDITOR=gnome-text-editor sudo -e /etc/php/8.4/apache2/php.ini

You may have to enter your user password again to run this sudo command.

This opens a text editor that you can use to edit the settings contained in php.ini. Find the line using the text editor search:

;extension=sqlite3

Text editor for php.ini

Text editor for php.ini Open in new tab (full image size 115 KiB)

Un-comment this line by removing the semicolon (;) character in the beginning so that the line contains this:

extension=sqlite3

Press the Save menu entry and close the editor to save your changes to the php.ini file.

Save your changes and close the editor

Save your changes and close the editor Open in new tab (full image size 127 KiB)

Test Apache HTTP server

Open your browser and access the following address to test that the Apache HTTP Server runs correctly:

http://localhost

If the Apache HTTP server runs correctly, you should see something like the following screenshot:

Apache HTTP Server says "It works!"

Apache HTTP Server says "It works!" Open in new tab (full image size 190 KiB)

Download and unpack MediaWiki

In this step you'll download the latest stable MediaWiki release and make it available to the Apache HTTP server.

Find the latest stable MediaWiki version on the MediaWiki Download page. At the time of writing, the latest stable MediaWiki version is 1.45.3.

Screenshot showing the latest MediaWiki version 1.45.3 release on the MediaWiki Download page

Screenshot showing the latest MediaWiki version 1.45.3 release on the MediaWiki Download page Open in new tab (full image size 153 KiB)

Right-click the blue download .tar.gz link for the stable release and press Copy link. In a terminal, navigate to a temporary directory:

$ cd $(mktemp -d)

Navigate to a temporary directory

Navigate to a temporary directory Open in new tab (full image size 74 KiB)

Type the letters wget and paste the link that you've just copied from the MediaWiki download page. You should now have the following line in your terminal assuming that the latest stable release is 1.45.3.

$ wget https://releases.wikimedia.org/mediawiki/1.45/mediawiki-1.45.3.tar.gz

Paste the link that you've copied after the letters wget

Paste the link that you've copied after the letters wget Open in new tab (full image size 84 KiB)

Press the Enter key in your terminal to download the latest stable MediaWiki release.

Press enter to download MediaWiki

Press enter to download MediaWiki Open in new tab (full image size 139 KiB)

Unpack the release to /var/lib/mediawiki with the following commands:

$ tar -xzf mediawiki-*.tar.gz
$ sudo mkdir /var/lib/mediawiki
$ sudo mv mediawiki-*/* /var/lib/mediawiki

Check that you've copied all files with the following command:

$ ls /var/lib/mediawiki

You should see a number of files here like on the following screenshot:

Screenshot showing all MediaWiki files unpacked in /var/lib/mediawiki

Screenshot showing all MediaWiki files unpacked in /var/lib/mediawiki Open in new tab (full image size 131 KiB)

Link the MediaWiki directory into /var/www/html to make it available to the Apache HTTP server with the following command:

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

You can run ls /var/www/html/mediawiki one more time here to check that you've linked the directory correctly.

Link the MediaWiki directory into /var/www/html

Link the MediaWiki directory into /var/www/html Open in new tab (full image size 120 KiB)

Run the following command in your terminal to make sure that MediaWiki can write its SQLite database files:

$ sudo install --mode 770 --group www-data --directory /var/www/data

Configure MediaWiki

In this section you're going to configure MediaWiki, log in, and create your first page.

Access the MediaWiki configuration page in your browser at the following address:

http://localhost/mediawiki/mw-config/index.php

Start of MediaWiki installation

Start of MediaWiki installation Open in new tab (full image size 114 KiB)

Select your preferred languages and press Continue to get to the Welcome to MediaWiki screen. Scroll down and make sure you can see the following text:

The environment has been checked.

You can install MediaWiki.

Look for a "The environment has been checked." message

Look for a "The environment has been checked." message Open in new tab (full image size 199 KiB)

Scroll down and press the blue Continue button to get to the Connect to database screen.

On the Connect to database screen, scroll down and select SQLite under Database type.

Select SQLite as Database type

Select SQLite as Database type Open in new tab (full image size 124 KiB)

Press the blue Continue button to reach the Name screen.

Give your Wiki a name

Give your Wiki a name Open in new tab (full image size 129 KiB)

Scroll down to set up an Administrator account. Choose a username and strong password. You can leave out the email address. You may want to deselect the Share data about this instance with MediaWiki developers checkbox.

Open in new tab (full image size 132 KiB)

Select the I'm bored already, just install the wiki radio button and press Continue to finish the installation.

I'm bored already

I'm bored already Open in new tab (full image size 132 KiB)

The MediaWiki installation now takes you to the Install screen. Press Continue again.

Last screen before installation finishes

Last screen before installation finishes Open in new tab (full image size 123 KiB)

The Install screen now shows you the installation steps that it just ran through and a green box at the end saying the following:

Database was successfully set up

Installation finished

Installation finished Open in new tab (full image size 142 KiB)

Copy the settings

Press Continue again. This downloads a LocalSettings.php file to your computer.

Your browser now downloads a LocalSettings.php file

Your browser now downloads a LocalSettings.php file Open in new tab (full image size 147 KiB)

In your terminal, check that your Downloads directory contains this LocalSettings.php file and copy it to /var/lib/mediawiki with the following commands:

$ ls $HOME/Downloads
$ sudo cp $HOME/Downloads/LocalSettings.php /var/lib/mediawiki

Run stat /var/lib/mediawiki/LocalSettings.php to see if the file exists at /var/lib/mediawiki.

Copy the LocalSettings.php file to /var/lib/mediawiki

Copy the LocalSettings.php file to /var/lib/mediawiki Open in new tab (full image size 128 KiB)

Log in

Open the following address in your browser:

http://localhost/mediawiki/index.php/Main_Page

You should now see the main MediaWiki page

You should now see the main MediaWiki page Open in new tab (full image size 122 KiB)

Follow the Log in link in the top right. Log in with the username and password that you've entered in the Administrator account panel.4

Log in to your MediaWiki instance

Log in to your MediaWiki instance Open in new tab (full image size 98 KiB)

Edit a page

MediaWiki should direct you back to the Main Page after you log in.

Press the Edit button to edit the Main Page

Press the Edit button to edit the Main Page Open in new tab (full image size 124 KiB)

When you go to the Editing Main Page page, you can change the contents of the Main Page.

Editor showing the default contents of the Main Page contents

Editor showing the default contents of the Main Page contents Open in new tab (full image size 145 KiB)

You can edit the contents of the Main Page however you like. Press the blue Save changes button to make your changes permanent.

You can change the contents of the Main Page

You can change the contents of the Main Page Open in new tab (full image size 115 KiB)

When you press Save changes, MediaWiki takes you back to the page that you've just edited.

The Main Page now contains your changes

The Main Page now contains your changes Open in new tab (full image size 97 KiB)

Create page

Let's say you'd like to make a new page called Cooking recipes. Enter Cooking recipes in the top search box like in the following screenshot:

Search for the Cooking recipes page

Search for the Cooking recipes page Open in new tab (full image size 97 KiB)

Press the Enter key or the Search button to the right of the search box. This takes you to a Search results page.

This is what you'll see when the Cooking recipes page doesn't exist

This is what you'll see when the Cooking recipes page doesn't exist Open in new tab (full image size 105 KiB)

Since you haven't created this page, MediaWiki shows the following:

There were no results matching the query.

Create the page "Cooking recipes" on this wiki!

Follow the red Cooking recipes link.

Add contents to your Cooking recipes page

Add contents to your Cooking recipes page Open in new tab (full image size 99 KiB)

Add something to your new page and press the blue Save page button.

Add contents and press **Save page**

Add contents and press **Save page** Open in new tab (full image size 114 KiB)

MediaWiki takes you to your new Cooking recipes page after you press Save page.

MediaWiki showing your new "Cooking recipes" page

MediaWiki showing your new "Cooking recipes" page Open in new tab (full image size 100 KiB)

You've now created your first page on your new MediaWiki instance. What will you do next? MediaWiki gives you plenty of useful tools and possibilities are limitless.3

Further steps

Here are some thing you can try on your new MediaWiki:

Workshop at DWeb Camp 2026

I'm going to host a workshop on how to run your own MediaWiki instance at DWeb Camp 2026: Root Systems in July 2026. I hope to see you there!

If you have any questions about self-hosting MediaWiki, write me an email. You can find my email address at the bottom of this page.


  1. Manual:SQLite on www.mediawiki.org/wiki 

  2. I found that you need to add php-intl, too. Otherwise, the MediaWiki configuration complains that you're missing the intl extension. 

  3. Welcome. Anything is possible with MediaWiki. The only limit is yourself. You can do anything with MediaWiki

  4. You can create and edit pages without logging in by default. This step helps verify that MediaWiki correctly created your account. 

I would be thrilled to hear from you! Please share your thoughts and ideas with me via email.

Back to Index