Introduction

This runs MediaWiki in a docker container which removes the need to install anything on your machine except for Docker and Git.

Step 1 - Start MediaWiki with Docker

You will need Docker installed. Open a terminal window and run each of the commands below. If you don’t have Git installed, then the system will ask you to install it the first time it’s run. The final command will continue to running while the site is running. Wait until the scrolling stops and open http://localhost:8080.

git clone git@github.com:patrick-melo/mediawiki.git
cd mediawiki
docker-compose up

Step 2 - First setup

Wait for the mediawiki-mysql-1 messages to stop scrolling on the screen. The last message should read ready for connections. When you see this message, run the following command to set up the wiki:

docker exec -it mediawiki-mediawiki-1 php maintenance/install.php \
    --with-extensions \
    --dbserver mysql \
    --dbuser root \
    --dbpass supersecretpassword \
    --server "http://127.0.0.1:8080" \
    --scriptpath "" \
    --pass supersecretpassword \
    wiki wikiadmin 

Step 3 - Uncomment LocalSettings.php

Uncomment line 9 in the docker-compose.yml in this repo and restart docker-compose up. you will need to press Ctrl+C to stop the existing process.

Step 4 - Log into the site

You can now log into the site with the following credentials:

Username: wikiadmin
Password: supersecretpassword

Appendix A - Options

If you would rather not have to log into the website, then comment the following lines in LocalSettings.php.

$wgGroupPermissions['*']['createaccount'] = false;
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['*']['read'] = false;

Appendix B - First setup

The command above renders these steps unnecessary but I’ve included them here for information purposes. They’re how I generated the LocalSettings.php file.

First setup steps

These steps

  1. Open http://127.0.0.1:8080/
  2. On the splash screen, click “set up the wiki”.
  3. On the “Language” screen, click the “continue” button.
  4. On the “Welcome to MediaWiki!” screen, click the “continue” button.
  5. On the “Connect to database” screen, set the following values and click the “continue” button.

     Database type: MariaDB, MySQL, or compatible
     Database host: mysql
     Database name (no hyphens): my_wiki
     Database table prefix (no hyphens):
     Database username: root
     Database password: supersecretpassword
    
  6. On the “Database settings” screen, click the “continue” button.
  7. On the “Name” screen, set the following values, and click the “continue” button.

     Name of wiki: wiki
     Project namespace: Same as the wiki name: Wiki
     Your username: wikiadmin
     Password: supersecretpassword
     Password again: supersecretpassword
    
  8. On the “Options” screen, set the following values, and click the “continue” button.

     User rights profile: Private wiki
    
  9. On the “Install” screen, click the “continue” button.
  10. On the second “Install” screen, click the “continue” button.
  11. On the “Complete” download the “LocalSettings.php” file.

First setup screenshots

Splash

Splash

Language

Welcome

Welcome to MediaWiki!

Welcome

Connect to database

Welcome

Database settings

Welcome

Name

Welcome

Options

Welcome

Install (1 of 2)

Welcome

Install (2 of 2)

Welcome

Complete

Welcome