SkillAgentSearch skills...

Prind

print in docker - Deploy a containerized Klipper Stack for your 3D Printer

Install / Use

/learn @mkuf/Prind

README

<p align=center><img src=img/prind-logo.png height=400px></p>

prind

Build and Publish Images

prind allows you to run the software for your 3D printer in Docker containers, eliminating any dependencies on the operating system.
This means you can use end-of-life or cutting-edge operating systems, and anything in between.

With a single command, you can start up Klipper and its accompanying applications.

Supported Applications

<details> <summary>Click to expand</summary>

| |Name|Image source|Docs| |:---:|------|--------------|---| |<img src="https://raw.githubusercontent.com/Klipper3d/klipper/master/docs/img/klipper-logo.png" width=30px>|Klipper|prind @ docker/klipper|Getting Started| |<img src="https://avatars.githubusercontent.com/u/9563098?v=4" width=30px>|Moonraker|prind @ docker/moonraker|Getting Started| |<img src="https://raw.githubusercontent.com/mainsail-crew/docs/master/assets/img/logo.png" width=30px>|Mainsail|upstream|Starting the Stack| |<img src="https://raw.githubusercontent.com/fluidd-core/fluidd/develop/docs/assets/images/logo.svg" width=30px>|Fluidd|upstream|Starting the Stack| |<img src="https://github.com/OctoPrint/OctoPrint/blob/main/docs/images/octoprint-logo.png?raw=true" width=30px>|Octoprint|upstream|Starting the Stack| |<img src="https://avatars.githubusercontent.com/u/91093001?s=200&v=4" width=30px>|KlipperScreen|prind @ docker/klipperscreen|Additional Profiles| |<img src="https://avatars.githubusercontent.com/u/52351624?s=48&v=4" width=30px>|moonraker-telegram-bot|upstream|Additional Profiles| |<img src="https://github.com/Clon1998/mobileraker/blob/master/assets/icon/ic_launcher_foreground.png?raw=true" width=30px>|mobileraker_companion|upstream|Additional Profiles| |<img src="https://avatars.githubusercontent.com/u/46323662?s=200&v=4" width=30px>|moonraker-obico|upstream|Additional Profiles| |<img src="https://raw.githubusercontent.com/Donkie/Spoolman/master/client/icons/spoolman.svg" width=30px>|Spoolman|upstream|Additional Profiles| |<img src="https://avatars.githubusercontent.com/u/41749659?s=200&v=4" width=30px>|µStreamer|prind @ docker/ustreamer|Add your Configuration<br>Multiple Webcams| |<img src="https://octoeverywhere.com/img/logo/logo_maskable.svg" width=30px>|OctoEverywhere|upstream|Additional Profiles| |<img src="https://raw.githubusercontent.com/ssendev/LaserWeb4/refs/heads/v4.1/src/favicon.ico" width=30px>|LaserWeb4|prind @ docker/laserweb|Additional Profiles|

</details>

Getting started

This guide requires Docker and Docker Compose v2 on your machine.
Follow the official guides to install and set them up:

Clone this repository onto your Docker host using Git:

git clone https://github.com/mkuf/prind

Install the prind-tools helper script.

cd prind

cat <<EOF | sudo install /dev/stdin /usr/local/bin/prind-tools
#!/bin/sh
docker compose -f $(pwd)/docker-compose.extra.tools.yaml run --rm tools "\$@"
EOF

Unless otherwise specified, all commands mentioned in the documentation should be run from the root of the repository.

Build the MCU Code

Before using Klipper, you'll have to build and flash the microcontroller-code for your printers mainboard.
This can be done in a container by calling the build commands via prind-tools.
Follow the Instructions on finding your printer, building and flashing the microcontroller found in the Klipper Docs.

Adapted from the official Docs, a generic Build would look like this.

prind-tools "make menuconfig"
prind-tools "make"
prind-tools "make flash FLASH_DEVICE=/dev/serial/by-id/<my printer>"

If your Board can be flashed via SD-Card, you can also use the flash-sdcard.sh script provided by klipper

prind-tools "scripts/flash-sdcard.sh <device> <board>"

If no official flash method is available, you can retrieve the klipper.bin from the out directory that is created by make and Follow your boards instructions on how to proceed with flashing.

Add your Configuration to docker-compose.override.yaml

Locate the webcam Service within docker-compose.override.yaml and update the device Section with the Device Name of your Webcam.
In this example, the Webcam is using device /dev/video0. Do not edit any other lines.

  webcam:
    <<: *ustreamer-svc
    devices:
      - /dev/video0:/dev/webcam
    labels:
      - "traefik.enable=true"
      - "traefik.http.services.webcam.loadbalancer.server.port=8080"
      - "traefik.http.routers.webcam.rule=PathPrefix(`/webcam`)"
      - "traefik.http.routers.webcam.entrypoints=web"
      - "traefik.http.middlewares.webcam.stripprefix.prefixes=/webcam"
      - "traefik.http.routers.webcam.middlewares=webcam"

Configuring Klipper/Moonraker

All Runtime Configs are stored within config of this Repo.

  • Update config/printer.cfg with your Klipper config, set the serial device and make sure to not remove the existing Macros as they are required by fluidd/mainsail. See Klipper3d Docs for Reference
  • Make sure to update cors_domains and trusted_clients within moonraker.cfg to secure your moonraker api from unwanted access. See Moonraker Docs for Reference

Starting the stack

There are currently 3 frontend Profiles to choose from, depending on the Web Frontend you'd like to use.

  • fluidd
  • mainsail
  • octoprint (w/o moonraker)

Starting the stack comes down to:

docker compose --profile <profile> up -d

e.g.

docker compose --profile fluidd up -d

Switching between profiles requires the whole stack to be torn down before starting another Frontend.
Running two Frontends at the same time is currently not supported behind a proxy. Switching from fluidd to mainsail would look like this:

docker compose --profile fluidd down
docker compose --profile mainsail up -d

Additional Profiles

Docker compose allows for multiple profiles to be started at once.
You may combine any of the above frontend profiles with any number of the following additional profiles.

Be sure to always use the same set of profiles when updating the stack, otherwise services may be orphaned or the stack is behaving in an unpredictable way.

hostmcu

The hostmcu profile enables you to use your host as secondary mcu for klipper.
See the Klipper Docs for more information on this Topic.

Uncomment the following lines in printer.cfg

[mcu host]
serial: /opt/printer_data/run/klipper_host_mcu.tty

then start the stack with

docker compose --profile mainsail --profile hostmcu up -d

After the hostmcu container is started, you may check for available gpio chips with

docker compose exec -it hostmcu gpiodetect

and check the pin number and pin availability with

docker compose exec -it hostmcu gpioinfo

KlipperScreen

KlipperScreen by jordanruthe can be enabled via the klipperscreen Profile.

It requires a X11 Server on your machine that the Container can connect to.
Locate the setup Script for X11 within scripts/ and run it from the root directory of this repository as user root. It creates a User, installs and configures X11 and creates a Systemd Service for xinit.

cd prind/
./scripts/setup-X11.sh

The Prind Logo should now be displayed on your screen.
If this is not the case, check the scripts output for errors.
Otherwise, proceed to start/update the Stack.

docker compose --profile fluidd --profile klipperscreen up -d

Moonraker-Telegram-Bot

moonraker-telegram-bot by nlef can be enabled via the moonraker-telegram-bot Profile

Add your bot_token and chat_id to config/telegram.conf.
See the configuration reference for further configuration Options.

docker compose --profile mainsail --profile moonraker-telegram-bot up -d

mobileraker_companion

mobileraker_companion by Clon1998 can be enabled via the mobileraker_companion Profile.

The default configuration provided with this repository contains everything needed to start the service and receive notifications via the Mobileraker App. See the [configuration ref

View on GitHub
GitHub Stars490
CategoryDevelopment
Updated2d ago
Forks98

Languages

Python

Security Score

100/100

Audited on Mar 30, 2026

No findings