Install Klipper on an Ender 3 or any other printer: host, board firmware and printer.cfg

By Sina Esfahani, OmniTechs · Published 27 November 2026

Installing Klipper is three jobs. A small Linux computer, the host, runs Klipper, Moonraker and a web interface such as Mainsail. The printer's board gets a small firmware built for its exact chip, flashed once, usually from an SD card. And a configuration file, printer.cfg, tells Klipper which pins drive which motor and heater.

Start from Klipper's example file for your printer, not from a blank page. The comments at the top of that file name the build settings and the flashing method for that board (Klipper). Run Klipper's configuration checks before the first print.

Install it in this order:

  1. Find your printer's example file in Klipper's config folder (for example printer-creality-ender3-v2-2020.cfg) and read its header; check the chip printed on the board with the printer switched off and unplugged.

  2. Prepare the host's SD card with Raspberry Pi Imager: MainsailOS, or Raspberry Pi OS Lite followed by KIAUH; set the host name, user, Wi-Fi and SSH.

  3. Log in over SSH, run cd ~/klipper and make menuconfig with the settings from the header, then make.

  4. Copy out/klipper.bin to the printer's SD card under the name its board needs, with the USB cable unplugged, and switch on with the card inserted.

  5. Run ls /dev/serial/by-id/* and copy that path into the serial line of the [mcu] section.

  6. Save the example as printer.cfg, send RESTART and check that STATUS reports the printer ready.

  7. Run the checks: temperatures, M112, heaters, QUERY_ENDSTOPS, STEPPER_BUZZ, a first G28 with a hand near the power switch, then PID_CALIBRATE.

Choose the host

Ways to run Klipper on a printer that came with Marlin or stock firmware

From Klipper's installation page and FAQ, the MainsailOS documentation, the KIAUH README and Creality's K1 firmware release notes, read on 27 November 2026.
OptionWhat you installWhen it fits
MainsailOS imageA ready-made image with Klipper, Moonraker, Mainsail, Crowsnest (webcam), Sonar (Wi-Fi keepalive) and timelapse preinstalledThe quickest start on a Raspberry Pi or a supported Armbian board
Raspberry Pi OS Lite plus KIAUHA plain Lite image, then KIAUH's menus install Klipper, Moonraker and Mainsail or FluiddYou want to pick the parts, or add KlipperScreen and other tools later
Another Linux computerA Debian-based server system, such as Ubuntu Server, then KIAUHA spare mini PC; Klipper advises against desktop editions
Creality K1 or K1 MaxNothing to flash: the printer already runs Creality's Klipper; you enable root accessYou want SSH access and web interfaces on a K1

Klipper recommends a Raspberry Pi Zero 2 W, 3, 4 or 5. It runs on a Pi 1, 2 or the first Zero, but those often stall prints. MainsailOS asks for a good SD card of at least 16 GB (32 GB recommended) and does not recommend the Pi 5 with webcams. Whether Klipper is worth it for your printer is covered in what Klipper changes.

Step 1: prepare the host

MainsailOS. In Raspberry Pi Imager, choose your Pi model, then Other specific-purpose OS, 3D printing, MainsailOS, and your SD card. In the customisation steps, set a host name (default mainsailos), your time zone, a user name and password, your Wi-Fi network, and switch SSH on. MainsailOS recommends changing the default password. After the first boot you reach the printer at http://mainsailos.local, or at the host name you chose.

Raspberry Pi OS Lite and KIAUH. Flash Raspberry Pi OS Lite (32 or 64-bit) the same way, with SSH and Wi-Fi set in Imager. Log in over SSH and run:

  1. sudo apt-get update && sudo apt-get install git -y

  2. cd ~ && git clone https://github.com/dw-0/kiauh.git

  3. ./kiauh/kiauh.sh, then choose Klipper, Moonraker and Mainsail or Fluidd from its install menu.

Download KIAUH only from its GitHub repository. Its maintainer warns that a website using the KIAUH name with a .com address is not official and that nothing should be downloaded or run from it.

Rolohaun's first episode installs MainsailOS on a Raspberry Pi and uses KIAUH to set up Klipper.

2024 Easy How to Guide on Installing Klipper with MainSailOS and KIAUH for your 3D Printer - EP1 (Rolohaun)

Step 2: build the firmware for your board's exact chip

Build the board firmware on the host: cd ~/klipper, then make menuconfig. Set the options the header of your example file names, press Q and then Y to save, and run make. The result is out/klipper.bin.

The printer's model name is not enough; the chip on the board decides. Switch the printer off, unplug it and open the electronics cover to read it. Creality has fitted different chips to boards with the same name.

Flashing from an SD card, which most STM32 and clone boards need the first time (Klipper):

  • Unplug the USB cable from the host first: some boards draw power over USB and then refuse to flash.

  • Most stock boards ignore a file whose name they have seen before, so use a new name each time (klipper1.bin, klipper2.bin). Many aftermarket boards accept firmware.bin and rename it to firmware.cur once flashed.

  • Switch the printer off, insert the card and switch it on with the card inserted.

  • A build with wrong settings can be put right: the bootloader generally lets you replace the firmware, not the bootloader itself. Build again with the header's settings and flash under a new name. Flashing with a programmer such as an ST-Link can remove the bootloader by mistake (Klipper).

Flashing over USB works for Atmega and RP2040 boards: sudo service klipper stop, then make flash FLASH_DEVICE= with the board's serial path (or first for an RP2040 in boot mode), then sudo service klipper start.

Chris Riley installs Klipper on an Ender 3 V2 with Mainsail; the link starts at his chapter on compiling the firmware. It was filmed in 2022, so some screens have changed.

Install Klipper On Your Ender 3 V2 - Mainsail - First Print - Chris's Basement - 2022 (Chris Riley)

Step 3: printer.cfg and the serial port

Open Mainsail's Machine page, open the example file in the config file panel and save it as printer.cfg; Fluidd has the same built-in editor. MainsailOS ships without a printer.cfg, and Klipper only reads a file with exactly that name. Then connect the printer's USB cable to the host and run ls /dev/serial/by-id/* over SSH. The answer looks like /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0, the path in Klipper's Ender 3 V2 file. Copy your own result into printer.cfg:

  • [include mainsail.cfg] at the top, on MainsailOS, where that file comes preinstalled

  • [mcu]

  • serial: followed by the path you just found

The name can change after flashing, so run the command again after every flash. If several lines appear, unplug the board, run it again and pick the line that disappeared (Klipper). Send RESTART, then STATUS. A configuration error is shown in the console and in the log at ~/printer_data/logs/klippy.log; fix it and restart until STATUS reports ready. If Klipper cannot reach the board at all, continue with Klipper MCU unable to connect.

Whether the printer's own screen keeps working depends on the model. The Ender 3, Ender 3 Pro and Ender 2 Pro keep theirs: their example files include a [display] section. Klipper's Ender 3 V2 file has none, and its V2 Neo file notes that screen is not supported by Klipper; there you control the printer from Mainsail or a separate touchscreen such as KlipperScreen or a Sonic Pad.

Worked example: an Ender 3 V2 with a GD32F303 board

The board shows GD32F303 on its chip. Klipper's V2 Neo file says the STM32F103 settings work on that chip, so in make menuconfig you choose STMicroelectronics STM32, STM32F103, 28KiB bootloader and Serial (on USART1 PA10/PA9), then run make. You copy out/klipper.bin to the SD card as klipper-v2-1.bin and switch the printer on with the card inserted and no USB cable connected. Then you switch it off, connect USB to the Pi and run ls /dev/serial/by-id/*, which shows a path such as /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0. You paste it into the [mcu] section of printer-creality-ender3-v2-2020.cfg, saved as printer.cfg, and send RESTART. A later flash uses a new name, such as klipper-v2-2.bin.

Step 4: the first checks before you print

Klipper's configuration checks catch wrong pins before they damage anything. Run them in this order, sending RESTART after every change to printer.cfg:

  1. Temperatures. Nozzle and bed should read room temperature and not rise. If either rises, remove power from the printer.

  2. M112. The emergency stop must shut Klipper down; FIRMWARE_RESTART brings it back.

  3. Heaters. Set the nozzle to 50 °C: it should start rising within about 30 seconds. Repeat for the bed.

  4. Endstops. QUERY_ENDSTOPS reports open with nothing pressed and TRIGGERED while you press each switch; the homing guide explains what to change if not.

  5. Motors. STEPPER_BUZZ STEPPER=stepper_x moves 1 mm and back ten times; if it goes the wrong way, add or remove the ! on dir_pin.

  6. First home. Send G28 with a hand near the power switch, and cut the power if it does not home properly.

  7. Heater tuning. PID_CALIBRATE HEATER=extruder TARGET=170, then PID_CALIBRATE HEATER=heater_bed TARGET=60, saving each with SAVE_CONFIG; values from other firmware often work poorly (Klipper).

Then set the probe and Z offset (BLTouch and CR Touch offsets, set the Z offset), add a START_PRINT macro as described in start and end G-code, and calibrate in the right order.

Creality K1 and KE: enable root instead of reflashing

These printers already run Creality's own Klipper. Creality's release notes for firmware V1.3.2.1 give the route: Settings, Root Account Information, accept the root warning, and the printer shows the root account and password for SSH. Without accepting it, SSH root login is refused. Creality's notes add three points:

  • Services such as Moonraker can occasionally use too much memory and crash the system.

  • Rooted printers keep hardware after-sales service within the warranty, but Creality gives no software support for root problems.

  • After firmware trouble, Creality supports rolling back to V1.3.1.19; it also publishes a firmware recovery tool for the K1 series.

Other models differ. On Creality's forum, an Ender-3 V3 KE owner describes a similar root access option in the screen's settings, while owners of the 2025 revision of the K1C report that the Root Account menu is gone. Check your own settings menu before you buy a printer for this reason.

When to stop

  • The board will not take the firmware after you have checked the chip, the settings and the file name: the bootloader may be missing or damaged. Stock, Marlin or Klipper firmware covers that case and going back to Marlin.

  • A heater rises when it should not, or the first home crashes: remove power and recheck the pins before you continue.

  • You are unsure which file matches your board: ask on the Klipper forum with a photo of the board and its chip.

Once it prints, the configuration file is where Klipper pays off: Klipper macros shows how to write your own commands. Before you open Mainsail beyond your home network, read monitoring a print remotely.