{"id":2042,"date":"2025-09-11T00:36:52","date_gmt":"2024-08-30T17:30:21","guid":{"rendered":""},"modified":"2025-02-02T00:46:18","modified_gmt":"2025-02-01T23:46:18","slug":"how-to-install-mediawiki-on-debian-12","status":"publish","type":"post","link":"https:\/\/netcloud24.com\/knowledgebase\/how-to-install-mediawiki-on-debian-12\/","title":{"rendered":"Linux VPS &#038; VPS Windows Setup Guide | NetCloud24 MediaWiki on Debian 12"},"content":{"rendered":"<p>\u00a0<\/p>\n<\/p>\n<header>\n<h1>\u00a0<\/h1>\n<\/header>\n<article>\n<p><strong>MediaWiki<\/strong> is an open-source platform used to power Wikipedia and many other wiki-based websites. It is ideal for creating collaborative knowledge bases and is widely used by organizations, schools, and communities. In this guide, we\u2019ll show you how to install MediaWiki on <strong>Debian 12<\/strong>. Hosting your MediaWiki site on a  is highly recommended, as a <strong>VPS server<\/strong> provides the scalability and performance needed for a smooth wiki experience.<\/p>\n<h2>Step 1: Update Your VPS Server<\/h2>\n<p>Before you begin the installation, it\u2019s important to ensure your <a href=\"https:\/\/ie.netcloud24.com\">VPS server<\/a> is up to date. Run the following commands to update your Debian 12 system:<\/p>\n<pre><code>sudo apt update &amp;&amp; sudo apt upgrade -y<\/code><\/pre>\n<p>By using a <strong>Windows VPS<\/strong>, you can ensure that your MediaWiki platform runs on a secure and optimized VPS server that is capable of handling growing traffic and data.<\/p>\n<h2>Step 2: Install Apache, MySQL, and PHP (LAMP Stack)<\/h2>\n<p>MediaWiki requires a LAMP stack (Linux, Apache, MySQL, PHP). Begin by installing Apache, MySQL, and PHP:<\/p>\n<ul>\n<ul>\n<li>Install Apache:<\/li>\n<\/ul>\n<\/ul>\n<pre><code>sudo apt install apache2 -y<\/code><\/pre>\n<ul>\n<ul>\n<li>Start and enable Apache to start on boot:<\/li>\n<\/ul>\n<\/ul>\n<pre><code>sudo systemctl enable apache2 --now<\/code><\/pre>\n<ul>\n<ul>\n<li>Install MySQL:<\/li>\n<\/ul>\n<\/ul>\n<pre><code>sudo apt install mysql-server -y<\/code><\/pre>\n<ul>\n<ul>\n<li>Secure the MySQL installation:<\/li>\n<\/ul>\n<\/ul>\n<pre><code>sudo mysql_secure_installation<\/code><\/pre>\n<ul>\n<ul>\n<li>Install PHP along with necessary extensions for MediaWiki:<\/li>\n<\/ul>\n<\/ul>\n<pre><code>\r\nsudo apt install php php-mysql php-xml php-mbstring php-intl php-gd php-json php-cli php-curl php-zip -y\r\n<\/code><\/pre>\n<h2>Step 3: Create a MySQL Database for MediaWiki<\/h2>\n<p>MediaWiki requires a database to store its content. Log in to MySQL and create a database and user for MediaWiki:<\/p>\n<pre><code>sudo mysql -u root -p<\/code><\/pre>\n<p>Once logged in, create the database and user with the following commands:<\/p>\n<pre><code>\r\nCREATE DATABASE mediawiki;\r\nCREATE USER 'wikiuser'@'localhost' IDENTIFIED BY 'your_password';\r\nGRANT ALL PRIVILEGES ON mediawiki.* TO 'wikiuser'@'localhost';\r\nFLUSH PRIVILEGES;\r\nEXIT;\r\n<\/code><\/pre>\n<p>Make sure to replace <code>your_password<\/code> with a secure password of your choice.<\/p>\n<h2>Step 4: Download and Install MediaWiki<\/h2>\n<p>Now, download the latest version of MediaWiki from the official website. First, navigate to the <code>\/var\/www\/html<\/code> directory:<\/p>\n<pre><code>cd \/var\/www\/html<\/code><\/pre>\n<p>Download MediaWiki using <code>wget<\/code>:<\/p>\n<pre><code>wget https:\/\/releases.wikimedia.org\/mediawiki\/1.39\/mediawiki-1.39.1.tar.gz<\/code><\/pre>\n<p>Extract the downloaded file:<\/p>\n<pre><code>tar -xvzf mediawiki-1.39.1.tar.gz<\/code><\/pre>\n<p>Move the extracted files to a new directory for your MediaWiki site:<\/p>\n<pre><code>sudo mv mediawiki-1.39.1\/ mediawiki<\/code><\/pre>\n<h2>Step 5: Set File Permissions<\/h2>\n<p>Set the appropriate ownership and permissions for the MediaWiki directory:<\/p>\n<pre><code>\r\nsudo chown -R www-data:www-data \/var\/www\/html\/mediawiki\r\nsudo chmod -R 755 \/var\/www\/html\/mediawiki\r\n<\/code><\/pre>\n<h2>Step 6: Configure Apache for MediaWiki<\/h2>\n<p>Create a new Apache virtual host file for MediaWiki:<\/p>\n<pre><code>sudo nano \/etc\/apache2\/sites-available\/mediawiki.conf<\/code><\/pre>\n<p>Add the following configuration:<\/p>\n<pre><code>\r\n\r\n    ServerAdmin admin@your-domain.com\r\n    DocumentRoot \/var\/www\/html\/mediawiki\r\n    ServerName your-domain.com\r\n\r\n    \r\n        AllowOverride All\r\n        Require all granted\r\n    \r\n\r\n    ErrorLog ${APACHE_LOG_DIR}\/mediawiki-error.log\r\n    CustomLog ${APACHE_LOG_DIR}\/mediawiki-access.log combined\r\n\r\n<\/code><\/pre>\n<p>Replace <code>your-domain.com<\/code> with your actual domain name. Then, enable the site and the Apache rewrite module:<\/p>\n<pre><code>\r\nsudo a2ensite mediawiki.conf\r\nsudo a2enmod rewrite\r\nsudo systemctl restart apache2\r\n<\/code><\/pre>\n<h2>Step 7: Complete MediaWiki Setup<\/h2>\n<p>Now that MediaWiki is installed, open your browser and navigate to <code>http:\/\/your-domain.com<\/code>. You will be taken to the MediaWiki setup page. Follow the instructions to configure your database connection (using the database and user you created earlier), set up the admin account, and complete the installation.<\/p>\n<p>Once the setup is complete, download the generated <code>LocalSettings.php<\/code> file and upload it to the <code>\/var\/www\/html\/mediawiki<\/code> directory to finalize your MediaWiki installation.<\/p>\n<h2>Step 8: Optimize MediaWiki with a VPS Server<\/h2>\n<p>MediaWiki can grow rapidly as more content is added and more users collaborate. Hosting your MediaWiki platform on a  ensures that your site remains fast, secure, and scalable. A <strong>VPS server<\/strong> provides dedicated resources, giving your wiki platform the ability to handle high traffic and large amounts of content.<\/p>\n<h2>Conclusion<\/h2>\n<p>Installing MediaWiki on Debian 12 is a straightforward process that allows you to create a powerful and flexible wiki platform for knowledge sharing. For better performance, scalability, and control, consider hosting your MediaWiki site on a . A reliable <strong>VPS server<\/strong> ensures that your wiki will operate smoothly, even as your content and user base grow.<\/p>\n<p>For more information on VPS hosting and how to optimize your server for MediaWiki, visit  today.<\/p>\n<\/article>\n<footer>\n<p>\u00a9 2024 Windows VPS &#8211; All Rights Reserved<\/p>\n<\/footer>\n<div class=\"post-author-box\" style=\"border-top:1px solid #ddd;margin-top:20px;padding-top:15px;\">\n<p><strong>Author:<\/strong> \u0141ukasz Bodziony<\/p>\n<p><strong>Website:<\/strong> <a href=\"https:\/\/ca.netcloud24.com\" target=\"_blank\" rel=\"dofollow\">Windows VPS<\/a><\/p>\n<p><em>\u0141ukasz Bodziony is the CEO and founder of <a href=\"https:\/\/netcloud24.com\" target=\"_blank\" rel=\"dofollow\">NETCLOUD24<\/a>, a global VPS hosting brand proudly originating from Poland. With extensive experience in cloud computing, virtualization, and server management, he delivers high-performance <strong>Windows VPS<\/strong> and <strong>Remote Desktop Services (RDS)<\/strong> solutions to clients across Europe, North America, and beyond.<\/em><\/p>\n<p><em>His expertise covers a wide range of technologies, including <strong>Microsoft Azure<\/strong>, <strong>Proxmox VE<\/strong>, <strong>Amazon Web Services (AWS)<\/strong>, and numerous other virtualization and cloud platforms.<\/em><\/p>\n<p><em>Beyond running his hosting business, \u0141ukasz also provides <strong>professional paid server configuration and optimization services<\/strong> for companies and individuals. Outside of work, he is dedicated to caring for his children and building a secure future for them.<\/em><\/p>\n<p><em>If you are interested in working with him or need expert assistance with your hosting, cloud environment, or server setup, feel free to reach out via <a href=\"https:\/\/ca.netcloud24.com\" target=\"_blank\" rel=\"dofollow\">Windows VPS<\/a>.<\/em><\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0 \u00a0 MediaWiki is an open-source platform used to power Wikipedia and many other wiki-based websites. It is ideal for creating collaborative knowledge bases and is widely used\u2026<\/p>\n","protected":false},"author":1,"featured_media":3421,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[],"tags":[14,12,11,23,20,21,22,17,7,8,6,10,18,19,15,24,16,5,13,9],"class_list":["post-2042","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","tag-cheapvps","tag-cloudvps","tag-hostingvps","tag-rds","tag-rdscal","tag-remotedesktop","tag-remotedesktopvps","tag-servervps","tag-ukvps","tag-virtualserver","tag-vpshosting","tag-vpsserver","tag-vpssolutions","tag-vpswindows","tag-vpswithwindows","tag-windowsrds","tag-windowsserver","tag-windowsvps","tag-windowsvpshosting","tag-windowsvpsuk"],"jetpack_publicize_connections":[],"_links":{"self":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/2042","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=2042"}],"version-history":[{"count":0,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/2042\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/media\/3421"}],"wp:attachment":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=2042"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=2042"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=2042"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}