🖨️ Setup OctoPrint — Web Control for Your 3D Printer
Deploy OctoPrint on Ubuntu with Docker — monitor and control your 3D printer from any browser, upload G-code, watch prints live, and get notified when something goes wrong, on port 8231.
📦 Resources & Setup Scripts
Grab the automated bash script from GitHub to follow along with the video.
Quick Install:
wget https://raw.githubusercontent.com/mhmdali94/Docker/main/3d-printing/octoprint/octoprint-ubuntu.sh
chmod +x octoprint-ubuntu.sh
sudo bash octoprint-ubuntu.sh
Tutorial Steps
1 Download the Script
wget https://raw.githubusercontent.com/mhmdali94/Docker/main/3d-printing/octoprint/octoprint-ubuntu.sh
2 Make it Executable
chmod +x octoprint-ubuntu.sh
3 Run the Installer
The script installs Docker if needed and starts OctoPrint on port 8231, with its configuration and uploads in the ./data volume. The printer's USB device is not passed through automatically — you add it to the compose file.
sudo bash octoprint-ubuntu.sh
4 Pass Through the Printer and Open the UI
Edit the compose file to map your printer's serial device into the container, restart, then open OctoPrint and complete the first-run setup wizard:
http://<your-server-ip>:8231
Ports Used
| Port | Purpose |
|---|---|
| 8231 | Web UI (host → container 80) |
| USB passthrough | Manual — add your printer device to the compose file first |
| ⚠️ Never expose | Controls a heated printer — keep it on your LAN or a VPN |
| ./data | Settings, uploads, timelapses, and plugins |