Installation

Installing Docker

Introduction

If you run the LEAN engine locally with the CLI, LEAN executes in a Docker container. These Docker containers contain a minimal Linux-based operating system, the LEAN engine, and all the packages available to you on QuantConnect.com. It is therefore required to install Docker if you plan on using the CLI to run the LEAN engine locally.

The installation instructions on this page should be sufficient for most users. For more comprehensive instructions, see Get Docker in the Docker documentation.

Install on Windows

To install Docker on Windows, your computer must meet the following requirements:

  • A 64-bit processor
  • 4GB RAM or more
  • Windows 10, version 1903 or higher (released May 2019)
  • Hardware virtualization enabled in the BIOS

If you meet the requirements, follow these steps to install Docker on your computer:

  1. Download Docker Desktop Installer.exe.
  2. Run the downloaded installer and ensure the Enable WSL 2 Features check box is selected when prompted for it.
  3. Follow the instructions in the installation wizard to complete the installation.
  4. Restart your computer to ensure changes are propagated.

After you install Docker and restart your computer, if Docker prompts you that the WSL 2 installation is incomplete, follow the instructions in the dialog shown by Docker to finish the WSL 2 installation.

By default, Docker doesn't automatically start when your computer starts. So, when you run the LEAN engine with the CLI for the first time after starting your computer, you must manually start Docker. To automatically start Docker, open the Docker Desktop application, click Settings > General, and then enable the Start Docker Desktop when you log in check box.

Install on macOS

To install Docker on Mac, your computer must meet the following requirements:

  • Mac hardware from 2010 or newer with an Intel processor
  • macOS 10.14 or newer (Mojave, Catalina, or Big Sur)
  • 4GB RAM or more

If you meet the requirements, follow these steps to install Docker on your Mac:

  1. If you're using a Mac with an Apple chip, run softwareupdate --install-rosetta in a terminal to install Rosetta 2.
  2. Download Docker.dmg for Intel chips or Docker.dmg for Apple chips depending on the chip your Mac contains.
  3. Double-click Docker.dmg to open the installer.
  4. Drag the Docker icon to the Applications folder to install it.
  5. Double-click Docker.app in the Applications folder to start Docker.

If your Mac has an M1 chip, follow these additional steps:

  1. Open a terminal and run the following command to pull the AMD46 version of LEAN:
    $ docker pull --platform linux/amd64 quantconnect/lean

    The last command enables you to run the amd64 LEAN image by taking advantages of the qemu emulator.

  2. To achieve the best performance and stability, use colima, which uses the latest stable qemu version.

    $ brew install colima
    $ colima start --cpu 4 --memory 8 --arch x86_64

    Without colima, in some cases, the container hangs.

  3. To verify it's working correctly, run:
  4. $ qemu-img --version
    qemu-img version 7.1.0 (or higher)
    $ docker context ls
    	should show colima as selected
    $ docker inspect quantconnect/lean
    	should show amd64 arch
    $ docker exec -it {lean container id} bash
    	$ uname -a
    		should show x86_x64/amd64 or similar
  5. If docker context ls does not show colima, run colima start --edit and make sure docker is the selected context.

Install on Linux

The installation instructions on Linux differ per distribution. To learn how to install Docker on your distribution, see Install Docker Desktop on Linux in the Docker documentation.

You can also see our Videos. You can also get in touch with us via Discord.

Did you find this page helpful?

Contribute to the documentation: