Install MainsailOS on the Raspberry Pi, flash Klipper firmware built for your printer’s controller, then load the matching printer configuration and verify the heaters and motion. If the Pi already runs Raspberry Pi OS Lite, you can install the host software with KIAUH. Klipper installation guide.
Install Klipper on Raspberry Pi with MainsailOS
For a dedicated printer Pi, use MainsailOS. It includes Klipper, the Moonraker API server, and the Mainsail browser interface. MainsailOS overview.
Gather a Raspberry Pi, microSD card, card reader, and USB data cable for the printer. The MainsailOS guide recommends Pi Zero 2, Pi 3, or Pi 4 and specifies at least 16 GB of storage, with 32 GB or more recommended. MainsailOS setup guide.
Use a power supply matched to your model. Raspberry Pi specifies 5 V at 3 A for the Pi 4 Model B. Raspberry Pi setup and power requirements.
Follow these steps in Raspberry Pi Imager. MainsailOS Imager instructions, Raspberry Pi Imager verification.
- Select your Pi model, then Other specific-purpose OS → 3D printing → MainsailOS. Choose the recommended image for that model.
- Select the microSD card. Writing the image erases it, so back up anything needed first.
- Set a hostname, username, unique password, timezone, and Wi-Fi details if needed. Enable SSH.
- Write the image, finish verification, and insert the card into the Pi.
Boot with Ethernet or the configured Wi-Fi. Open http://mainsailos.local, substituting your hostname. If that fails, use the Pi’s IP address from your router. Under Machine, select Update all components in Update Manager before building firmware. A missing printer.cfg error is expected at this stage. First-boot instructions.
Open a terminal on your computer. In this SSH example, replace pi with the username you set in Imager and mainsailos.local with your Pi’s hostname or IP address. Enter the Pi account password when prompted. Voron SSH guide.
ssh pi@mainsailos.local
Alternative: install with KIAUH
KIAUH installs the printing components on an existing Raspberry Pi OS Lite system. Connect to the Pi through SSH and run the installer commands below. KIAUH prerequisites and commands.
sudo apt-get update && sudo apt-get install git -y
cd ~ && git clone https://github.com/dw-0/kiauh.git
./kiauh/kiauh.sh
In the KIAUH menu, install Klipper, then Moonraker, then Mainsail. Enter the Pi’s IP address or hostname in your browser to open Mainsail. Mainsail’s KIAUH installation guide.
KIAUH also offers Fluidd as an alternative interface. The configuration steps below use Mainsail. KIAUH components.
Build and flash the printer controller
With printer power disconnected, identify the controller board and MCU. Select a matching printer configuration or board template and read its build instructions. Firmware preparation. Keep the original firmware and settings available for recovery.
Open the firmware configuration menu on the Pi. Firmware build commands.
cd ~/klipper
make menuconfig
For the stock 2020 Ender 3 V2 configuration with STM32F103, the upstream configuration specifies:
| Menu setting | Value |
|---|---|
| Processor | STM32F103 |
| Bootloader offset | 28 KiB |
| Communication | Serial on USART1 PA10/PA9 |
Apply these settings only to matching hardware. Press Q to exit, then Y to save. Run make to build the firmware. Klipper firmware build instructions.
For this Ender example, download ~/klipper/out/klipper.bin from the Pi through an SFTP client. Firmware file location, SFTP instructions.
Copy the file to the printer’s SD card with a .bin filename that differs from the previous flash. With the printer off and USB disconnected, insert the card and power on the printer to flash it. Follow the board’s own flashing instructions for other hardware. Ender 3 V2 configuration, Klipper flashing guidance.
For a Voron with a BigTreeTech Octopus V1 and an STM32F446, use the firmware settings in the matching template’s header. Build and flash using those instructions, then use the template as the starting printer.cfg. Voron Trident template, Voron 2.4 template.
Create printer.cfg and connect the MCU
Upload the matching configuration as printer.cfg through Mainsail’s Machine page. On MainsailOS, add [include mainsail.cfg] at the top to load the preinstalled Mainsail configuration. Configuration setup.
Reconnect USB and run this on the Pi:
ls /dev/serial/by-id/*
If several paths appear, disconnect the controller and repeat the command to see which path disappears. Reconnect it and set the existing [mcu] section’s serial: value to that full path. MCU connection procedure.
If you started with either Voron template, apply its build-specific settings before the final ready check and full homing. Review the template’s change checklist for hardware settings such as thermistor types and heater and probe pins, then make these size and homing edits. Voron Trident template, Voron 2.4 template.
- In both templates, uncomment the
position_endstopandposition_maxlines for your build size in[stepper_x]and[stepper_y]. On the 2.4, also uncomment the matchingposition_maxin[stepper_z]. - On a Trident, uncomment the
z_positionsandpointslines and their coordinate rows for your build size in[z_tilt]. On a 2.4, do the same forgantry_cornersandpointsin[quad_gantry_level]. - For the physical Z endstop in these templates, replace the
-10,-10placeholder in[safe_z_home]underhome_xy_positionwith the measured X and Y coordinates of the endstop pin.
If you still need to measure those coordinates, save and restart Klipper with the other build settings in place, then follow Voron’s startup checks for your model. After the endstop and motor checks, use G28 X Y to home X and Y only, jog the nozzle over the Z endstop pin, and read X and Y with M114. Klipper configuration reload, Voron initial startup guide.
Once the build-specific settings are in place, save and restart Klipper, then run STATUS in Mainsail’s console to confirm Klipper loaded the configuration and connected to the controller. Klipper readiness check.
How to verify before printing
Follow the Klipper configuration checks with the power switch accessible:
- Confirm cold nozzle and bed readings are plausible and stable. Test emergency shutdown with
M112, then recover withFIRMWARE_RESTART. - Command each heater separately to 50°C, confirm the correct temperature rises, then switch it off and confirm cooling. Cut power if heating is uncontrolled.
- Run
QUERY_ENDSTOPSwith switches released and pressed. Verify each state changes correctly. - With axes clear of their limits, run
STEPPER_BUZZ STEPPER=stepper_x, then repeat for the other axis steppers. Expect a 1 mm positive move and return. - After the endstops and steppers pass, issue
G28to home. Cut power if the printer homes incorrectly.
Calibrate the hotend PID in the console using a target suitable for your printer. The example below uses 170°C. Wait for calibration to finish before running SAVE_CONFIG. Klipper PID calibration instructions.
PID_CALIBRATE HEATER=extruder TARGET=170
SAVE_CONFIG
If your heated bed supports pulse-width modulation (PWM), calibrate its PID separately. Klipper gives 60°C as a typical bed target. Klipper PID calibration instructions.
PID_CALIBRATE HEATER=heater_bed TARGET=60
SAVE_CONFIG
Level the bed and calibrate the nozzle-to-bed distance before printing. The procedure depends on whether your printer uses a Z probe, a traditional endstop, or delta kinematics. Klipper bed leveling instructions.
Check that any START_PRINT call in your slicer has a matching macro in printer.cfg. Disable coasting and follow the pressure advance tuning procedure once basic printing works. Klipper slicer documentation.
Fix common installation failures
- Dashboard unavailable. Try the Pi’s IP address and recheck the network settings before rewriting the card. First-boot instructions.
- MCU unavailable. Check power, USB data connectivity, firmware, and the serial path. Inspect
~/printer_data/logs/klippy.log. Connection diagnostics. - MCU protocol error after an update. Rebuild and flash the outdated controllers listed in the error. Protocol-error repair.
Keep remote control behind a VPN or another protected access service. Mainsail remote-access guidance.
The steps are based on the online MainsailOS, Klipper and Voron documentation as of November 26, 2026. No hands-on testing was performed for this guide.
Related across the network
- Ender 3 V3 Firmware Update Guide: SE, KE and CoreXZ — crealityreviews.com