====== OctoPrint Server Setup on Linux Using OctoPrint Deploy ====== **Author:** mcnult1\\ **Email:** mcnult1@unlv.nevada.edu\\ **Date:** Last modified on 06/26/2024\\ **Keywords:** OctoPrint, Linux, 3D Printing, Setup, Tutorial, OctoPrint Deploy, Networking, Server ---- ===== Motivation and Audience ===== This tutorial's motivation is to help users set up multiple instances of OctoPrint on a Linux system using the OctoPrint Deploy script. Readers of this tutorial assume the following background and interests: * Have an interest in OctoPrint * Have an interest in Linux * Know how to use a terminal in Linux * Have an interest in 3D printing * This tutorial may also attract readers who are interested in server management and networking ---- ===== Original Work Credit ===== This tutorial is based on the original work by paukstelis [[https://github.com/paukstelis/octoprint_deploy|OctoPrint Deploy GitHub Repository]]. For there setups, other operating systems, or to support the developer, please refer to the original documentation. ---- ===== Table of Contents ===== - [[#Quick_Start_Guide|Quick Start Guide]] - [[#Detailed_Deployment_Guide|Detailed Deployment Guide]] - [[#Useful_Commands|Useful Commands]] - [[#Additional_Resources|Additional Resources]] - [[#Important_Notes|Important Notes]] - [[#Final_Words|Final Words]] ---- ===== Quick Start Guide ===== ==== Prerequisites ==== * A computer running Linux (tested on Ubuntu 20.04). * Basic knowledge of using the terminal. ==== What Does It Do? ==== **octoprint_deploy** is a script that makes installing multiple instances of OctoPrint easy. You do not have to edit any files as the entire script is guided to let you set up multiple instances exactly how you want them, just following simple prompts. ==== Requirements ==== **octoprint_deploy** only works on Linux systems. The only additional requirement is that the Linux system must use systemd (most of them do). > **Note:** For more details on supported Linux distributions, see the section [[#Useful_Information|Useful Information]] below. ==== Steps ==== - **Install git**sudo apt install git - **Clone the OctoPrint Deploy Repository**git clone https://github.com/paukstelis/octoprint_deploy cd octoprint_deploy - **Run the Deployment Script**sudo ./octoprint_deploy.sh - **Prepare System** * Follow the on-screen instructions to prepare the system. This will install necessary packages, install OctoPrint, and prompt you to create the first instance. * > **Note on Port Sensitivity:** During udev detection, if your printer does not have a serial number (e.g., most Creality printers), it will be detected by the USB port you plugged it into. This makes the setup port-sensitive, meaning if you move the printer to a different USB port, you will need to set up a new instance. Printers with serial numbers do not have this issue. For more details, visit the [[https://github.com/paukstelis/octoprint_deploy|OctoPrint Deploy GitHub Repository]]. - **Add Instance** * Continue with the octoprint_deploy script, choose Add Instance, and follow the instructions. Add as many instances as you have printers, following the instructions. [[https://github.com/paukstelis/octoprint_deploy/wiki|paukstelis Wiki with Quick Start Guide]] ---- ===== Detailed Deployment Guide ===== ==== Step 1: System Preparation ==== - **Install git**sudo apt install git - **Clone the Repository**git clone https://github.com/paukstelis/octoprint_deploy.git cd octoprint_deploy ==== Step 2: Run the Install Script ==== - **Run the Install Script**sudo ./octoprint_deploy.sh - **Configuration Prompt** Follow the on-screen prompts to: * Register the OctoPi-created instance in octoprint_deploy. * Detect udev (only needed if you are adding multiple printers). * > **Note on Port Sensitivity:** During uev detection, if your printer does not have a serial number (e.g., most Creality printers), it will be detected by the USB port you plugged it into. This makes the setup port-sensitive, meaning if you move the printer to a different USB port, you will need to set up a new instance. Printers with serial numbers do not have this issue. For more details, visit the [[https://github.com/paukstelis/octoprint_deploy|OctoPrint Deploy GitHub Repository]]. * Install a new streamer. - **Add Instances** * Choose Add Instance and follow the instructions. * Use an existing instance as a template, if prompted. * Add as many instances as you have printers. ==== Useful Information ==== **General Linux (Ubuntu/Mint/RPiOS/Debian/Fedora/Arch/etc.)** * The script will handle the entire installation process. * Avoid distros that do not use systemd by default (e.g., MX Linux or chroot-based systems like Chrome+crouton). LXC containers do not work well with udev rules and USB peripherals, so those should be avoided. * All commands assume you are operating out of your home directory. * Install Ubuntu 20+, Mint 20.3+, Debian, DietPi, RPiOS, Armbian, Fedora35+, ArchLinux, or openSUSE on your system (make sure your user is admin for sudo). * Install git if it isn’t already:sudo apt install git # or sudo dnf install git # or sudo pacman -S git # or sudo zypper in git * Run the command:git clone https://github.com/paukstelis/octoprint_deploy * Run the command:sudo octoprint_deploy/octoprint_deploy.sh * Choose `Prepare System` from the menu. Select your distribution type. All deb-based systems use the same. ==== Additional Configuration ==== * **haproxy Entries**: haproxy entries are updated so you can connect via a personal browser address, Ex: http://octopi.local/instancename. * **To Add More Printers**: To add more printers at a later date, just run the script again! ===== Useful Commands ===== * Modify a setting for all instances using the OctoPrint CLI interface (WIP) * Add/Remove udev rules for printers and cameras * Generate diagnostic output about octoprint_deploy. Use this and provide output when you are looking for support. **Other features from commandline arguments:** * **Remove everything:**sudo octoprint_deploy/octoprint_deploy.sh remove * **Backup and restore files for an instance from the menu, or backup all instances:**sudo octoprint_deploy/octoprint_deploy.sh backup * **Restart all instances:**sudo octoprint_deploy/octoprint_deploy.sh restart_all ---- ===== Important Notes ===== ==== Port Sensitivity ==== - **Port Sensitivity:** During udev detection, if your printer does not have a serial number (e.g., most Creality printers), it will be detected by the USB port you plugged it into. This makes the setup port-sensitive, meaning if you move the printer to a different USB port, you will need to set up a new instance. Printers with serial numbers do not have this issue. For more details, visit the [[https://github.com/paukstelis/octoprint_deploy|Original GitHub Repository]]. ==== octoprint_deploy 1.0.11 ==== These files provide a bash script for quickly deploying multiple octoprint instances on a single computer. For Linux systems (Ubuntu, Fedora, etc.) it will also install OctoPrint and a video streamer (ustreamer). No need for lots of file editing or complicated Docker compose scripts! A background video on how it generally works from my ERRF2022 talk can be found here: [[https://www.youtube.com/live/q0iCNl8-kJI?si=l8GZ047sN0HWokGK|ERRF2022 talk video]]. **Note**: Unfortunately, octoprint_deploy > 1.0.0 is not directly compatible with older versions, as so much has changed. If you want to use the new version of octoprint_deploy with an older setup, create backups (either with OctoPrint UI or with octoprint_deploy), then use the `remove` command line argument before updating octoprint_deploy. Re-make your instances using the same instance names, then recover your backups. ---- ===== Additional Resources ===== * For setting up a webcam, refer to the original [[https://github.com/paukstelis/octoprint_deploy|OctoPrint Deploy tutorial]]. * For Raspberry Pi installations, detailed instructions can be found in the original documentation. * Support the developer by visiting the [[https://github.com/paukstelis/octoprint_deploy|OctoPrint Deploy GitHub page]]. ---- ===== Final Words ===== This tutorial's objective was to provide a comprehensive guide for setting up multiple instances of OctoPrint on Linux using OctoPrint Deploy. Complete setup instructions. Once the concepts were conveyed, the reader could efficiently set up and manage multiple 3D printers. Speculating future work derived from this tutorial includes enhancing the setup with additional plugins, exploring automation scripts for maintenance, and integrating advanced monitoring tools. In the big picture, the problem of managing multiple 3D printers from a single server can be solved with this tutorial. For questions, clarifications, etc., Email: mcnult1@unlv.nevada.edu