DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Cover image for How I set up a wiki for "Game of RΓ΄les", the French better "Critical Role"
Sonny Alves Dias
Sonny Alves Dias

Posted on • Originally published at sonny.alvesdi.as

How I set up a wiki for "Game of RΓ΄les", the French better "Critical Role"

There is a show I love on Twitch on the channel of MisterMV: Game of RΓ΄les. It is an actual play of an original table RPG created by FibreTigre. To help the show, I decided at the time to create a wiki for it: https://gameofroles.wiki. And here is how I did it.

Prerequisites:

  • Docker
  • A server with yourdomain.com already pointing at it
  • 5-10 minutes

Everybody knows Wikipedia. But few know that Wikipedia is actually running on open-source software. The Wikimedia Foundation develops its own wiki engine. And they use it for all their projects, including Wikipedia, Wiktionary, and others. This wiki engine is named MediaWiki. That being said now, that's what we are going to use here to set up our own wiki :-)

First, you need a server with Docker installed on it. So obviously I would recommend a Linux server for that matter. For example, Digital Ocean proposes a Droplet image with Docker preinstalled on Ubuntu. With a couple of clicks, you can get a Droplet setup with Ubuntu and Docker ready to go. AWS and others have likely similar images in their inventory too.

In Docker Hub, you can find this Docker image: https://hub.docker.com/mediawiki/. This is the official docker image from the Wikimedia Foundation itself. This is definitely what we want to use.

Then, considering your wiki project, decide whether you need a MySQL-like database or the default embedded SQLite. In my case, I decided to use SQLite. Why? I knew the community watching the show was not huge. Hence, I did not need the database to scalable, and a simple SQLite is pretty enough. The show had regularly 2-4K viewers at the time I created the wiki in 2018. Actually nowadays in 2021, it has 16-20K viewers. And the wiki is still standing pretty well.

Now to warn you, there's a little trick to deploy your MediaWiki with Docker. First, create a folder wherever you want to store all the files related to the wiki. Then, start the wiki. Visit your wiki at http://yourdomain.com. Do the setup. And download the LocalSettings.php generated for you.

Here is the code I used to start the wiki:

# Create the folder
mkdir wiki; cd wiki
# Start the wiki setup
docker run --name my-wiki -d -v /wiki/data:/var/www/data -v /wiki/images:/var/www/html/images -v /wiki/extensions:/var/www/html/extensions  mediawiki
Enter fullscreen mode Exit fullscreen mode

Once you have the file LocalSettings.php, upload it into your wiki folder. Finally, delete the current container. And restart a new container with this LocalSettings.php mounted, and you are ready to go.

docker rm -f my-wiki
echo -e "docker run --name my-wiki -d -v /wiki/data:/var/www/data -v /wiki/images:/var/www/html/images -v /wiki/extensions:/var/www/html/extensions -v /wiki/LocalSettings.php:/var/www/html/LocalSettings.php --restart=always mediawiki" > start.sh
chmod +x start.sh 
./start.sh
Enter fullscreen mode Exit fullscreen mode

The command to start the container is kinda long. So I suggest saving it in a start.sh to avoid typing it ever again.

VoilΓ , then visit yourdomain.com and your wiki is ready to use.

Top comments (0)

🌚 Life is too short to browse without dark mode