Skip to content

Building Marlin

cefiar edited this page Aug 11, 2025 · 3 revisions

Overview

Steps to build Marlin from source.

  1. Install a copy of git.
  2. Clone a copy of the Marlin repo using git.
    • Note that you want to choose a suitable matching (or later) branch compared to the last build.
    • When Marlin boots, the display lists the current version installed.
  3. Install Docker-Desktop 2.3 or later.
    • If on Linux, also install Docker Compose (1.21 or later). Do not use the Ubuntu snap package.
    • If on Windows 10/11 Home, install the WSL2 Back-end (comes with 10/11 Pro/Enterprise - but may automatically update).
    • On Windows; Docker Toolbox is not supported. Windows container images are not supported.
  4. Install VSCode.
  5. Within VSCode, first install the C/C++ helper extension and then install the PlatformIO extension. You will need to reload/restart VSCode.
  6. Within VSCode, open the folder of the Marlin repo you cloned in.
  7. Modify the following files in the Marlin repo as required:
    • Marlin/Configuration.h
    • Marlin/Configuration_adv.h
    • platformio.ini
    • Note: This may already be done if you've cloned an appropriate fork of the main Marlin repo.
  8. Hit the build button in VSCode to compile.

Resulting firmware will be built into the file .pio/build/[board_name]/firmware.bin, where [board_name] is the motherboard name defined in Marlin/Configuration.h and in platformio.ini (should be the same and match the hardware you are building).

Links

Git for Windows: https://gitforwindows.org/

Main Marlin repo: https://github.com/MarlinFirmware/Marlin/

Docker Desktop: https://docs.docker.com/get-started/get-docker/#supported-platforms

Docker Compose (Linux only): https://docs.docker.com/compose/install/

Microsoft WSL2 Back end: https://aka.ms/vscode-remote/containers/docker-wsl2

VSCode: https://code.visualstudio.com/docs/setup/setup-overview

Marlin docs on using PlatformIO dev container in VSCode: https://marlinfw.org/docs/basics/install_devcontainer_vscode.html

Clone this wiki locally