Run OctoPrint - 3D Printer Web UI - in Docker 🌱

What is OctoPrint?

OctoPrint provides a snappy web interface for controlling consumer 3D printers. -https://github.com/OctoPrint/OctoPrint

Installing Docker

  1. Log into the Linux host and run the following commands in a terminal window
    # install prerequisites
    sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg-agent -y
    # add docker gpg key
    curl -fsSL https://download.docker.com/linux/$(awk -F'=' '/^ID=/{ print $NF }' /etc/os-release)/gpg | sudo apt-key add -
    # add docker software repository
    sudo add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/$(awk -F'=' '/^ID=/{ print $NF }' /etc/os-release) $(lsb_release -cs) stable"
    # install docker
    sudo apt install docker-ce docker-compose containerd.io -y
    # enable and start docker service
    sudo systemctl enable docker && sudo systemctl start docker
    # add the current user to the docker group
    sudo usermod -aG docker $USER
    # reauthenticate for the new group membership to take effect
    su - $USER

Running OctoPrint Container

  1. Continue with the following commands in a terminal window
    # create working directories
    mkdir ~/docker/octoprint -p
    # set owner of docker directory
    sudo chown "$USER":"$USER" ~/docker -R
    # allow the container to write to working directories
    sudo chmod a+rwx -R ~/docker/octoprint
    # run the octoprint container
    docker run -d --name octoprint -v ~/docker/octoprint:/octoprint --device /dev/ttyACM0:/dev/ttyACM0 -p 8041:80 --restart=unless-stopped octoprint/octoprint
  2. Open a web browser and navigate to http://DNSorIP:8041
  3. Click Next on the Start screen
  4. Click Next on the Restore Backup screen
  5. Create an account my entering a Username and entering and confirming a password > Click Create Account
  6. Once the account is created, click Next
  7. Choose to Enable or Disable the Connectivity Check > Click Next
  8. Choose to Enable or Disable Anonymous Usage Tracking > Click Next
  9. Choose to Enable or Disable the Plugin Blacklist > Click Next
  10. Click Next on the Webcam Wizard screen
  11. Click Next on the Default Printer Profile screen
  12. Click Next on the Server Commands screen
  13. Acknowledge all the messages on the Finish screen > Click Finish
  14. Welcome to OctoPrint

Documentation: https://github.com/OctoPrint/octoprint-docker