Craft CMS - Website
This quick-start guide focuses solely on setting up a local Craft development environment. If you’re ready to launch, jump to the hosting or deployment section.
  1. Create a project directory and move into it:
                                                        
    mkdir my-craft-project
    cd my-craft-project/
                                                        
                                                    
  2. Create DDEV configuration files:
                                                        
    ddev config --project-type=craftcms --docroot=web --create-docroot
                                                        
                                                    
  3. Scaffold the project from the official starter project:
                                                        
    ddev composer create -y --no-scripts "craftcms/craft:^4"
                                                        
                                                    
  4. Run the Craft setup wizard, and accept all defaults:
                                                        
    ddev craft install
                                                        
                                                    
WSL / Ubuntu / Docker / DDEV
These are the steps to install WSL / Ubuntu / Docker / DDEV and create Craft CMS installations locally.
  1. Enable Virtualization in BIOS
  2. Open PowerShell (Run as Administrator)
  3. Run the code in PowerShell: (You will be asked to enter a user and password for Ubuntu)
                                                        
    wsl --install
                                                        
                                                    
  4. Restart PC
  5. In Windows Update Settings → Advanced Options enable Receive updates for other Microsoft products. You may want to occasionally run wsl.exe --update as well.
  6. Download and install Docker:
                                                        
    https://www.docker.com/products/docker-desktop/
                                                        
                                                    
  7. Restart PC after install
  8. In Docker Desktop → Settings → Resources → WSL2 Integration, verify that Docker Desktop is integrated with your distro.
  9. Open PowerShell (Run as Administrator) and run script:
                                                        
    Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;
    iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/ddev/ddev/master/scripts/install_ddev_wsl2_docker_desktop.ps1'))
                                                        
                                                    
Composer
These are the steps to install Composer.
  1. Run the code in PowerShell -> WSL:
                                                        
    -wsl
                                                        
                                                    
  2. Run the code in PowerShell -> WSL:
                                                        
    sudo apt update
                                                        
                                                    
  3. Run the code in PowerShell -> WSL:
                                                        
    sudo apt install php-cli unzip
                                                        
                                                    
  4. Downloading and Installing Composer:
                                                        
    cd ~
    curl -sS https://getcomposer.org/installer -o /tmp/composer-setup.php
                                                        
                                                    
  5. Run the code in PowerShell -> WSL:
                                                        
    HASH=`curl -sS https://composer.github.io/installer.sig`
                                                        
                                                    
  6. Run the code in PowerShell -> WSL:
                                                        
    echo $HASH
    
    Output:
    e0012edf3e80b6978849f5eff0d4b4e4c79ff1609dd1e613307e16318854d24ae64f26d17af3ef0bf7cfb710ca74755a
                                                        
                                                    
  7. Verify if installation script is safe to run
                                                        
    php -r "if (hash_file('SHA384', '/tmp/composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
                                                        
                                                    
  8. Run the code in PowerShell -> WSL:
                                                        
    sudo php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer
                                                        
                                                    
  9. To test your installation. Run the code in PowerShell:
                                                        
    composer
                                                        
                                                    
PHP Extensions
Installing the needed PHP Extensions.
  1. Run the code in PowerShell -> WSL:
                                                        
    sudo apt install php-{common,mysql,gmp,curl,intl,mbstring,imagick,fpm,mysql,pgsql,json,xmlrpc,gd,bcmath,xml,cli,zip}
                                                        
                                                    
Github
Set Github up.
  1. Run the code in PowerShell -> WSL:
                                                        
    sudo apt-get install git -y
                                                        
                                                    
  2. Run the code in PowerShell -> WSL:
                                                        
    git config --global user.name "First Last"
                                                        
                                                    
  3. Run the code in PowerShell -> WSL:
                                                        
    git config --global user.email username@ucsd.edu
                                                        
                                                    
  4. Run the code in PowerShell -> WSL:
                                                        
    git config --list
                                                        
                                                    
  5. Run the code in PowerShell -> WSL:
                                                        
    ssh-keygen -t ed25519 -C "your_email@example.com"
                                                        
                                                    
  6. Open the file: /home/"User Name"/.ssh/id_ed25519.pub with Visual Studio and copy the key.
  7. Go to GitHub -> Settings -> SSH and GPG keys -> New SSH Key
  8. Run the code in PowerShell -> WSL:
                                                        
    ssh -T git@github.com
                                                        
                                                    
Craft CMS - Update
  1. Haupt Befehl
                                                        
    /opt/plesk/php/8.3/bin/php /usr/lib/plesk-9.0/composer.phar
                                                        
                                                    
  2. Update (Change composer.json Craft CMS / Plugins Version)
                                                        
    /opt/plesk/php/8.3/bin/php /usr/lib/plesk-9.0/composer.phar update
                                                        
                                                    
  3. Update single Plugin
                                                        
    /opt/plesk/php/8.3/bin/php /usr/lib/plesk-9.0/composer.phar update verbb/formie
                                                        
                                                    
