Link Search Menu Expand Document

Create Drupal 8 project using Composer with Docksal, the native way

Table of contents

  1. Install Docksal
  2. Manage Docksal
    1. Start Docksal
    2. Stop Docksal
  3. Download Drupal 8
    1. Create project directory
    2. Go to project directory
    3. Download Drupal 8 using composer, docksal/cli
  4. Initialize Docksal project
    1. Create Docksal directory
    2. Set docroot directory
  5. Manage Docksal project, container(s)
    1. Start your project, container(s)
    2. Stop your project, container(s)
    3. Remove your project, container(s)
  6. Database config settings
  7. Drush
  8. Composer and other commands

This is for you if you want the following:

  • Manual creation of Drupal 8 project from scratch using Composer.
  • Manual initialization of Docksal from scratch.

Install Docksal

To install, follow official instructions in docksal docs.

For OSX/macOS, I would recommend Docker Desktop installation option.

Manage Docksal

Start Docksal

fin system start

Stop Docksal

fin system stop

Download Drupal 8

We will use Composer to download Drupal 8, and we will run composer using docksal/cli.

Do not use your host composer.

Create project directory

mkdir my-new-project

Go to project directory

cd my-new-project

Download Drupal 8 using composer, docksal/cli

fin run-cli composer create-project drupal-composer/drupal-project:8.x-dev . --stability dev --no-interaction

Initialize Docksal project

Create Docksal directory

Inside the project root:

mkdir .docksal

Set docroot directory

Assuming you would host your production site into Acquia Cloud, the docroot/webroot directory would be docroot. You may change it to any directory such as web, or www.

fin config set DOCROOT=docroot

The configuration settings for your docksal can be found inside .docksal directory.

Manage Docksal project, container(s)

Start your project, container(s)

fin project start

Stop your project, container(s)

fin project stop

Remove your project, container(s)

fin project remove

Database config settings

host username password database
db user user default

Drush

All drush commands must be prefixed with fin. For example,

drush cr

would become

fin drush cr

Composer and other commands

All composer commands must also be prefixed with fin or fin exec. For example,

composer install

would become

fin composer install

or

fin exec composer install

Likewise, all other commands must be prefixed with fin exec.

fin exec is recommended over just fin for both composer and other commands.


Back to top

Comment(s)

This site uses a fork version of Just the Docs, a documentation theme for Jekyll, by Patrick Marsceill.
Copyright © 2008-2021 Timothy Escopete.
All rights reserved as provided by law.