4.9 KiB
4.9 KiB
NextAV Deployment Guide
This guide will help you deploy NextAV using Docker for a production-ready setup.
Quick Start
Prerequisites
- Docker & Docker Compose
- At least 2GB RAM and 10GB disk space
- FFmpeg (for thumbnail generation)
1. Clone and Setup
git clone <your-repo-url> nextav
cd nextav
2. Configure Environment
# Copy environment file
cp .env.example .env
# Edit .env with your settings
nano .env
3. Deploy with Docker
# Make deploy script executable
chmod +x deploy.sh
# Run deployment
./deploy.sh
4. Access NextAV
Open your browser to http://localhost:3000
Manual Deployment
Using Docker Compose
# Build and start
docker-compose up -d --build
# View logs
docker-compose logs -f nextav
# Stop services
docker-compose down
Production with SSL (Optional)
# For production with SSL
docker-compose --profile production up -d
Configuration
Environment Variables
| Variable | Description | Default |
|---|---|---|
DATABASE_URL |
SQLite database path | file:./data/nextav.db |
NODE_ENV |
Environment mode | production |
NEXT_PUBLIC_BASE_URL |
Base URL for the app | http://localhost:3000 |
NEXT_PUBLIC_MEDIA_ROOT |
Media library root | /app/media |
Directory Structure
nextav/
├── data/ # Database and app data
├── media/ # Media libraries
├── ssl/ # SSL certificates (optional)
├── docker-compose.yml
├── Dockerfile
├── .env
└── deploy.sh
Media Libraries Setup
Adding Media Libraries
-
Create directories in the
media/folder:mkdir -p media/videos media/photos -
Mount your existing media:
# Example: mount existing photo library docker-compose down # Edit docker-compose.yml to add your volume docker-compose up -d
Volume Mapping Examples
In docker-compose.yml:
volumes:
- /path/to/your/media:/app/media/yourlibrary
- /path/to/another/library:/app/media/another
Production Deployment
SSL Certificates
# Create SSL directory
mkdir ssl
# Generate self-signed certificates (for testing)
openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
-keyout ssl/key.pem -out ssl/cert.pem
# For production, use Let's Encrypt certificates
Reverse Proxy (Nginx)
The production profile includes Nginx with:
- SSL termination
- Gzip compression
- Security headers
- WebSocket support
Health Checks
The application includes health checks at /api/health which verify:
- Database connectivity
- Media directory accessibility
- Application responsiveness
Monitoring
View Logs
# All services
docker-compose logs -f
# Specific service
docker-compose logs -f nextav
Service Status
docker-compose ps
docker stats
Troubleshooting
Common Issues
Port 3000 already in use:
# Check what's using port 3000
lsof -i :3000
# Use different port
docker-compose up -d --scale nextav=1 --build
Database permission issues:
# Fix permissions
sudo chown -R 1001:1001 ./data
FFmpeg not found:
# Ensure FFmpeg is available
which ffmpeg
# Or use Docker container
Reset Everything
# Stop and remove containers
docker-compose down
# Remove volumes (WARNING: deletes data)
docker-compose down -v
# Rebuild and start
docker-compose up -d --build
Updates
Updating NextAV
# Pull latest changes
git pull origin main
# Rebuild and restart
docker-compose down
docker-compose up -d --build
Database Updates
For database schema changes:
# Backup database
cp data/nextav.db data/nextav.db.backup
# Apply updates (if needed)
docker-compose down
docker-compose up -d
Security
Basic Security
- Uses non-root user in container
- Runs with minimal privileges
- Includes security headers in production
Production Hardening
- Use proper SSL certificates
- Configure firewall rules
- Set up log rotation
- Use secrets management for sensitive data
Performance Tuning
Resource Limits
Edit docker-compose.yml to set limits:
services:
nextav:
deploy:
resources:
limits:
cpus: '2.0'
memory: 2G
reservations:
cpus: '0.5'
memory: 512M
Database Optimization
- SQLite is optimized for read-heavy workloads
- Consider PostgreSQL for high-traffic sites
- Regular database maintenance recommended
Support
For issues and feature requests, please check:
- Docker logs:
docker-compose logs - Health endpoint:
curl http://localhost:3000/api/health - System resources:
docker stats
Build/Push Docker image to private repo
Usage:
Build & push to private registry
docker build -t 192.168.2.212:3000/tigeren/nextav:1.6 . docker push 192.168.2.212:3000/tigeren/nextav:1.6
docker login 192.168.2.212:3000