OctoPrint on Docker: Setup for Ubuntu Devices

OctoPrint is a powerful open-source 3D printer management tool that allows you to monitor and control your 3D printer remotely. In this article, we will guide you through the process of installing Docker on an Orange Pi or any other Ubuntu Linux device and setting up OctoPrint to run inside a Docker container.

Step 1: Update Your Device First, ensure your device is up-to-date by running the following commands:

apt-get update
apt-get upgrade

Step 2: Install Prerequisites

Install the necessary packages for Docker by running:

apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg2 \
software-properties-common

Step 3: Reboot Your Device

Reboot your device with the following command:

reboot

Step 4: Install Docker

Run the Docker installation script:

curl -sSL https://get.docker.com | sh

Verify that Docker is running by executing:

sudo docker ps

Step 5: Install Docker-Compose

Install Docker-Compose with the following command:

sudo apt-get install docker-compose

Step 6: Identify Your Printer and Webcam List the connected printers:

ls /dev/ttyU*
ls /dev/ttyA*

List the connected webcams:

ls /dev/video*

Step 7: Create Directories for OctoPrint Create the main OctoPrint directory:

mkdir octoprint

Navigate to the OctoPrint directory and create a directory for your printer:

cd octoprint
mkdir reprap
cd reprap

Get the current working directory and save it for later use:

pwd

Return to the OctoPrint directory:

cd ..

Step 8: Edit the Docker-Compose Configuration File Create a new docker-compose.yml file:

nano docker-compose.yml

Copy and paste the sample docker-compose file below into your docker-compose.yml, adjusting it to reflect your configuration:

version: '2.2'

services:
  octoprint_reprap:
    restart: unless-stopped
    image: octoprint/octoprint
    ports:
      - 4000:5000
    devices:
      - /dev/ttyUSB0:/dev/ttyACM0
    volumes:
     - /root/octoprint/reprap:/home/octoprint

  mjpg-streamer:
    restart: unless-stopped
    image: openhorizon/mjpg-streamer-pi3
    command: ./mjpg_streamer -o "output_http.so -w ./www" -i "input_uvc.so -r 1280x720 -d /dev/video0 -f 30"
    devices:
      - /dev/video0:/dev/video0
    ports:
      - 8080:8080

Save and exit the file.

Step 9: Start Your OctoPrint Instance

Use docker-compose to start your OctoPrint instance:

docker-compose up -d

Get the container ID and check the logs for failures:

docker ps
docker logs <containerid>

Grant full permissions to the printer directory:

chmod -R 777 reprap

Restart your Docker container:

docker restart <containerid>

Step 10: Access Your OctoPrint Instance

Open your web browser and navigate to <deviceip>:<port> to access your OctoPrint instance.

Congratulations! Docker and OctoPrint now empower your Ubuntu device. This setup enables remote 3D printer management, boosting efficiency and convenience. Relish the upgraded command and ease OctoPrint offers, and revel in your 3D printing adventures!

10 responses to “OctoPrint on Docker: Setup for Ubuntu Devices”

  1. Fantastic site Lots of helpful information here I am sending it to some friends ans additionally sharing in delicious And of course thanks for your effort.

  2. Mygreat learning For the reason that the admin of this site is working, no uncertainty very quickly it will be renowned, due to its quality contents.

  3. Real Estate This is really interesting, You’re a very skilled blogger. I’ve joined your feed and look forward to seeking more of your magnificent post. Also, I’ve shared your site in my social networks!

  4. Excellent blog here Also your website loads up very fast What web host are you using Can I get your affiliate link to your host I wish my web site loaded up as quickly as yours lol

  5. I do believe all the ideas youve presented for your post They are really convincing and will certainly work Nonetheless the posts are too short for novices May just you please lengthen them a little from subsequent time Thanks for the post

  6. Tech to Force I just like the helpful information you provide in your articles

  7. Thanks I have just been looking for information about this subject for a long time and yours is the best Ive discovered till now However what in regards to the bottom line Are you certain in regards to the supply

  8. Ive read several just right stuff here Certainly price bookmarking for revisiting I wonder how a lot effort you place to create this kind of great informative website

  9. I loved as much as you will receive carried out right here The sketch is attractive your authored material stylish nonetheless you command get got an impatience over that you wish be delivering the following unwell unquestionably come more formerly again since exactly the same nearly a lot often inside case you shield this hike

  10. Your article helped me a lot, is there any more related content? Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *