Install self-hosted wiki platform
Install Self-Hosted Wiki Platform
This tutorial will guide you through the process of setting up a self-hosted wiki platform. This is suitable for developers and homelab enthusiasts who want to have their own private knowledge base.
Hardware or Software Requirements
- A server with at least 1GB RAM (minimum recommendation)
- 20GB of free disk space
- An internet connection
- Linux operating system (Ubuntu, Debian, etc.)
- Root access to the server
- Optional: A domain name for your wiki
Step-by-Step Instructions
Login to your server via SSH.
Update the package list and upgrade existing packages:
sudo apt update sudo apt upgrade -yInstall necessary dependencies:
sudo apt install apache2 php libapache2-mod-php php-mysql git -yClone the MediaWiki repository from GitHub to your server:
cd /var/www/html git clone https://github.com/wikimedia/mediawiki.gitCreate a MySQL database and user for MediaWiki:
sudo mysql -u root -p CREATE DATABASE mediawiki; CREATE USER 'mediawikiuser'@'localhost' IDENTIFIED BY 'yourpassword'; GRANT ALL PRIVILEGES ON mediawiki.* TO 'mediawikiuser'@'localhost'; FLUSH PRIVILEGES; EXIT;Configure MediaWiki:
cd /var/www/html/mediawiki cp LocalSettings.php.sample LocalSettings.php nano LocalSettings.phpIn the
LocalSettings.phpfile, configure the database settings and other preferences as needed.Create a virtual host for your wiki:
<VirtualHost *:80> ServerName yourdomain.com DocumentRoot /var/www/html/mediawiki <Directory /var/www/html/mediawiki> Options Indexes FollowSymLinks MultiViews AllowOverride All Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>Replace
yourdomain.comwith your actual domain name. Save and exit the file.Restart Apache to apply changes:
sudo systemctl restart apache2Visit http://yourdomain.com in your web browser. Follow the on-screen instructions to complete the installation.
Commands Where Useful
sudo apt updatesudo apt upgrade -ygit clone https://github.com/wikimedia/mediawiki.gitsudo mysql -u root -pcp LocalSettings.php.sample LocalSettings.phpnano LocalSettings.php<VirtualHost *:80> ServerName yourdomain.com DocumentRoot /var/www/html/mediawiki <Directory /var/www/html/mediawiki> Options Indexes FollowSymLinks MultiViews AllowOverride All Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>sudo systemctl restart apache2
Troubleshooting Section
- If you encounter issues with Apache configuration, check the Apache error logs for more information.
- If MySQL database setup fails, ensure that your MySQL server is running and accessible.
- Check file permissions on
/var/www/html/mediawikito make sure they are set correctly.
Conclusion
You have successfully installed a self-hosted wiki platform. This setup provides you with a flexible and powerful tool for managing your knowledge base. For further customization, refer to the official MediaWiki documentation.
Comments