I installed mediawiki & semantic mediawiki on a laptop with Ubuntu 20.04.


  • Should the www-data user own every file of mediawiki? Is it better to let root own the files?
  • Should I run composer with the www-data user? I mean sudo -u www-data composer update --nodev? When I run composer with root, composer says that is bad.

Installation of Mediawiki

  1. Install semantic, following https://www.mediawiki.org/wiki/Manual:Running_MediaWiki_on_Debian_or_Ubuntu
  2. chown -R www-data:www-data /var/lib/mediawiki/images/ for uploading images and other files.
  3. Now everything in /var/lib/mediawiki is owned by root:root, except for the images/ folder.
  4. Set up short url by modifying /etc/apache2/sites-avaliable/000-default.conf and follow the guide at https://www.mediawiki.org/wiki/Manual:Short_URL/Apache

Installation of Semantic Mediawiki

  1. sudo apt-get install composer
  2. Create /var/lib/mediawiki/composer.local.json with the following content:
        "mediawiki/semantic-mediaw-wiki": "~3.2"

as described in https://www.semantic-mediawiki.org/wiki/Help:Installation/Quick_guide

  1. chown -R www-data:www-data /var/lib/mediawiki
  2. While the guide asked me to run composer update --nodev, I run the command with the www-data user and within the /var/lib/mediawiki folder:
cd /var/lib/mediawiki && sudo -u www-data composer update --nodev
  1. sudo -u www-data php maintenance/update.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.