Skip to content

How To Install It

Titus Meyer edited this page Jun 4, 2026 · 4 revisions

Installation

This page covers automatic installation, manual installation, Moonraker update manager setup, and uninstalling for Klipper and Kalico.

Automatic Installation

Clone the repository and run the installer:

cd ~
git clone https://github.com/protoloft/klipper_z_calibration.git
./klipper_z_calibration/install.sh

Run the script as your normal printer user, not as root.

The installer:

  • Links z_calibration.py into Klipper's klippy/extras directory, or into Kalico's klippy/plugins directory when a Kalico plugin directory is present.
  • Adds this repository to Moonraker's update manager if the section is not already present.
  • Adds channel: stable to new Moonraker update manager sections and to existing no-channel sections when the installer is rerun.
  • Restarts Moonraker when it adds the update manager section.
  • Restarts Klipper or the configured Klipper service instances.

Only z_calibration.py is linked into Klipper or Kalico. Supporting Python modules are loaded from this repository checkout through the symlink target, so keep the cloned repository in place.

Warning: Kalico users must enable plugin overrides before loading the plugin:

[danger_options]
allow_plugin_override: True

It is safe to run the installer multiple times.

Custom Paths

If Klipper is not installed in ~/klipper, or if moonraker.conf is not in ~/printer_data/config/, pass the paths explicitly:

./klipper_z_calibration/install.sh -k /my-home/my-klipper-directory -m /my-home/my-config/moonraker.conf

The installer also falls back to ~/klipper_config/moonraker.conf when ~/printer_data/config/moonraker.conf does not exist.

Multiple Klipper Instances

If you run multiple Klipper services, pass the number of instances:

./klipper_z_calibration/install.sh -n 2

The installer expects services named klipper-1, klipper-2, and so on.

The -n option affects the service checks and Klipper restarts performed by the installer. The Moonraker update manager block written by the installer still uses managed_services: klipper; adjust that line manually if your Moonraker setup needs differently named Klipper services.

Manual Installation

For manual installation on Klipper, link z_calibration.py from this repository into Klipper's klippy/extras directory:

ln -sf ~/klipper_z_calibration/z_calibration.py ~/klipper/klippy/extras/z_calibration.py

For manual installation on Kalico, link z_calibration.py into Kalico's klippy/plugins directory and enable plugin overrides:

ln -sf ~/klipper_z_calibration/z_calibration.py ~/klipper/klippy/plugins/z_calibration.py

Warning: Do not copy only z_calibration.py unless the helper module klipper_compat.py is also available from the copied file's real path. The installer uses a symlink so helper modules load from the repository checkout.

Then restart Klipper or Kalico, not the printer firmware:

sudo systemctl restart klipper

Moonraker Update Manager

The automatic installer adds this section for you. If you install manually and want Moonraker to update the plugin, add this block to moonraker.conf:

[update_manager z_calibration]
type: git_repo
channel: stable
path: ~/klipper_z_calibration
origin: https://github.com/protoloft/klipper_z_calibration.git
managed_services: klipper

This assumes the repository was cloned into the home directory:

git clone https://github.com/protoloft/klipper_z_calibration.git

It also assumes the plugin file is linked into Klipper or Kalico. See Manual Installation for the correct link target.

The installer preserves existing explicit stable, beta, or dev channels. New installer-created sections use channel: stable.

If an existing [update_manager z_calibration] section has no channel, rerunning install.sh adds channel: stable.

Action required: Normal Moonraker updates do not rerun install.sh. Existing no-channel update manager sections remain on Moonraker's implicit dev channel until you rerun the installer or manually add channel: stable to moonraker.conf and restart Moonraker.

Moonraker supports additional update manager options and service-management settings. Keep the block above unless your Moonraker setup requires those options.

Uninstalling

Run the installer with -u:

~/klipper_z_calibration/install.sh -u

Then remove the remaining configuration:

  • Remove the [z_calibration] section from your Klipper configuration.
  • Remove the [update_manager z_calibration] block from moonraker.conf.
  • Delete the cloned repository when you no longer need it:
rm -r ~/klipper_z_calibration

Next Step

After installation, continue with Configuration.

Clone this wiki locally