DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
The Latest "Software Integration: The Intersection of APIs, Microservices, and Cloud-Based Systems" Trend Report
Get the report
  1. DZone
  2. Coding
  3. Frameworks
  4. Install Drupal on Ubuntu 18.04

Install Drupal on Ubuntu 18.04

In this post, we are going to learn how to install Drupal onto an Ubuntu 18.04 instance. Drupal is a web-based Content Management System.

Bill Ward user avatar by
Bill Ward
·
Sep. 19, 18 · Tutorial
Like (1)
Save
Tweet
Share
12.98K Views

Join the DZone community and get the full member experience.

Join For Free

Preparing Your Server

You will want a fresh install of Ubuntu Server 18.04 that is fully updated.

Be sure to reboot to use any new Linux Kernel updates.

apt update && apt upgrade -y
reboot

Wait for the server to finish rebooting.

Since Drupal is a PHP-based application we need to install a LAMP stack first.

Follow this article to Install a LAMP Stack: Install LAMP on Ubuntu 18.04

In addition to the base LAMP stack, we will need to install several PHP modules required by Drupal.

apt install php-dompdf php-gd php-xml php-mysql

We also need to enable the Apache Rewrite module for Drupal to have Clean URLs.

Open the default Apache site configure file /etc/apache2/sites-enabled/000-default.conf.

Add the following lines before the closing </VirtualHost> tag:

        <Directory /var/www/html>
                AllowOverride All
                Order allow,deny
                Allow from all
        </Directory>
</VirtualHost>

Next, enable the rewrite module.

a2enmod rewrite

Restart Apache for the modules to be loaded.

systemctl restart apache2

We can now download and install Drupal

Downloading Drupal

Ensure you are logged in and sudo as root.

sudo su -

Download the latest version of Drupal (v 8.5.6 as of this writing) using this command.

wget https://ftp.drupal.org/files/projects/drupal-8.5.6.tar.gz

You can get the latest version link by going to the Drupal Downloads Page.

After the file is done downloading we need to unpack the tarball.

tar -xzvf drupal-8.5.6.tar.gz

Move the contents to your web root directory.

mv drupal-8.5.6/* /var/www/html
mv drupal-8.5.6/.htaccess /var/www/html/

Next, we need to update the permissions of the files so Apache can access them.

chown www-data:www-data -R /var/www/html

We are now ready to create a database for Drupal.

Create Drupal Database

First, start the MySQL CLI.

# mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.23-0ubuntu0.18.04.1 (Ubuntu)

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

Next, create the database with this command:

mysql> CREATE DATABASE drupal DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;

Create a Drupal user:

mysql> GRANT ALL ON drupal.* TO 'drupal'@'localhost' IDENTIFIED BY 'password';

Be sure to set a more secure password than the one I gave.

Finally, flush the privileges and exit.

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> exit;
Bye

We can now begin the web configuration of Drupal

Drupal Web Configuration

Open a web browser and go to the URL of your server.

http://{your_server}

You will see the Drupal setup wizard.

Image title

Select your language and click on the Save and continue button.

Image title

Select the profile. Typically, you will select Standard.

Next, click on Save and continue.

Drupal will then verify all the requirements. They should all be OK.

Click on Save and continue.

Drupal will now ask for the database info for the database we created earlier.

Image title

Enter the database name and username as Drupal. Enter the password you set earlier for the Drupal database user password.

Click on Save and continue.

The last step of the setup process is configuring your Drupal site.

Image title

Enter all the details for your site then click on Save and continue to finish.

Image title

You will then see the Admin site for your new Drupal website.

Conclusion

In this post, you learned how to install Drupal on Ubuntu 18.04.

I hope you enjoyed this post and that it was helpful.

If you liked it then please share it and comment below.

Click here for more great Ubuntu articles on AdminTome Blog.

Drupal ubuntu

Published at DZone with permission of Bill Ward, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Stop Using Spring Profiles Per Environment
  • Fargate vs. Lambda: The Battle of the Future
  • Introduction to Container Orchestration
  • What Are the Benefits of Java Module With Example

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: