Set up DDEV-Local from scratch on macOS

In this video tutorial, we’ll show you how to use DDEV-Local from scratch on macOS.

With a local development environment, it also means you’re working on your projects without risking injury to your live projects.

Follow instructions to install DDEV-Local in the docs or watch this video for an overview.

How to install your Docker-based dev environment with DDEV-Local

These are notes from the video tutorial. You can also check out the detailed install DDEV-Local instructions in the docs.

First: Install Docker for Mac

The minimum requirements to run DDEV-Local are Docker and Docker Compose, which comes bundled on Mac and Windows. DDEV-Local pretty much works anywhere Docker will run.

Next: Install DDEV

Option 1: With Homebrew

You can install DDEV-Local with Homebrew, and if you’re using Mac it’s a handy way to install.

brew tap drud/ddev && brew install ddev

Option 2: Install the DDEV binary with a script

curl https://raw.githubusercontent.com/drud/ddev/master/install_ddev.sh | bash

You run the same script later to upgrade.

Set up your first project with DDEV.

Most of the time you’re working in a repository that includes the web root for your PHP application or website. So the first thing is to cd to change directory so you’re inside that project folder or docroot.

Then you’ll answer 3 questions about the project. DDEV will make a best-guess, and usually, you can just keep the defaults.

  • Project name – DDEV will base the name on the current directory name.
  • Docroot – Again, DDEV will make a guess from the docroot you’re currently in.
  • Project type – DDEV will auto-detect if you’re using a CMS, or use PHP if you’re building a custom application.

The first time you configure a project, it will download the containers you need. In the future, it will come up even faster.

When you’re done, DDEV outputs a URL with the link to quickly view your site in your browser.

Working on a new project? Or an existing one?

If this is a first-time project based on a CMS like TYPO3 CMS or Drupal, you would have to go through the installation steps to set up the site.

Otherwise, you might be loading an existing project, and you’ll want to import an existing database.

These are some good commands to know but check ddev -h to see the complete list.

  • ddev list to see what projects you have running.
  • ddev describe to get information about the project.
  • ddev ssh to SSH into the container.
  • ddev remove to throw away the container but not the database. Pick up your project quickly next time.

Need some help?

We hope the video helps you set up your new web development environment on your Mac. If you get stuck, we’re happy to help.


Photo by Maxime Le Conte des Floris on Unsplash

Please follow and like us: