Drupal is an open-source content management system (CMS) that helps you build everything from simple websites to complex applications. It’s well-known for its flexibility, scalability, and ability to create various types of websites, including blogs, e-commerce platforms, intranets, and more.

More Information About Drupal

Drupal’s powerful framework allows for:

  • Content management: Manage and structure content, user roles, and permissions easily.
  • E-commerce: With Drupal Commerce, you can set up full-featured online stores.
  • Multi-language support: Drupal provides seamless language translation, making it ideal for global websites.
  • Security: Known for its robust security features, it’s used by governments, large corporations, and nonprofits worldwide.
  • Custom themes and modules: Highly customizable to suit any design or functionality requirements.

Drupal is an excellent choice for websites requiring flexibility, complex content structures, and strong security.


Step 1: Create an Instance on Cloud.shape.host

Step 1.1: Access the Dashboard

  1. Log in to Cloud.shape.host.
  2. Click Create, then select Instances.
Shape.host Resources dashboard with Create > Instance highlighted.

Step 1.2: Choose a Datacenter Location

Select a location closest to your audience, such as New York or London.

Shape.host instance form with the data center location selector highlighted.

Step 1.3: Choose a Plan

Pick a plan that fits your Drupal needs, such as Standard or CPU-Optimized.

Step 1.4: Select an Operating System

Choose AlmaLinux 9 as your OS.

Shape.host instance form with the operating system image selector highlighted.

Step 1.5: Configure and Launch

Set your network and authentication settings, then click Create Instance.

Shape.host instance form with the Create Instance button highlighted.

Step 1.6: Locate your Instance’s IP

Shape.host Resources dashboard with the server IP address highlighted.

Step1.7: Connect to Your AlmaLinux Instance

Once your instance is created on Cloud.shape.host, follow the steps below to connect:

1. For Linux/macOS:

Open a terminal and use SSH to connect:

   ssh root@<your-instance-ip>

Replace <your-instance-ip> with the public IP of your AlmaLinux instance.

2. For Windows:

Download and install PuTTY, then:

  • Enter your instance IP in the Host Name field.
  • Click Open to initiate the connection.

Once connected, you’ll have terminal access to manage your AlmaLinux instance.


Step 2: Update the System

Update your system packages to ensure they are up to date:

dnf update

This updates the software repository index and upgrades all packages installed on your server.

Terminal showing DNF/YUM package management commands and output.

Step 3: Install Apache, PHP, and MariaDB

First, add the necessary repositories for PHP and install the LAMP stack (Linux, Apache, MariaDB, PHP):

dnf install epel-release dnf-utils http://rpms.remirepo.net/enterprise/remi-release-9.rpm
Terminal showing DNF/YUM package management commands and output.

Reset the default PHP module and enable PHP 8.3:

dnf module reset php
dnf module enable php:remi-8.3
Terminal showing DNF/YUM package management commands and output.

Next, install Apache, MariaDB, and PHP along with required PHP modules for Drupal:

dnf install httpd mariadb-server php php-cli php-devel php-mbstring php-gd php-xml php-curl php-mysqlnd php-pdo php-json php-opcache php-pear php-pecl-apcu php-pecl-crypto
Terminal showing DNF/YUM package management commands and output.

Step 4: Start and Enable Apache and MariaDB

Start and enable Apache and MariaDB services to automatically run on system boot:

systemctl start httpd
systemctl enable httpd
systemctl start mariadb
systemctl enable mariadb
Terminal showing systemd service management commands or output.
Terminal showing systemd service management commands or output.

This ensures that both the web server and database server are running and will start on boot.


Step 5: Configure the Firewall

Open the firewall for HTTP and HTTPS traffic:

systemctl unmask firewalld
systemctl start firewalld
firewall-cmd --add-service={http,https} --permanent
firewall-cmd --reload
firewall-cmd --list-all

This allows your server to accept web traffic on ports 80 (HTTP) and 443 (HTTPS).

Terminal showing systemd service management commands or output.

Step 6: Configure PHP

Edit the PHP configuration file to set the memory limit and other necessary options:

nano /etc/php.ini

Modify the following values:

memory_limit = 512M
upload_max_filesize = 60M
max_execution_time = 300
date.timezone = Europe/Stockholm

To add file upload tracking, install the uploadprogress module:

