It’s 2023, and there are boatloads of Drupal hosting providers out there now. Choosing a hosting provider these days can be an arduous task in itself. However, if you are here, you needn’t worry about that because I will now tell you how easy it is to host a Drupal on DigitalOcean, one of the best hosting providers out there.
DigitalOcean is said to be one of the largest hosting companies in the world in terms of web-facing computers. Undoubtedly, it is still considered one of the best hosting companies out there. Simply put, you can’t go wrong with DigitalOcean at Cloudways. With prices starting from only $11/mo, it is also affordable!
In this tutorial, I’ll take you through the steps for installing Drupal on DigitalOcean using Cloudways. You do not have to be an expert in setting up servers in order to host a website of your own, and this is what Cloudways offers you.
Ready to take your Drupal website to the next level?
Host Drupal on DigitalOcean with Cloudways for unbeatable performance, scalability, and ease of use!
Bried Overview of Drupal
Drupal is a powerful and flexible content management system (CMS) that empowers users to easily build and manage websites, blogs, and web applications. Drupal’s modular architecture allows developers to extend its functionality through a vast array of contributed modules, making it highly customizable to suit various needs.
One of Drupal’s key features is it’s ability to handle complex content structures and workflows, making it ideal for large and content-rich websites.
Drupal’s intuitive user interface enables content editors to create, edit, and organize content effortlessly. Moreover, Drupal’s focus on security and frequent updates from the community ensure that websites built with this CMS stay protected against potential vulnerabilities.
Drupal active community, extensive documentation, and continuous updates make it a top choice for organizations seeking a robust and flexible platform for their online presence.
Drupal User Stats
Drupal has remained a prominent player in the content management system landscape, powering over a hundred thousand websites worldwide.
Why Choose DigitalOcean on Clouwdays for Drupal Hosting?
When it comes to hosting a Drupal website, DigitalOcean on Clouwdays is an excellent choice due to its impressive performance, user-friendly interface, and cost-effectiveness. DigitalOcean cloud infrastructure on Clouwdays is well known for its reliable and scalable Drupal hosting, offering a seamless experience for users.
Clouwdays adds value to the hosting experience by offering a tailored environment for Drupal sites. Their platform is optimized for Drupal’s specific requirements, ensuring compatibility, security, and optimal performance. Clouwdays’ one-click Drupal installations simplify the setup process, making it easier for both beginners and experienced users to get started quickly.
Additionally, the user-friendly interface provided by DigitalOcean and Clouwdays makes managing your Drupal hosting a breeze. You can easily deploy, scale, and manage your infrastructure with just a few clicks.
How to Install Drupal on DigitalOcean
Just follow the steps below with screenshots to create and launch your first DigitalOcean droplet to install Drupal CMS.
- Step 1: Sign up or log in to the DigitalOcean platform.
- Step 2: Create a new droplet by clicking Create > Droplets.
- Step 3: On the Create Droplets section, navigate to the setup screen. You have to configure the server specifications and other settings at this stage.
- Step 4: Remove the Add block storage segment and select a data center region for your DO droplet, as shown in the image below. It is recommended to choose the closest location to your target audience.
- Step 5: Next, select an image. For this tutorial, I will go with Debian 10, which is the Linux OS flavor you will install on your server.
- Step 6: Choose the Droplet Type. For this tutorial, I will choose the Basic option.
- Step 7: Choose the server specification you need for your DO droplet. For this example, I’m going to select the most affordable plan.
- Step 8: After the previous step, leave the VPC Network and select the extra alternatives section.
- Step 9: Navigate to the SSH keys section within the Authentication tab. If you have an existing SSH key, select it. If not, create a new one using the PuTTY generator. Please ensure that you have already installed PuTTY.
- Step 10: Open PuTTYgen and click Generate an SSH key, as shown in the image below:
- Step 11: Copy the public key content and save the SSH key by clicking “Save private key.”
- Step 12: Return to your DO server setup screen and click “New SSH Key.”
- Step 13: Paste the text to the SSH key content segment, provide a title (e.g., Cloudways), and click “Add SSH Key.”
- Step 14: Choose a hostname for your droplet. I’m naming it Shahzeb-PHP.
- Step 15: Now, leave all the sections because the server setup is complete, and all you need to do is Create a Droplet.
- Step 16: Wait patiently, as setting up your droplet will take a while. If you see the below screen, it means your Droplet was successfully created.
Deploy the LEMP STACK
Once you have set up your server, you have to deploy the LEMP stack, and here’s how you can do it:
- Step 1: In order to deploy the LEMP stack, first, you need to open PuTTY and paste your server’s IP.
- Step 2: Navigate to Connection > SSH > Auth. Click on the browser and select the PPK file you downloaded from PuTTYgen.
- Step 3: Click “Open” to access your DO server droplet and type root.
- Step 4: Change the directory and access the root file by typing the following command.
- Step 5: Update the package lists by typing the following command.
- Step 6: Next, you need to install the NGINX web server. To do this, run the following command.
apt install nginx
- Step 7: Enter “Y” to continue.
- Step 8: To install the MariaDB database, type the following command.
apt install mariadb-server
- Step 9: Enter “Y” again to continue.
- Step 10: Type the following command to secure your MariaDB installation:
Note: At first, it will ask for the root password, and you just have to press “Enter” (By default, there’s no root password).
- Step 11: If you want to set the root password for your database, press “Y” and update it.
- Step 12: Type the following command to install PHP FPM and MySQL:
apt install php-fpm php-mysql
- Step 13: Edit the default file by typing the command below:
- Step 14: Now we have to install the composer before installing Drupal CMS.
First, make sure you’re in your home directory: cd ~
Then, retrieve the installer using curl:
curl -sS https://getcomposer.org/installer -o composer-setup.php
Next, verify that the installer matches the SHA-384 hash for the latest installer found on the Composer Public Keys / Signatures page.
To output the obtained value, run:
Make sure that you’re in the root directory.
Now execute the following PHP code, as provided in the Composer download page, to verify that the installation script is safe to run:
Your output will be the following:
To install composer globally, use the following command to download and install Composer as a system-wide command named composer under /usr/local/bin:
Test your installation by running this command:
Your output will then display Composer’s version and arguments, similar to the above.
You can install Drupal by simply typing the following command in the terminal:
Drupal has been successfully installed on your DO droplet.
You can access the webpage by adding /drupal-do/web/core/install.php at the end of the IP Address to open the Drupal installer. If you see the welcome page (shown below), everything has been configured successfully.
How to Install Drupal on Cloudways
The very first thing you need to do is Sign Up at Cloudways. You can do this from the main homepage by clicking the “Get Started For Free” button. Sign-up requires a valid email address, a GitHub, or a LinkedIn account.
Launch a New Server
- Sign up for Cloudways;
- Launch a New Server with a Custom PHP Application;
- Choose DigitalOcean as your IaaS provider;
- Select your Server Size;
- Select your Server Location (the nearest, the better).
Launch SSH Terminal
- Go to Servers from the top menubar;
- Go to Server Management;
- Click Launch SSH Terminal.
- Once logged in, go to the public_html folder and simply run the download command to
- download the drupal framework.
Application > application name > public_html
How to Install Drupal 10
This section will demonstrate how to install Drupal 9 easily. If you thought this would be a manual (and hectic) task, here’s a surprise for you – you can install Drupal by simply typing the following command in the terminal:
composer create-project drupal/recommended-project drupal-10
The above command will help install everything automatically, including all the libraries and dependencies required by Drupal.
- Access the Drupal installer by adding /drupal-10/web/core/install.php at the end of the URL.
If you see the above screen, it indicates that you have configured everything successfully.
- Start the installation by clicking the Save and Continue button;
- Select the desired profile for your Drupal application on the next page;
- Click Save and continue.
- Go to your Cloudways Platform.
- Click Applications and select your application.
- Click Access Details under Application Management to get database access details.
It’s mandatory to use cp command to copy the file & set it with the required name.
Run this command: cp default.settings.php settings.php
- Enter your database details into the Drupal setup;
- Click Save and continue to continue the process.
- The site installation process will begin once you enter the database details.
- Once the installation finishes, enter your site’s information and administrative login details.
- Site name: Type your website’s name.
- Site email address: All automated emails will be sent to this email address.
- Username, Password, and Email address: Administrative details required for your account’s maintenance.
- Click Save and continue.
If you see the above message, it indicates that you have successfully installed Drupal on your Cloudways server.
Hosting Drupal on DigitalOcean through Cloudways provides website owners a hassle-free and optimized cloud hosting experience.
With Cloudways, users can deploy Drupal websites on DigitalOcean with just a few clicks. The platform handles server setup, including the installation of the necessary software stack, such as Nginx, Apache, PHP, and Database management
Hosting Drupal on DigitalOcean through Cloudways streamlines the cloud hosting process, providing a powerful and secure environment for building and managing high-performance Drupal websites with ease.
Shahzeb is a Digital Marketer with a Software Engineering background, works as a Community Manager — PHP Community at Cloudways. He is growth ambitious and aims to learn & share information about PHP & Laravel Development through practice and experimentation. He loves to travel and explore new ideas whenever he finds time. Get in touch with him at [email protected]