Set up a local development Drupal site on the latest Ubuntu LTS version and more

The recommended Drupal local development environment for Linux, macOS, and Windows is DDEV. Follow the instructions to install Drupal using DDEV for local development.

Guidance for setting up a LAMP stack (Linux, Apache, MySQL, and PHP) running Ubuntu (a popular Linux distribution), running either directly on your machine or under a virtual machine (VM) on another operating system.

QUICKSTART

You only need the two chapters starting with "Set up .." below. The rest has more of a Get What You Need approach and likely works also on non-Linux systems.

Intro

Why only the latest Ubuntu Long Term Support (LTS) version is targeted.

Alternative approaches

Virtual machines and containerised solutions such as Docker are valid alternatives.

Set up a local development environment

Set up required dependencies such as Composer, Apache2, PHP and MySQL. Also describes Apache Virtual Hosts and dnsmasq.

Set up Drupal 8

Use composer (recommended) to install Drupal. Plus a zip file with different colored Drupal logos to use as favicons .

Version Control System

Facilitate cooperation with others in your team by using a central code repository under version control by using GIT.

Optional setup related to development

Tools like Drush, Drupal Console, the error log, Code Sniffer, linting, PHP Mess Detector, PHPUnit, Gulp, phpMyAdmin, patchutils and ngrok.

A development automation example using Git hooks

Generate an SQL dump automatically after git merge. Using the commit hash in the file name, so we know what code base it "belongs" to.

What's more?

Multi site setup, password protect the staging server, settings.local.php, caching mechanism, search and consuming external services.

Know your tools

Investing time to know your developer toolset saves time later and improves your work.

Troubleshooting and other resources

Links with local environment related issues and how to solve them. Links to similar info about a local Drupal development environment.

Guide maintainers

gopisathya's picture
lolandese's picture
clemens.tolboom's picture