pecl install uploadprogress
Terminal showing php commands or output during Configure PHP.
Terminal showing php commands or output during Configure PHP.

Then, create a configuration file for the module:

cat <<EOF | sudo tee /etc/php.d/uploadprogress.ini
; configuration for php uploadprogress module
; priority 15
extension=uploadprogress.so
EOF
Terminal showing php commands or output during Configure PHP.

Restart Apache to apply the changes:

systemctl restart httpd
php -m | grep uploadprogress
Terminal showing systemd service management commands or output.
Terminal showing systemd service management commands or output.

Step 7: Secure MariaDB and Create Database

Secure the MariaDB installation:

mariadb-secure-installation
Terminal showing MariaDB/MySQL database security configuration prompts.
Terminal showing mariadb commands or output during Secure MariaDB and Create Database.

Log in to MariaDB and create a database for Drupal:

mariadb -u root -p

Run the following SQL commands:

CREATE DATABASE drupaldb;
CREATE USER 'drupal'@'localhost' IDENTIFIED BY 'p4ssword';
GRANT ALL PRIVILEGES ON drupaldb.* TO 'drupal'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
SHOW GRANTS FOR 'drupal'@'localhost';
Terminal showing SQL database and user configuration commands.

This creates a database, a user, and grants them the necessary permissions.


Step 8: Download and Install Drupal

Navigate to the /var/www/ directory and download Drupal:

cd /var/www/
wget https://www.drupal.org/download-latest/tar.gz -O drupal.tar.gz
tar -xvf drupal.tar.gz
mv drupal-* drupal
chown -R apache:apache /var/www/drupal/
chmod -R 755 /var/www/drupal/
Terminal showing file and directory setup commands.
Terminal showing file download commands and transfer output.
Terminal showing tar commands or output during Download and Install Drupal.
Terminal showing file and directory setup commands.
Terminal showing file ownership or permission commands.

This downloads the latest version of Drupal and sets the correct permissions for Apache.


Step 9: Configure Apache Virtual Host for Drupal

Create a new virtual host configuration file for Drupal:

nano /etc/httpd/conf.d/drupal.conf

Insert the following configuration, replacing example.com with your domain:

<VirtualHost *:80>
 ServerName example.com
 ServerAdmin admin@example.com
 DocumentRoot /var/www/drupal

 ErrorLog /var/log/httpd/example.com.error.log
 CustomLog /var/log/httpd/example.com.access.log combined

 <Directory /var/www/drupal>
 Options FollowSymlinks
 AllowOverride All
 Require all granted
 </Directory>

 <Directory /var/www/drupal/>
 RewriteEngine on
 RewriteBase /
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
 </Directory>
</VirtualHost>
Terminal showing web server configuration text.

Save and close the file, then test the Apache configuration:

apachectl configtest
systemctl restart httpd
Terminal showing an Apache configuration test.
Terminal showing systemd service management commands or output.

Step 10: Install SSL and Enable HTTPS

Install Certbot and the Apache plugin to secure your site with an SSL certificate:

dnf install certbot python3-certbot-apache
certbot --apache --agree-tos --redirect --hsts --staple-ocsp --email contact@shape.host -d almalinux.shape.host
Terminal showing DNF/YUM package management commands and output.

This installs an SSL certificate and forces all traffic to use HTTPS.

Terminal showing Certbot certificate commands and messages.

Step 11: Access Drupal via Browser

Open your browser and navigate to:

https://almalinux.shape.host

Follow the Drupal setup wizard to complete the installation.

Drupal installer language selection.

For the installation profile, select Standard if you’re first time installing Drupal, then click Save and continue.

Drupal installation profile selection.

After the system check is complete, you will see the database configuration for Drupal. Input details of your MariaDB database information, click Save and continue again.

Drupal database configuration form.

Once the installation is complete, input details of your Drupal site information and create a new admin user for Drupal. Then, click Save and continue to confirm.

Drupal site and administrator account configuration form.

Drupal settings interface.

When the configuration is finished, you will get the Drupal homepage like the following:

Drupal welcome page after installation.

You have successfully installed Drupal on AlmaLinux 9. With its robust content management capabilities and scalability, Drupal is ideal for websites of all sizes. For reliable hosting and performance, consider using Shape.Host’s Cloud VPS to host your Drupal instance effectively.