Craft CMS - Plugins (Manually)
  1. Caches leeren
  2. DB-Verbindung konfigurieren
                                                        
    /opt/plesk/php/8.3/bin/php craft setup/db
                                                        
                                                    
  3. Liste aller Plugins
                                                        
    /opt/plesk/php/8.3/bin/php craft plugin/list
                                                        
                                                    
  4. Plugin frisch installieren
  5. Plugin installieren (nicht runterladen, sondern aktivieren)
                                                        
    /opt/plesk/php/8.3/bin/php craft plugin/install ckeditor
                                                        
                                                    
  6. DB-Migrationen durchführen
                                                        
    /opt/plesk/php/8.3/bin/php craft migrate/all
                                                        
                                                    
  7. Caches leeren
                                                        
    /opt/plesk/php/8.3/bin/php craft clear-caches/all
                                                        
                                                    
Craft CMS - Plugins (Disable / Enable - Manually)

Do not remove a plugin package with Composer before uninstalling it from the control panel or with Craft’s CLI. Many plugins include special migrations that perform essential database cleanup, and that is only possible if the source code remains at the time it is uninstalled.

This may require a multi-step deployment to ensure plugins have an opportunity to properly clean up after themselves:

  1. Uninstall the plugin from the control panel or via the CLI;
  2. Commit and deploy the resulting project config changes;
  3. Remove the underlying package from composer.json;
  4. Commit and deploy your updated composer.lock;

While there is no inherent danger in a plugin’s tables being orphaned, it can complicate re-installing that plugin, down the line.

  1. Plugin deaktivieren
                                                        
    /opt/plesk/php/8.3/bin/php craft plugin/disable plugin-handle
                                                        
                                                    
  2. Plugin komplett deinstallieren (inkl. DB)
                                                        
    /opt/plesk/php/8.3/bin/php /usr/lib/plesk-9.0/composer.phar remove plugin-handle (Schau in composer.json)
                                                        
                                                    
  3. Plugin aktivieren
                                                        
    /opt/plesk/php/8.3/bin/php craft plugin/enable plugin-handle
                                                        
                                                    
Craft Upgrade from 4 to 5
  1.                                                     
    DDEV
    
    1. ddev craft setup/db
    2. ddev craft project-config/rebuild
    3. ddev craft utils/fix-field-layout-uids
    4. .env -> CRAFT_DB_CHARSET="utf8mb3"
               CRAFT_DB_COLLATION="utf8mb3_general_ci"
    5. composer.json:
        "php": "8.2"
        "craftcms/cms": "^5.0.0",
        "craftcms/redactor": "^4.0",
        "ether/seo": "^5.0.0",
        "huttchdev/craft-webpme": "1.1.2",
        "verbb/super-table": "^4.0.",
        "vlucas/phpdotenv": "^5.4.0",
        "xpertbot/craft-wheelform": "^4.0"
    
    
    6. ddev craft db/convert-charset
    7. Remove your database character set and collation settings from .env
    8. Replace Charset -> utf8mb4_0900_ai_ci -> utf8mb4_unicode_ci
    
    
    Putty (Hostfactory)
    
    1. /opt/plesk/php/8.3/bin/php craft setup/db
    2. /opt/plesk/php/8.3/bin/php craft project-config/rebuild
    3. /opt/plesk/php/8.3/bin/php craft utils/fix-field-layout-uids
    4. .env -> CRAFT_DB_CHARSET="utf8mb3"
               CRAFT_DB_COLLATION="utf8mb3_general_ci"
    5. composer.json:
        "php": "8.3"
        "craftcms/cms": "^5.0.0",
        "craftcms/redactor": "^4.0",
        "ether/seo": "^5.0.0",
        "huttchdev/craft-webpme": "1.1.2",
        "verbb/social-feeds": "^2.0",
        "verbb/super-table": "^4.0.",
        "verbb/formie": "^3.0.0",
        "vlucas/phpdotenv": "^5.4.0",
        "xpertbot/craft-wheelform": "^4.0"
    6. Remove "craftcms/generator": "^1.3.0", from composer.json
    7. /usr/lib/plesk-9.0/composer.phar update
    8. /opt/plesk/php/8.3/bin/php craft up
    7. /opt/plesk/php/8.3/bin/php craft db/convert-charset
    8. Remove your database character set and collation settings from .env
    
                                                        
                                                    
Console commands
  1. Clear cache
                                                        
    /opt/plesk/php/8.3/bin/php craft clear-caches/all
                                                        
                                                    
  2. Dump composer autoload
                                                        
    /opt/plesk/php/8.3/bin/php /usr/lib/plesk-9.0/composer.phar dump-autoload