Blogs | Srijan

Installing Drupal 10 using Colima and DDEV on MacBook

Written by Rohan Sinha | Feb 22, 2023 11:45:13 AM

Colima Docker: An Introduction

Docker is a popular open-source platform that enables developers to automate the deployment of applications inside lightweight, portable containers. Colima Docker is a Docker-based development environment that provides a convenient and efficient way to work on web projects. It is designed to make it easy for developers to manage the various components of a web application, such as the web server, database, and PHP interpreter, in a single place.
One of the critical benefits of Colima Docker is that it eliminates the need for manual configuration of each component of a web application, which can be time-consuming and error-prone. With Colima Docker, developers can start working on a project quickly and with confidence, knowing that all of the necessary components are in place and ready to go.

DDEV is a popular open-source tool that makes it easy to develop, test, and deploy PHP-based web applications, including Drupal.

What's New in Drupal 10?

Drupal 10 is the latest version of the CMS, and it comes with several new features and improvements. Some key changes include:

  • PHP 8.0 compatibility is the latest version of the popular scripting language.
  • Improved accessibility that makes it easier for users with disabilities to interact with your website.
  • Improved multilingual support that enables creating and managing content in multiple languages. 
  • Performance improvements

Colima vs Docker vs XAMPP: What's the Difference?

Colima and Docker are both development tools that can be used to create and manage web applications. However, there are some critical differences. Docker is a containerization platform that enables developers to package their applications and dependencies into a single, self-contained unit. This makes it easy to deploy applications across different environments, including local development, testing, and production.

Colima, on the other hand, is a development environment built on Docker. It provides a convenient and easy-to-use interface for managing the various components of a web application, including the web server, database, and PHP interpreter. With Colima, developers can start working on a new project quickly and with confidence, knowing that all of the necessary components are in place and ready to go.

XAMPP is a popular, open-source web development environment that provides a complete web server package for local development. It includes Apache, MySQL, PHP, and other tools that are commonly used for web development.

If you're looking for a modern, containerized development environment that is easy to manage and deploy, Colima is an excellent choice.
On the other hand, if you want a complete web server package for local development, XAMPP may be a better fit. Ultimately, the choice between these tools will depend on the specific needs of your project, so be sure to consider your options carefully before making a decision.

Why Switch from Docker to Colima

Colima performs better than Docker Desktop, particularly in I/O operations and CPU load. It also offers useful features such as profile and container runtime management. Moreover, if you've worked with DDEV on Docker Desktop, you may have experienced slow performance due to memory consumption, but with Colima, DDEV runs much faster.

Instructions for Drupal 10 installation with Colima and ddev for MacBook:

Before installing Colima, it is important to uninstall Docker Desktop and remove its data if you are switching from Docker Desktop to Colima.

1. Install the docker runtime colima, and docker-compose by following the steps:

brew install docker docker-compose colima

2. Configure docker-compose as a Docker plugin:

mkdir -p ~/.docker/cli-plugins
ln -sfn $(brew --prefix)/opt/docker-compose/bin/docker-compose ~/.docker/
cli-plugin

 

3. Start the colima:

colima start # You can change cpu and memory as per your need [--cpu 4 –memory 4 ] or simply use colima start

Check the Colima instance running with colima list command.

4. Install ddev:

brew install drud/ddev/ddev

5. Run to verify the version:

ddev version

6. Create your project root directory and navigate inside:

mkdir d10test
cd d10test

7. Use the ddev config command to create a directory structure specific to Drupal 10:

ddev config --project-type=drupal10 --docroot=web --create-docroot

8. Initialize your platform:

ddev start

9. This will download Drupal core, its libraries, and other related resources and then create a default project:

ddev composer create "drupal/recommended-project"

10. Install drush:

ddev composer require "drush/drush"

11. Now that you have installed Drupal 10 you can visit your new project in your browser. To do this, you can rerun ddev start and copy one of the two URLs that it outputs, or you can use the following command, which will automatically launch your site in a new browser window:

ddev launch

You can ddev describe to get more detail about your environment.

Refer to DDEV DOCS to learn more about ddev commands.