{"id":1983,"date":"2024-02-06T15:05:55","date_gmt":"2023-04-06T03:12:01","guid":{"rendered":""},"modified":"2025-02-02T00:46:17","modified_gmt":"2025-02-01T23:46:17","slug":"how-to-install-moodle-lms-on-ubuntu-24-04-server","status":"publish","type":"post","link":"https:\/\/netcloud24.com\/knowledgebase\/how-to-install-moodle-lms-on-ubuntu-24-04-server\/","title":{"rendered":"Linux VPS &#038; VPS Windows Setup Guide | NetCloud24 Moodle LMS on Ubuntu 24.04 Server"},"content":{"rendered":"<p>\u00a0<\/p>\n<\/p>\n<header>\n<h1>\u00a0<\/h1>\n<\/header>\n<section>\n<p>Moodle is a widely-used, open-source Learning Management System (LMS) that allows educators to create online courses. If you\u2019re running Ubuntu 24.04 and want to set up Moodle on your server, this guide will walk you through the installation process. This setup is ideal for both local servers and <strong>VPS servers<\/strong>.<\/p>\n<h2>Step 1: Update Your Server<\/h2>\n<p>Before installing any software, it&#8217;s important to ensure your server is up to date. Run the following command in your terminal:<\/p>\n<pre><code>sudo apt update &amp;&amp; sudo apt upgrade -y<\/code><\/pre>\n<h2>Step 2: Install Apache, MySQL, and PHP<\/h2>\n<p>Moodle requires a web server (Apache), a database server (MySQL), and PHP. Use the following commands to install the necessary software:<\/p>\n<pre><code>sudo apt install apache2 mysql-server php libapache2-mod-php php-mysql php-xml php-mbstring php-zip php-intl php-curl php-soap -y<\/code><\/pre>\n<p>Once the installation is complete, enable and start the Apache and MySQL services:<\/p>\n<pre><code>\r\nsudo systemctl enable apache2\r\nsudo systemctl start apache2\r\nsudo systemctl enable mysql\r\nsudo systemctl start mysql\r\n        <\/code><\/pre>\n<h2>Step 3: Create a MySQL Database for Moodle<\/h2>\n<p>Next, you need to create a database and user for Moodle in MySQL. Start by logging into the MySQL shell:<\/p>\n<pre><code>sudo mysql<\/code><\/pre>\n<p>Create a new database and user, then grant all privileges to that user:<\/p>\n<pre><code>\r\nCREATE DATABASE moodle;\r\nCREATE USER 'moodleuser'@'localhost' IDENTIFIED BY 'yourpassword';\r\nGRANT ALL PRIVILEGES ON moodle.* TO 'moodleuser'@'localhost';\r\nFLUSH PRIVILEGES;\r\nEXIT;\r\n        <\/code><\/pre>\n<h2>Step 4: Download and Set Up Moodle<\/h2>\n<p>Download the latest version of Moodle from the official website. Navigate to your web server\u2019s root directory and download Moodle:<\/p>\n<pre><code>\r\ncd \/var\/www\/html\r\nsudo wget https:\/\/download.moodle.org\/download.php\/direct\/stable400\/moodle-latest-400.tgz\r\n        <\/code><\/pre>\n<p>Extract the downloaded file and change the ownership of the Moodle directory to the Apache user:<\/p>\n<pre><code>\r\nsudo tar -zxvf moodle-latest-400.tgz\r\nsudo mv moodle \/var\/www\/html\/moodle\r\nsudo chown -R www-data:www-data \/var\/www\/html\/moodle\r\nsudo chmod -R 755 \/var\/www\/html\/moodle\r\n        <\/code><\/pre>\n<h2>Step 5: Configure Apache for Moodle<\/h2>\n<p>Create a new virtual host configuration file for Moodle in Apache:<\/p>\n<pre><code>sudo nano \/etc\/apache2\/sites-available\/moodle.conf<\/code><\/pre>\n<p>Add the following configuration to the file:<\/p>\n<pre><code>\r\n\r\n    ServerAdmin admin@yourdomain.com\r\n    DocumentRoot \/var\/www\/html\/moodle\r\n    ServerName yourdomain.com\r\n    ServerAlias www.yourdomain.com\r\n\r\n    \r\n        Options FollowSymlinks\r\n        AllowOverride All\r\n        Require all granted\r\n    \r\n\r\n    ErrorLog ${APACHE_LOG_DIR}\/moodle_error.log\r\n    CustomLog ${APACHE_LOG_DIR}\/moodle_access.log combined\r\n\r\n        <\/code><\/pre>\n<p>Enable the new virtual host and rewrite module, then restart Apache:<\/p>\n<pre><code>\r\nsudo a2ensite moodle.conf\r\nsudo a2enmod rewrite\r\nsudo systemctl restart apache2\r\n        <\/code><\/pre>\n<h2>Step 6: Complete Moodle Installation via Web Browser<\/h2>\n<p>Now that Moodle is set up on the server, open a web browser and navigate to:<\/p>\n<pre><code>http:\/\/yourdomain.com<\/code><\/pre>\n<p>Follow the on-screen instructions to complete the installation. You will be asked to enter the database details you created earlier (database name, username, and password).<\/p>\n<h2>Managing Moodle on a VPS Server<\/h2>\n<p>Running Moodle on a <strong>VPS server<\/strong> offers great performance and flexibility. Whether you&#8217;re hosting a small educational platform or a large online learning system, a <strong>VPS<\/strong> gives you full control over your environment.<\/p>\n<h2>Looking for Reliable VPS Hosting?<\/h2>\n<p>If you&#8217;re looking for a powerful and reliable <strong>VPS server<\/strong> to host Moodle LMS, consider . With <strong>Windows VPS<\/strong>, you can easily manage your Moodle installation and ensure smooth performance for your online courses.<\/p>\n<footer>\n<p>For more guides and VPS server solutions, visit <a href=\"https:\/\/ie.netcloud24.com\" target=\"_blank\" rel=\"follow\">netcloud24.com<\/a>.<\/p>\n<\/footer>\n<\/section>\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 Moodle is a widely-used, open-source Learning Management System (LMS) that allows educators to create online courses. If you\u2019re running Ubuntu 24.04 and want to set up\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-1983","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\/1983","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=1983"}],"version-history":[{"count":0,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1983\/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=1983"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=1983"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=1983"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}