Craft CMS - markhowellsmead/helpers GitHub Wiki

Installation

Sites run via Docker (DDEV).

Startup local

  • Start Docker Desktop. Each container includes the db and web servers.
  • Run ddev start on the command line. This starts up the necessary containers (web and db servers), because DDEV doesn’t auto-start your project containers just by starting Docker Desktop. You have to do this for each project, which tells Traefik to register the services and bring up web and db servers.
  • Call site in the browser using the domain defined in the .env file in the webroot.

Database connections with DDEV

CRAFT_DB_SERVER=db
CRAFT_DB_PORT=3306
CRAFT_DB_DATABASE=db
CRAFT_DB_USER=db
CRAFT_DB_PASSWORD=db

Mailpit

Craft CLI

Commands

Errors

Exception 'craft\errors\DbConnectException' with message 'Craft CMS can’t connect to the database.'

If you're using ddev to run the local site, call e.g. ddev craft help and not php craft help.

Download site to local via command line

A work in progress. Get a starter Craft CMS site up-and-running first using DDEV and then pull the live site down into that installation.

The code at https://github.com/markhowellsmead/helpers/blob/master/Craft%20CMS/fromlive.sh will be maintained.

Remote Backups

Automated off-site backups of a Craft CMS website.