Skip to content

Instantly share code, notes, and snippets.

@davidjguru
Created April 20, 2020 17:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidjguru/0659a2b3c9e9d92370410480c0fd99cd to your computer and use it in GitHub Desktop.
Save davidjguru/0659a2b3c9e9d92370410480c0fd99cd to your computer and use it in GitHub Desktop.
Local environments for Drupal 8 | 9: Install & Configure DDEV and the Docker Engine

Update the list of packages

sudo apt update

Install prerequisite packages

sudo apt install -y build-essential apt-transport-https ca-certificates jq curl software-properties-common file

Install docker

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt update
sudo apt install -y docker-ce
sudo chmod 666 /var/run/docker*
Test if docker is running or not
systemctl is-active docker

Install Docker Compose

VERSION=$(curl --silent https://api.github.com/repos/docker/compose/releases/latest | jq .name -r)
DESTINATION=/usr/local/bin/docker-compose
sudo curl -L https://github.com/docker/compose/releases/download/${VERSION}/docker-compose-$(uname -s)-$(uname -m) -o $DESTINATION
sudo chmod 755 $DESTINATION
docker-compose --version

Install & Configure DDEV

Installing Linuxbrew

yes | sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"
yes | test -d /.linuxbrew && eval $(/.linuxbrew/bin/brew shellenv)
yes | test -d /home/linuxbrew/.linuxbrew && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
yes | test -r /.bash_profile && echo "eval $($(brew --prefix)/bin/brew shellenv)" >>/.bash_profile
echo "eval $($(brew --prefix)/bin/brew shellenv)" >>~/.profile

Install ddev or update if exists

brew tap drud/ddev && brew install ddev
brew upgrade ddev

Check the DDEV installation

ddev version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment