A personal wiki is something that attracts me like a moth to a flame. It always did since I started contributing to Wikipedia 19 years ago (wow). Nowadays, for my day to day use, I use Obsidian like a normal human beings (you can replace Obsidian with any note-taking application; they all have backlinks now).
Still, there are some use case that may require a more traditional wiki. For instance, making a wiki for my home, with useful information about my house (maintenance, “how to”, etc.) that my family can access on my LAN. Or a wiki that needs to be edited by multiple people. Or something that looks more “official” (e.g., for a wiki for my world-building). These scenarios, MediaWiki, the platform that powers the entire Wikipedia, may be a valid alternative.
Even in these cases, though, using MediaWiki may be an overkill. It is like using an entire 4th generation nuclear power plant only to charge your phone. There are much simpler solutions out there. However, if you are here, you are like me: you like having fun with overtly complex software and, most importantly, you like to have the most powerful tool in hand.
Luckily, installing MediaWiki is not that hard. Especially if you already use Docker for other things. So, here it is a quick and easy way to have a MediaWiki instance running locally in 10 minutes.
Step by Step Guide
- Create an empty folder (e.g.,
mywiki
). - In that folder, let’s create a
docker-compose.yml
file with the following content:
|
|
- There are a couple of things to note:
- There is a commented line in
volumes
. This needs to be un-commented in Step 8. I’ll explain then. - On a mac with an M1 chip,
mysql:5.7
will fail the installation (there is no ARM-compatible binary for that particular MySQL version). No worries. You can setplatform: linux/x86_64
to force the AMD64 version. As an alternative, I think you can use a MariaDB image, but I didn’t test it. If you don’t plan to have so many concurrent edits that the performance hit will be noticeable, I think you can stick with my solution.
- There is a commented line in
- Replace
<db_password>
and<db_root_password>
with a secure password. We are using 2 database users: a root user for the installation, and amediawiki
user for the normal operation. If you plan to use the wiki only locally, you could just use the root user. However, once again, I didn’t test that. - Run the containers with
docker compose up -d
. This will pull the images and run the service. When ready, go tolocalhost:8080
and follow the standard MediaWiki installation procedure. - After that, MediaWiki will tell you to download a configured
LocalSettings.php
file. - Copy this file in the folder with
docker-compose.yml
. At this point, you should have a folder with two files (docker-compose.yml
andLocalSettings.php
) and two folders (db_data
andmediawiki_data
). - Now it is time to un-comment the line
- ./LocalSettings.php:/var/www/html/LocalSettings.php
fromdocker-compose.yml
. - Shutdown the container (
docker compose down
) and bring it back up (docker compose up -d
). - Go once again to
localhost:8080
and you should be able to see your wiki. Log in with the user you created during the installation and you are ready to go.
Troubleshooting
I got no problems with this, but I am experienced enough to know that errors are always ready to ambush us.
Therefore, I’ll update this section with the answers to the errors you may encounter. Ping me on Mastodon or Bluesky.
Next Steps
Now that you have a running installation, you can start filling it. And, most importantly, customize it. Starting, of course, with changing the wiki’s logo.
If you want to back up your wiki, just copy the folder somewhere (in our example mywiki
). It is all you need.
I hope this is useful. :) Bye.