# DDEV
- About DDEV
- Install Lima and configure
- Install DDEV and dependencies
- Using DDEV with a platform.sh project
# Create a local environment for platform.sh projects
Historically we’ve used Lando to spin up PSH project locally. However to quote PSH;
The recommended tool for local development with Platform.sh is DDEV. The integration with DDEV is maintained by Platform.sh to ensure it works smoothly. Other Docker-based tools are also supported, such as Docksal and Lando.
The environments run a lot quicker than on Lando/Docker Desktop and the CLI processes are extrememly similar. If you do decide to move to use DDEV and to fully utilise the speed, you’ll need to use it with Lima (opens new window) and not Docker Desktop (opens new window) (although it is compatible with the latter). The real speed increases come with using Lima, which is lighter and more efficient than Docker Desktop.
The recommendation is to move wholesale to use DDEV instead of Lando. By doing so you can uninstall Docker Desktop and install Lima.
# Install Lima and dependencies
Install Lima with brew install lima.
If you don’t have the docker client (if docker help fails) then install it with brew install docker.
Create a 100GB VM in Lima with 4 CPUs and 6GB memory. Adjust to your own needs:
limactl create --name=default --vm-type=vz --mount-type=virtiofs --mount-writable --memory=6 --cpus=4 --disk=100 template://docker
docker context create lima-default --docker "host=unix://$HOME/.lima/default/sock/docker.sock"
docker context use lima-default
Edit ~/.lima/default/lima.yaml to add the mount for where you store your local repos. e.g.;
mounts:
- location: /Volumes/Repos
writable: true
Then you can start Lima;
limactl start
If and when you ever restart your computer, you’ll need to run limactl start again.
# Install DDEV and dependencies
Full installation documentation (opens new window)
# Install DDEV
brew install ddev/ddev/ddev
# One-time initialization of mkcert
mkcert -install
# Using DDEV with a platform.sh project
ddev config global --web-environment-add=PLATFORMSH_CLI_TOKEN=API_TOKEN API token generated in your account at https://console.platform.sh
Follow the remaining steps at https://docs.platform.sh/development/local/ddev.html
# Projects yet to be installed with ddev (no .ddev folder)
Remove _www alias if it exists in the root of your project (breaks the config at next step)
ddev config
Run the ddev/platformsh configuration
ddev get ddev/ddev-platformsh
You'll be asked for the project ID and the name of the primary environment. Enter when prompted. Restart the project after you've applied this config;
ddev restart
# Projects already installed with ddev (.ddev folder present in root of project)
ddev start
# To get all files and the database;
ddev pull platform --environment=PLATFORM_ENVIRONMENT=main
Change the environment name (main, staging, etc.) to get the correct DB/files You can also append —skip-db or —skip-files to that command to do just that.