How to Install Drupal on Debian Latest
Drupal is a powerful content management system used for building and managing websites. It is a free, open-source software that is easy to use and highly customizable. In this tutorial, we will guide you through the process of installing Drupal on Debian Latest.
Prerequisites
Before starting the installation process, make sure that you have the following:
- A fresh installation of Debian Latest.
- A user account with sudo privileges.
- A web server (Apache, nginx) installed and running on your server.
- PHP and MySQL/MariaDB installed.
Step 1: Install Apache, PHP, and MySQL
If you haven't installed Apache, PHP, and MySQL/MariaDB on your server, you can install them using the following command:
sudo apt update
sudo apt install apache2 mysql-server php php-mysql
Step 2: Create a MySQL Database for Drupal
The next step involves creating a MySQL database and user for Drupal. You can do this using the command line or a graphical tool like phpMyAdmin.
Using the Command Line
- Log in to the MySQL shell:
sudo mysql -u root -p
- Create a new database:
CREATE DATABASE drupal_db;
- Create a new user and set a password:
CREATE USER 'drupal_user'@'localhost' IDENTIFIED BY 'password';
- Grant permissions to the new user on the new database:
GRANT ALL PRIVILEGES ON drupal_db.* TO 'drupal_user'@'localhost';
- Flush the privileges:
FLUSH PRIVILEGES;
Step 3: Download Drupal
Download the latest version of Drupal from the official Drupal website using the following command:
wget https://www.drupal.org/download-latest/tar.gz -O drupal.tar.gz
Extract the downloaded file using the following command:
tar -zxvf drupal.tar.gz
Move the extracted Drupal files to the Apache document root directory:
sudo mv drupal-x.x.x/* /var/www/html/
Step 4: Configure Drupal
- Rename the configuration file:
cd /var/www/html
sudo cp sites/default/default.settings.php sites/default/settings.php
- Give the Apache user (
www-data) ownership of the files:
sudo chown -R www-data:www-data /var/www/html/
- Give the Apache user (
www-data) write permissions to thesites/defaultfolder:
sudo chmod -R 755 /var/www/html/sites/default
Set up the Drupal installation using the web-based installer. In your browser, navigate to your server's IP address or domain name, followed by
/install.php.Follow the on-screen instructions to configure the Drupal installation. When prompted for the database settings, enter the database name, username, and password you created in Step 2.
Set up a unique user account for yourself, and then log in to the Drupal dashboard.
Conclusion
Congratulations! You have successfully installed Drupal on Debian Latest. Now you can start building and managing your new Drupal website. If you encounter any issues during the installation process, refer to the Drupal documentation or ask for help on the Drupal community forum.