Overview
OfflineTube can be accessed from any device on your local network (LAN). This allows you to run the server on one machine and access it from phones, tablets, or other computers.Default Configuration
OfflineTube is configured for network access out of the box:- Backend: Binds to
0.0.0.0:8001(accessible from any network interface) - Frontend: Auto-detects the hostname and connects to
{hostname}:8001
No configuration changes are needed for basic LAN access. The defaults work automatically.
Backend Configuration
The FastAPI backend is configured to accept connections from any network interface.Host Binding
Frommini-services/offlinetube-api/main.py:682:
The network interface the backend binds to.Options:
0.0.0.0- Listen on all network interfaces (LAN access enabled)127.0.0.1- Listen only on localhost (LAN access disabled)
The port the FastAPI backend listens on.
Why 0.0.0.0?
Binding to0.0.0.0 means the backend accepts connections on:
localhost(127.0.0.1)- LAN IP address (e.g., 192.168.1.100)
- Any other network interface
Frontend Configuration
The Next.js frontend automatically adapts to the access method.Auto-Detection
When you access the frontend from a device, it automatically uses that device’s hostname to connect to the backend. Example flow:- Server machine IP:
192.168.1.100 - Access from phone:
http://192.168.1.100:3000 - Frontend auto-connects to:
http://192.168.1.100:8001
src/app/page.tsx:19-30:
Manual Override
If auto-detection doesn’t work for your setup, manually set the backend URL:Network Setup Guide
Step 1: Start the Backend
On the server machine, start the FastAPI backend:Step 2: Start the Frontend
On the same machine, start the Next.js frontend:Step 3: Find Server IP Address
If the Network URL isn’t displayed, find your IP manually: Linux/Mac:192.168.1.100
Step 4: Access from Other Devices
On your phone, tablet, or other computer:- Ensure the device is on the same WiFi/LAN as the server
- Open a browser
- Navigate to
http://192.168.1.100:3000(use your server’s IP)
Firewall Configuration
Linux (UFW)
Allow incoming connections on ports 3000 and 8001:Linux (firewalld)
macOS
macOS typically allows local network connections by default. If issues occur:- Open System Preferences → Security & Privacy → Firewall
- Click Firewall Options
- Ensure Node.js and Python are allowed
Windows Firewall
Create inbound rules for ports 3000 and 8001:- Open Windows Defender Firewall → Advanced Settings
- Click Inbound Rules → New Rule
- Select Port → TCP → Enter
3000, 8001 - Allow the connection → Name it “OfflineTube”
Troubleshooting
Can’t Access from Other Devices
Check network connectivity:Backend Shows 127.0.0.1 Instead of 0.0.0.0
If you modified the backend startup, ensure you’re using0.0.0.0:
Frontend Connects to Wrong Backend
Check the Settings panel to see which API URL is being used:- Open OfflineTube
- Navigate to Configuración tab
- Check API URL under Conexión
NEXT_PUBLIC_API_URL explicitly:
CORS Errors in Browser Console
The backend is configured to allow all origins by default (main.py:80-86):
- Backend is actually running
- No proxy/VPN is interfering
- Browser console shows the correct API URL
Production Deployment
For production use with internet access, use a reverse proxy.Nginx Example
Network Performance Tips
Bandwidth Requirements
| Activity | Minimum Speed | Recommended Speed |
|---|---|---|
| 720p streaming | 5 Mbps | 10 Mbps |
| 1080p streaming | 10 Mbps | 25 Mbps |
| 4K streaming | 25 Mbps | 50+ Mbps |
| Downloading | N/A | Depends on internet |