Drupal is a powerful and widely used Content Management System (CMS) that allows individuals and organizations to build and maintain their websites. With its open-source nature and strong community support, Drupal has become a go-to choice for millions of users worldwide. In this guide, we will walk you through the step-by-step process of installing Drupal on Ubuntu 23.10, ensuring that you have a smooth and successful installation experience.
1. Update the System
Before we begin the installation process, let’s ensure that our system is up to date. Run the following commands to update the system packages:
apt update -y apt upgrade -y
2. Install MariaDB Server
Next, we need to install MariaDB, a popular open-source relational database management system. Run the following command to install MariaDB:
apt install -y mariadb-server mariadb-client
Once the installation is complete, we need to secure our database server. Set a root password, disable root remote logins, and remove test databases by running the following command:
mysql_secure_installation
3. Secure your Database Server
During the secure installation process, you will be prompted to set a root password for your MariaDB server. It is essential to choose a strong password and remember it for future use. You will also be asked to remove anonymous users, disallow remote root login, and remove the test database. Follow the prompts to complete the secure installation.
4. Create a Drupal Database
Now that our database server is secure, we can create a database specifically for Drupal. Log in to the MariaDB server as the root user by running the following command:
mysql -u root -p
Enter the root password when prompted. Once logged in, create a new database for Drupal and a user with the necessary privileges. Replace ‘password’ with a strong password of your choice.
CREATE DATABASE drupal; CREATE USER 'drupal_user'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON drupal.* to drupal_user@'localhost'; FLUSH PRIVILEGES;
Exit the MariaDB server by typing q
.
5. Install PHP and Necessary Modules
To run Drupal, we need to install PHP along with several required modules. Run the following command to install PHP and the necessary modules:
apt install php php-{cli,fpm,json,common,mysql,zip,gd,intl,mbstring,curl,xml,pear,tidy,soap,bcmath,xmlrpc}
6. Install Apache Web Server
We will be using Apache as our web server for Drupal. Install Apache and the required PHP module for Apache with the following command:
apt install apache2 libapache2-mod-php
7. Update PHP Timezone and Memory Limit
To ensure that Drupal functions correctly, we need to update the PHP timezone and memory limit configuration. Open the PHP configuration file using your preferred text editor:
nano /etc/php/*/apache2/php.ini
Within the file, locate the memory_limit
and date.timezone
directives and modify them as follows:
memory_limit = 256M date.timezone = UTC
Save the changes and exit the text editor.
8. Download and Extract Drupal
Now, let’s download the latest version of Drupal and extract it into the appropriate directory. Run the following commands to download and extract Drupal:
wget https://www.drupal.org/download-latest/tar.gz -O drupal.tar.gz tar xvf drupal.tar.gz mv drupal-*/ /var/www/html/drupal
9. Configure Apache Web Server for Drupal
To configure Apache for Drupal, we need to create a virtual host configuration file. Open a new configuration file with your preferred text editor:
nano /etc/apache2/sites-available/drupal.conf
Add the following content to the file, replacing drupal.domainhere.info
with your actual domain name:
<VirtualHost *:80>
ServerName drupal.domainhere.info
ServerAdmin admin@drupal.domainhere.info
DocumentRoot /var/www/html/drupal/
CustomLog ${APACHE_LOG_DIR}/access.log combined
ErrorLog ${APACHE_LOG_DIR}/error.log
<Directory /var/www/html/drupal>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</Directory>
</VirtualHost>
Save the changes and exit the text editor.
10. Install Certbot for SSL Certificate
To secure our Drupal installation, we can obtain an SSL certificate using Certbot, a tool that simplifies the process of obtaining and renewing Let’s Encrypt SSL certificates. Install Certbot and the Apache Certbot plugin by running the following command:
apt install certbot python3-certbot-apache
Once the installation is complete, generate an SSL certificate for your Drupal site by executing the following command. Replace drupal.domainhere.info
with your actual domain name:
certbot --apache -d drupal.domainhere.info
Follow the prompts to generate and install the SSL certificate.
11. Access Drupal Configuration Page
After completing the previous steps, we are ready to access the Drupal configuration page and proceed with the installation. Open your web browser and enter the URL http://drupal.domainhere.info
, replacing drupal.domainhere.info
with your actual domain name.
On the configuration page, select an installation profile that suits your needs and click “Save and Continue”.
12. Complete the Drupal Installation
On the next page, you will be prompted to configure the database settings for Drupal. Enter the database name, username, and password that we set up earlier. Click “Save and Continue” to proceed.
Wait for the installation process to complete. Once finished, you will be directed to the final steps of the Drupal installation. Follow the on-screen prompts to configure your site details, including the site name, email address, and administrator credentials.
Congratulations! You have successfully installed Drupal on your Ubuntu 23.10 server. You can now start exploring the powerful features and customization options that Drupal offers to create and manage your website efficiently.
For reliable and scalable hosting solutions tailored to your Drupal needs, consider Shape.host’s Linux SSD VPS services. Shape.host provides secure and high-performance cloud hosting solutions, ensuring the smooth operation of your Drupal site. Visit Shape.host today to experience top-notch hosting services.