Skip to content

Instantly share code, notes, and snippets.

@mabumusa1
Last active September 7, 2022 18:42
Show Gist options
  • Save mabumusa1/bc2ddc3b83bb05e740df58d524b601f3 to your computer and use it in GitHub Desktop.
Save mabumusa1/bc2ddc3b83bb05e740df58d524b601f3 to your computer and use it in GitHub Desktop.
Mautic DDEV Installation

Prepare Your Mautic Development Environment

The purpose of this document is to setup a development enviroment that runs on Microsoft Windows.

Tools

  1. DDev
  2. Choco
  3. Docker Compsoe
  4. WSL 2
  5. Ubuntu
  6. Visual Studio Code

Getting Started

Before starting the installation process, you need to verify that you have the minumum required versions of some software

Minimum Required Versions

  1. Windows 10 (version 1903.1049, 1909.1049, 2004 or later)
  2. Docker Version 18.06 or higher
  3. Docker-compose 1.21.0 and higher (bundled with Docker in Docker Desktop for Mac and Docker Desktop for Windows)
  4. PowerShell v2+
  5. .NET Framework 4+

Verify Minimum Versions

  1. Run winver.exe to get the version of your windows
  2. Run PowerShell and then run Get-Host | Select-Object Version
  3. Run PowerShell and then run (Get-ItemProperty "HKLM:SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full").Release -ge 394802if you see in the terminal truethen you meet the minumim requirment.
  4. If you have Docker Toolbox installed, remove it.

Start the Installation

Install of Chocolatey

Chocolatey is package manager for windows, that allows you to install software using Powershell and automate many of your processes.

  1. Run PowerShell as Administrator
  2. Run Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
  3. Run choco install -y mkcert
  4. Run mkcert -install
  5. Run setx CAROOT "$(mkcert -CAROOT)"; If ($Env:WSLENV -notlike "*CAROOT/up:*") { setx WSLENV "CAROOT/up:$Env:WSLENV" }

Install WSL

Windows Subsystem for Linux is allow developer to run Linux inside windows, which will make your life easier

  1. Run PowerShell with administrator privileges
  2. Run Enable-WindowsOptionalFeature -Online -FeatureName $("VirtualMachinePlatform", "Microsoft-Windows-Subsystem-Linux")Computer will reboot
  3. Download WSL2 Linux kernel, from this url
  4. Make WSL2 as the default version using wsl --set-default-version 2
  5. Install Ubuntu via this link

Install and configure Docker

  1. Run PowerShell with administrator privileges
  2. Run choco install docker-desktop
  3. Go to Docker Desktop settings > Resources > WSL integration > enable integration for your distro (now docker commands will be available from within your WSL2 distro).
  4. In PowerShell run wsl -l -v should show three distros, and your Ubuntu should be the default. All three should be WSL version 2.
  5. Double-check in Ubuntu: echo $CAROOT should show something like /mnt/c/Users/<you>/AppData/Local/mkcert
  6. Check that docker is working inside Ubuntu: docker ps

Install Linuxbrew

  1. Open the WSL2 terminal, for example Ubuntu from the Windows start menu.
  2. /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
  3. Add brew to path echo 'eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)' >> ~/.profile && source ~/.profile

Install DDEV

  1. Inside WSL2 terminal, run brew install gcc && brew tap drud/ddev && brew install ddev
  2. Install required tools for DDEVsudo apt-get update && sudo apt-get install -y xdg-util

Configure SSH Key

  1. ssh-keygen -C "[email protected]"
  2. Add your key to Github
  3. Test your connection to Github ssh -T [email protected]
  4. git config --global user.email "[email protected]"
  5. git config --global user.name"First Name Last Name"

Fork Mautic

  1. Go to https://github.com/mautic/mautic, then click on Fork
  2. git clone [email protected]:mabumusa1/mautic.git code
  3. cd code
  4. git remote add upstream https://github.com/mautic/mautic.git

Configure DDEV

  1. ddev configYou can find all the configuration parameter here
name: mautic
type: php
docroot: ""
php_version: "7.3"
webserver_type:  apache-fpm
router_http_port: "80"
router_https_port: "443"
xdebug_enabled: true
additional_hostnames: []
additional_fqdns: []
mariadb_version: "10.2"
mysql_version: ""
provider: default
use_dns_when_possible: true
composer_version: "1"
webimage_extra_packages: [php7.3-imap]
timezone: "Asia/Amman"
  1. cp ~/.gitconfig ~/code/.ddev/homeadditions/
  2. ddev start
  3. ddev composer install
  4. Visit https://mautic.ddev.site from your browser and install Mautic
  5. For Database configuration you need to use
Username: db
Password: db
Host: db
Email Configuration
Host: localhost
Port: 1025
  1. ddev describe

Contribute to Mautic

  1. ddev ssh
  2. git fetch upstream
  3. git merge upstream staging
  4. git checkout -b xxxx staging
  5. ddev auth ssh
  6. git add -A
  7. git commit -m "Fix the bug"
  8. git push origin XXX
  9. Create a PR on Github
@kuzmany
Copy link

kuzmany commented Jan 6, 2021

Thanks for great manual and presentation.

Just ping your presentation related to this document: https://www.youtube.com/watch?v=K477KWYOp_Y&ab_channel=MauticCommunity

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