Version: 1.1.0 | View Changelog
A comprehensive web application for managing 3D printers, including print history tracking, model library management, real-time printer monitoring via MQTT, cloud synchronization with Bambu MakerWorld, and complete database backup & maintenance tools.
- Authentication: Secure login with OIDC support (Authentik, Keycloak, Auth0, etc.)
- Print History: Track all your prints with cover images from MakerWorld, paginated display, per-device filtering
- SD Card Sync: Automatically import print history from printer SD card for locally sliced files
- Model Library: Upload and manage your 3D model files (.3mf, .stl, .gcode)
- Printer Monitoring: Real-time status updates via MQTT including AMS data
- Cloud Sync: Automatic synchronization with Bambu Cloud
- Timelapse Videos: Download and convert print timelapses
- Statistics: View print success rates and analytics
- Duplicate Detection: Find duplicate models in your library
- User Management: Multi-user support with admin controls
- Dynamic Theming: Customizable accent colors applied throughout the app
- Database Maintenance: Vacuum, Analyze, and Reindex operations with detailed results
- Automatic Backups: Schedule automatic database backups (local storage)
- Remote Backups: Upload backups to SFTP or FTP servers
- Backup Retention: Automatic cleanup of old backups based on retention policy
- Settings Management: Organized settings with collapsible categories
- Maintenance Tracking: Track scheduled printer maintenance tasks with history logs
- Maintenance Intervals: Set maintenance schedules based on print hours
- Per-Device Maintenance: Track maintenance separately for each printer
- Maintenance History: View completion history for each task
- Task Management: Mark maintenance tasks as complete and track history
- Maintenance Alerts: Get notified via Discord when maintenance is due
- Discord Webhooks: Get notifications for print failures and maintenance alerts
- MQTT Monitoring: Real-time printer status and AMS updates
- SFTP/FTP Backup: Upload database backups to remote servers
- OAuth/SSO: Enterprise authentication with OIDC providers
- Container-Safe Supervision: Watchdog process manager that doesn't kill containers on app restart
- Configurable Logging: Dynamic log level control (DEBUG/INFO/WARNING/ERROR) in Settings
- Version Tracking: Automatic semantic versioning from package.json
- Node.js 18+ or Docker
- Bambu printer account
- (Optional) OIDC identity provider for SSO
- (Optional) SFTP/FTP server for remote backups
- Pull the latest image:
docker pull tr1ckz/printhive:latest- Create a docker-compose.yml:
version: '3.8'
services:
printhive:
image: tr1ckz/printhive:latest
container_name: printhive
restart: unless-stopped
ports:
- "3000:3000"
volumes:
- ./data:/app/data
- ./sessions:/app/sessions
- ./library:/app/library
- ./videos:/app/data/videos
- ./backups:/app/data/backups
environment:
- SESSION_SECRET=your-random-secret-key
- PUBLIC_URL=https://your-domain.com
- LOG_LEVEL=info- Start the container:
docker-compose up -dFor detailed Docker and Unraid instructions, see DOCKER.md.
- Clone the repository:
git clone https://github.com/YOUR_USERNAME/printhive.git
cd printhive- Install dependencies:
npm install- Configure environment:
cp .env.example .env
# Edit .env with your configuration- Start the development server:
npm run devSee README-ENV.md for detailed environment variable documentation.
SESSION_SECRET: Random secret key for session encryptionPUBLIC_URL: Your application's public URL
OAUTH_ISSUER: OIDC provider URLOAUTH_CLIENT_ID: OAuth client IDOAUTH_CLIENT_SECRET: OAuth client secretOAUTH_GROUPS_CLAIM: Claim name for groups (default: 'groups')LOCALAUTH: Set to 'true' to enable /admin local login route (default: false)DISCORD_WEBHOOK_URL: Discord webhook for notificationsMQTT_BROKER: MQTT broker address
By default, local authentication via /admin is disabled for security. To enable it:
environment:
- LOCALAUTH=truePrintHive supports automatic role mapping from OIDC provider groups:
Group-Based Role Assignment:
- Users in Admin or Admins group → Assigned Super Admin role
- Users in Users or Friends group → Assigned User role
- Groups are case-insensitive
Configure your OIDC provider to include groups in the ID token:
environment:
- OAUTH_ISSUER=https://auth.yourdomain.com/application/o/printhive/
- OAUTH_CLIENT_ID=your-client-id
- OAUTH_CLIENT_SECRET=your-client-secret
- OAUTH_GROUPS_CLAIM=groups # Default claim nameUser Roles:
- Super Admin: Full access, can promote other users to super admin, manage all settings
- Admin: Can manage users, settings, and perform administrative tasks
- User: Can view and use printers, manage their own prints and library
Users can connect multiple Bambu Lab accounts to manage all their printers in one place:
- Add multiple accounts from different regions (Global/China)
- Set one account as primary
- Printers from all connected accounts appear in the dashboard
- Perfect for users with multiple Bambu Cloud accounts
Track manually sliced prints that aren't synced to Bambu Cloud:
What it does:
- Scans printer SD card for .gcode and .3mf files via FTP/FTPS
- Compares files to existing print history
- Automatically adds missing prints to your history
- Perfect for tracking prints sliced in OrcaSlicer, PrusaSlicer, or other third-party slicers
How to use:
- Navigate to Print History page
- Click Sync SD Card button
- Enter your printer's IP address and access code
- Click Sync SD Card to scan and import
Requirements:
- Printer must be accessible on your network
- FTP/FTPS access must be enabled (default on most Bambu printers)
- Access code from printer settings
Note: The printer doesn't need to be in LAN-only mode. When connecting via Bambu Lab account, you can find the access code in the Printers view.
Access database maintenance tools in Settings > Advanced > System:
- Vacuum Database: Removes unused space (shows size before/after and space saved)
- Analyze Database: Updates query statistics for optimization
- Rebuild Indexes: Rebuilds all database indexes
- Manual Backup: Create an immediate backup
All operations display detailed results in a modal popup.
Configure in Settings > Advanced > System > Backup Schedule:
- Local Backups: Automatic daily/weekly backups stored in
/data/backups - Backup Interval: Set frequency (1-365 days)
- Retention Period: Automatic cleanup after X days
Choose what to include in your backups:
- ✅ Timelapse Videos - Include all print timelapse videos
- ✅ Library Files - Include .3mf, .stl, .gcode files
- ✅ Cover Images - Include model cover images
- Database is always included
Uncheck options to create smaller, faster backups.
- Enable in Settings > Advanced > System > Remote Backup Location
- Choose protocol: SFTP (secure) or FTP
- Configure host, port, username, password, and remote path
- Click Test Connection to verify settings
- Save - backups will auto-upload when created
- Go to Settings > Advanced > System > Restore from Backup
- Select a backup from the dropdown list
- Click Refresh List to see the latest backups
- Click Restore Backup and confirm
- After restore completes, refresh the page
Configure in Settings > Advanced > System:
- Add maintenance tasks with intervals
- Set alerts and notifications
- Track completion history
- Get Discord alerts when maintenance is due
Manage users in Settings > Administration > User Management:
- View all users with their roles and authentication methods
- Change user roles (User, Admin, Super Admin)
- Super Admins can promote users to Super Admin
- Delete users (cannot delete last admin or super admin)
- See authentication method (Local, OIDC, etc.)
Role Permissions:
- Super Admin: Full system access, can manage all users and promote to super admin
- Admin: Can manage users (except super admins), configure settings
- User: Basic access to printers, prints, and personal library
- View user activity
Settings are organized in collapsible categories:
- Printer Connection: Bambu Lab account, FTP settings, RTSP camera
- Account: Profile, security, password changes
- Preferences: Cost calculator, UI settings
- Integrations: Discord webhooks, OAuth/SSO
- Advanced: Watchdog, database maintenance, backups
- Administration: User management (admins only)
See DOCKER.md for complete Docker and Unraid deployment instructions including:
- Docker Hub installation
- Docker Compose setup
- Unraid step-by-step guide with volume mappings
- Troubleshooting common issues
For production deployments with authentication and reverse proxy, see our comprehensive guides:
- Authentik SSO Integration - Set up enterprise authentication with Authentik
- Nginx Reverse Proxy Setup - Configure SSL and reverse proxy with Nginx
- Complete Production Setup - Full walkthrough combining both
Local Backups:
/app/data/backups/
├── printhive_backup_2024-01-06_1704528000000.db
├── printhive_backup_2024-01-05_1704441600000.db
└── ... (older backups auto-deleted based on retention)
Remote Backups:
- Enable SFTP/FTP in settings
- Backups automatically upload to remote server
- Same retention policy applies (files deleted after retention period)
# Install dependencies
npm install
# Start development server (frontend + backend)
npm run dev
# Build for production
npm run build
# Run production server
npm start
# Reset admin user
npm run reset-admin- Backend: Node.js, Express.js
- Frontend: React 19.2, Vite 7.2, TypeScript
- Database: SQLite (printhive.db)
- Authentication: OpenID Connect (OIDC)
- Real-time: MQTT for printer monitoring
- Backup: SFTP & FTP support
- Container: Docker with multi-architecture support
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
See CONTRIBUTING.md for detailed guidelines.
- Never commit your
.envfile with actual credentials - Use strong, random
SESSION_SECRETin production - Configure HTTPS in production deployments
- Passwords in database settings are masked (only updated if explicitly changed)
- Remote backup credentials are stored encrypted in config
- ✨ Added 10-second countdown to restart splash screen with manual refresh fallback
- ✨ Added filter UI to maintenance tasks for viewing/deleting old tasks
- ✨ Auto-refresh on server recovery when app restarts
- ✨ Added
/api/versionendpoint for version tracking - 🔧 Removed LOG_LEVEL from docker-compose (now managed in Settings)
- 🐛 Fixed splash screen to remove spinning animation and use splash.png background
- 📝 Improved maintenance task display with per-device filtering
- 🚀 Bump to semantic versioning with automatic sync
- 🎉 Full 3D printer management system
- 📊 Print history and statistics
- 🖼️ Model library with MakerWorld integration
- 🔄 Real-time MQTT monitoring with AMS support
- 🛡️ OIDC authentication with role-based access
- 🔐 Database maintenance and backup tools
- 📋 Maintenance task tracking with history
- 🐳 Docker container with watchdog process management
- 🎨 Dynamic theme customization
- 📱 Responsive web UI
PrintHive supports OIDC authentication with Authentik for enterprise-grade single sign-on.
- Running Authentik instance (https://goauthentik.io/)
- Admin access to Authentik
- PrintHive deployed and accessible via domain name
-
Create Provider
- Go to Applications > Providers > Create
- Select OAuth2/OpenID Provider
- Configure:
- Name:
PrintHive - Authentication flow:
default-authentication-flow - Authorization flow:
default-provider-authorization-explicit-consent - Client type:
Confidential - Client ID: Auto-generated (copy this!)
- Client Secret: Auto-generated (copy this!)
- Redirect URIs:
https://printhive.yourdomain.com/auth/callback - Signing Key:
authentik Self-signed Certificate
- Name:
-
Create Application
- Go to Applications > Applications > Create
- Configure:
- Name:
PrintHive - Slug:
printhive - Provider: Select the provider created above
- Launch URL:
https://printhive.yourdomain.com
- Name:
-
Configure Outpost (if using proxy)
- Go to Outposts > Select your outpost
- Add the PrintHive application
Option A: Via Environment Variables
Add to your docker-compose.yml or .env:
PUBLIC_URL=https://printhive.yourdomain.com
OAUTH_ISSUER=https://auth.yourdomain.com/application/o/printhive/
OAUTH_CLIENT_ID=your-client-id-from-authentik
OAUTH_CLIENT_SECRET=your-client-secret-from-authentik
OAUTH_REDIRECT_URI=https://printhive.yourdomain.com/auth/callbackOption B: Via Web Interface
- Login to PrintHive as admin
- Go to Settings > OAuth/SSO
- Enable OAuth and enter:
- Issuer URL:
https://auth.yourdomain.com/application/o/printhive/ - Client ID: From Authentik provider
- Client Secret: From Authentik provider
- Redirect URI:
https://printhive.yourdomain.com/auth/callback
- Issuer URL:
Some endpoints like share links should bypass authentication:
-
In Authentik, go to your Provider > Advanced protocol settings
-
Add to Redirect URIs/Origins:
https://printhive.yourdomain.com/library/share -
Or use Authentik's proxy provider with bypass rules:
^/library/share.* ^/api/health.*
- Navigate to
https://printhive.yourdomain.com - Click Login with SSO
- Authenticate via Authentik
- You'll be redirected back to PrintHive
"Invalid redirect_uri"
- Ensure the redirect URI in Authentik exactly matches:
https://printhive.yourdomain.com/auth/callback - Check for trailing slashes (don't use them)
"Failed to fetch user info"
- Verify the Issuer URL ends with
/(important!) - Check Authentik provider is assigned to the application
"Session not created"
- Ensure
SESSION_SECRETis set in environment variables - Check that cookies are enabled in browser
Configure Nginx as a reverse proxy with SSL for PrintHive.
- Nginx installed
- SSL certificate (Let's Encrypt recommended)
- Domain name pointing to your server
# Ubuntu/Debian
sudo apt update
sudo apt install nginx certbot python3-certbot-nginx
# RHEL/CentOS
sudo yum install nginx certbot python3-certbot-nginx# Replace with your actual domain
sudo certbot --nginx -d printhive.yourdomain.comFollow the prompts to complete certificate setup.
Create /etc/nginx/sites-available/printhive:
# Upstream to PrintHive container
upstream printhive_backend {
server localhost:3000;
keepalive 64;
}
# Redirect HTTP to HTTPS
server {
listen 80;
listen [::]:80;
server_name printhive.yourdomain.com;
location / {
return 301 https://$server_name$request_uri;
}
}
# HTTPS server
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name printhive.yourdomain.com;
# SSL Configuration
ssl_certificate /etc/letsencrypt/live/printhive.yourdomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/printhive.yourdomain.com/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers 'ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384';
ssl_prefer_server_ciphers off;
# Security Headers
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
# Max upload size (for 3D models)
client_max_body_size 500M;
# Timeouts for large uploads
client_body_timeout 300s;
client_header_timeout 300s;
# Logging
access_log /var/log/nginx/printhive_access.log;
error_log /var/log/nginx/printhive_error.log;
# Proxy to PrintHive
location / {
proxy_pass http://printhive_backend;
proxy_http_version 1.1;
# Headers
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
# WebSocket support (for future features)
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# Timeouts
proxy_connect_timeout 300s;
proxy_send_timeout 300s;
proxy_read_timeout 300s;
# Buffering
proxy_buffering off;
proxy_request_buffering off;
}
# Bypass auth for public share links (if using Authentik)
location /library/share {
proxy_pass http://printhive_backend;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# Health check endpoint
location /api/health {
proxy_pass http://printhive_backend;
access_log off;
}
}# Enable the site
sudo ln -s /etc/nginx/sites-available/printhive /etc/nginx/sites-enabled/
# Test configuration
sudo nginx -t
# Restart Nginx
sudo systemctl restart nginx
# Enable on boot
sudo systemctl enable nginx# UFW (Ubuntu/Debian)
sudo ufw allow 'Nginx Full'
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
# Firewalld (RHEL/CentOS)
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reloadUpdate your docker-compose.yml:
services:
printhive:
image: tr1ckz/printhive:latest
container_name: printhive
restart: unless-stopped
ports:
- "127.0.0.1:3000:3000" # Only bind to localhost
environment:
- PUBLIC_URL=https://printhive.yourdomain.com
- SESSION_SECRET=your-random-secret-here
volumes:
- ./data:/app/data
- ./sessions:/app/sessions
- ./library:/app/libraryRestart the container:
docker-compose down && docker-compose up -d- Visit
http://printhive.yourdomain.com- should redirect to HTTPS - Visit
https://printhive.yourdomain.com- should load PrintHive - Check SSL certificate: Click padlock icon in browser
Monitor Logs:
# Watch access logs
sudo tail -f /var/log/nginx/printhive_access.log
# Watch error logs
sudo tail -f /var/log/nginx/printhive_error.logReload Configuration:
# After making changes
sudo nginx -t && sudo systemctl reload nginxSSL Certificate Renewal:
# Certbot auto-renews, but you can test:
sudo certbot renew --dry-run
# Force renewal
sudo certbot renew --force-renewalFull walkthrough combining Authentik SSO and Nginx reverse proxy.
Internet → Nginx (443) → Authentik (optional) → PrintHive (3000)
↓
Let's Encrypt SSL
- Domain name configured (A record pointing to your server)
- Server with Docker and Docker Compose
- Ports 80 and 443 accessible
- Email address for Let's Encrypt notifications
# Install Docker
curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker $USER
# Install Docker Compose
sudo apt install docker-compose-pluginmkdir -p ~/printhive-prod
cd ~/printhive-prodversion: '3.8'
services:
printhive:
image: tr1ckz/printhive:latest
container_name: printhive
restart: unless-stopped
ports:
- "127.0.0.1:3000:3000"
environment:
- PORT=3000
- PUBLIC_URL=https://printhive.yourdomain.com
- SESSION_SECRET=${SESSION_SECRET}
# OAuth (optional - can configure via UI)
- OAUTH_ISSUER=${OAUTH_ISSUER:-}
- OAUTH_CLIENT_ID=${OAUTH_CLIENT_ID:-}
- OAUTH_CLIENT_SECRET=${OAUTH_CLIENT_SECRET:-}
- OAUTH_REDIRECT_URI=https://printhive.yourdomain.com/auth/callback
volumes:
- ./data:/app/data
- ./sessions:/app/sessions
- ./library:/app/library
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:3000/api/health"]
interval: 30s
timeout: 10s
retries: 3# Generate random session secret
SESSION_SECRET=$(openssl rand -hex 32)
cat > .env << EOF
SESSION_SECRET=${SESSION_SECRET}
# OAuth (fill in if using Authentik)
OAUTH_ISSUER=
OAUTH_CLIENT_ID=
OAUTH_CLIENT_SECRET=
EOF
chmod 600 .envdocker-compose up -d
docker-compose logs -fVerify it's running: curl http://localhost:3000/api/health
sudo apt update
sudo apt install nginx certbot python3-certbot-nginx
# Copy the Nginx config from above section
sudo nano /etc/nginx/sites-available/printhive
# Enable site
sudo ln -s /etc/nginx/sites-available/printhive /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginxsudo certbot --nginx -d printhive.yourdomain.comFollow the Authentik SSO Integration section above.
- Navigate to
https://printhive.yourdomain.com - Login with default credentials:
admin/admin - IMMEDIATELY change the password:
- Go to Settings > Account
- Click "Change Password"
- Configure your Bambu Lab printer:
- Settings > Printer Connection
- Enter IP, access code, serial number
- Go to Settings > Advanced > Database Backups
- Enable automatic backups
- Set retention period (e.g., 7 days)
- (Optional) Configure SFTP/FTP remote backup
- Changed default admin password
- Generated strong SESSION_SECRET
- SSL certificate installed and auto-renewing
- Firewall configured (only 80/443 open)
- Automatic backups enabled
- OAuth/SSO configured (recommended)
- Nginx security headers enabled
- Container only accessible via localhost
- Regular updates scheduled (
docker-compose pull && docker-compose up -d)
Update PrintHive:
cd ~/printhive-prod
docker-compose pull
docker-compose up -dView Logs:
docker-compose logs -fBackup Database Manually:
docker exec printhive sqlite3 /app/data/printhive.db ".backup '/app/data/backups/manual_backup.db'"Restart Services:
docker-compose restart
sudo systemctl restart nginxMIT License - feel free to use and modify as needed.
- Issues: Report bugs via GitHub Issues
- Documentation: Check README-ENV.md, DOCKER.md, and CONTRIBUTING.md
- Community: Contributions welcome!
- Bambu Lab for their 3D printers and API
- MakerWorld community for model sharing
- Contributors and testers
This is an unofficial integration with Bambu Lab cloud services. It is not affiliated with, endorsed by, or supported by Bambu Lab. Use at your own risk.