Installation Guide
This comprehensive guide covers everything you need to install, configure, and deploy the YouTube Automation Agent.
Prerequisites
Node.js 18+ JavaScript runtime required for the application
Google Account For YouTube Data API access
AI Provider Account OpenAI or Google AI Studio account
10 Minutes Initial setup and configuration time
System Requirements
OS : Windows 10+, macOS 10.15+, Ubuntu 20.04+
CPU : 2 cores
RAM : 2 GB available
Storage : 5 GB free space
Network : Stable internet connection
OS : Windows 11, macOS 12+, Ubuntu 22.04+
CPU : 4+ cores
RAM : 4 GB available
Storage : 20 GB free space (for media files)
Network : High-speed internet (10+ Mbps)
Step 1: Install Node.js
Download Node.js
Visit nodejs.org and download the LTS version. macOS (Homebrew)
Ubuntu/Debian
Windows (Chocolatey)
Verify Installation
node --version # Should show v18.x.x or higher
npm --version # Should show 9.x.x or higher
Step 2: Clone Repository
git clone https://github.com/darkzOGx/youtube-automation-agent.git
cd youtube-automation-agent
Step 3: Install Dependencies
Install all required npm packages:
This installs:
{
"googleapis" : "^128.0.0" , // YouTube API integration
"express" : "^4.18.2" , // Web server
"sqlite3" : "^5.1.6" , // Database
"dotenv" : "^16.3.1" , // Environment variables
"winston" : "^3.11.0" // Logging
}
{
"openai" : "^4.20.0" , // OpenAI GPT-4, DALL-E
"@google/generative-ai" : "^0.1.3" , // Google Gemini
"replicate" : "^1.0.1" // Alternative AI models
}
YouTube Data API Setup
Create Google Cloud Project
Navigate to Google Cloud Console
Click “Select a project” → “New Project”
Enter project name: YouTube Automation Agent
Click “Create”
Project creation takes 10-30 seconds. Wait for the notification before proceeding.
Enable YouTube Data API v3
In the left sidebar: “APIs & Services” → “Library”
Search for: YouTube Data API v3
Click on the API in results
Click “Enable” button
// The API provides 10,000 quota units per day (FREE)
// Typical usage:
// - Search: 100 units
// - Video details: 1 unit
// - Upload: 1,600 units
// Daily automation uses ~2,000-3,000 units
Create OAuth 2.0 Credentials
Navigate to: “APIs & Services” → “Credentials”
Click “Create Credentials” → “OAuth client ID”
If prompted, configure OAuth consent screen:
User Type: External
App name: YouTube Automation Agent
Support email: Your email
Scopes: Add youtube.upload, youtube.readonly
Back to credentials, choose application type: Desktop app
Name it: YouTube Automation Desktop
Click “Create”
Download Credentials
Click the download icon (⬇️) next to your new OAuth client
Save the JSON file
Rename to credentials.json
Move to config/credentials.json in your project:
mkdir -p config
mv ~/Downloads/client_secret_ * .json config/credentials.json
AI Provider Setup
Choose one of the following AI providers:
OpenAI (Recommended)
Google Gemini (FREE)
Custom (Advanced)
OpenAI Setup
Generate API Key
Go to API Keys
Click “Create new secret key”
Name it: YouTube Automation
Copy the key (starts with sk-proj-)
Save your API key immediately! You won’t be able to see it again.
Add Credits
Go to Billing
Click “Add payment method”
Add $5-10 to start (lasts 20-50 videos)
Configure in .env
OPENAI_API_KEY = sk-proj-your-key-here
Pricing Overview :
GPT-4: $0.01 per 1K tokens (~750 words)
DALL-E 3: $0.040 per image (1024x1024)
Total per video : ~$0.10-0.30
Google Gemini Setup
Get API Key
Click “Get API Key” in the top right
Choose “Create API key in new project” or select existing project
Click “Create API key”
Copy the key (starts with AIza)
Configure in .env
GEMINI_API_KEY = AIza-your-key-here
Free Tier :
60 requests per minute
1,500 requests per day
Perfect for 3-5 videos daily at $0 cost
Custom AI Integration You can integrate any OpenAI-compatible API: // Example: Anthropic Claude
const Anthropic = require ( '@anthropic-ai/sdk' );
const anthropic = new Anthropic ({
apiKey: process . env . ANTHROPIC_API_KEY
});
async generateContent ( prompt ) {
const response = await anthropic . messages . create ({
model: 'claude-3-sonnet-20240229' ,
max_tokens: 1024 ,
messages: [{ role: 'user' , content: prompt }]
});
return response . content [ 0 ]. text ;
}
Or use local models: # Install Ollama
curl https://ollama.ai/install.sh | sh
# Run local model
ollama run llama2
# Configure endpoint
OLLAMA_API_URL = http://localhost:11434
Step 5: Run Setup Wizard
The interactive setup wizard configures everything:
Setup Wizard Flow
Create Directories
async createDirectories () {
const directories = [
'config' , // Configuration files
'logs' , // Application logs
'data' , // Generated content
'data/production' , // Production assets
'data/assets' , // Media assets
'data/videos' , // Video files
'data/audio' , // Audio files
'data/scripts' , // Generated scripts
'data/captions' , // Caption files
'data/thumbnail-templates' , // Thumbnail templates
'temp/processing' , // Temporary processing
'uploads/thumbnails' // Upload queue
];
for ( const dir of directories ) {
await fs . mkdir ( path . join ( __dirname , dir ), { recursive: true });
}
}
Initialize Database
async initializeDatabase () {
this . db = new Database ();
await this . db . initialize ();
// Creates tables:
// - content_strategies
// - scripts
// - thumbnails
// - seo_data
// - productions
// - publish_schedule
// - analytics_reports
// - keyword_performance
// - content_history
// - settings
}
Configure Credentials
Interactive prompts for:
YouTube channel selection
AI provider preference
API keys validation
Content preferences
Posting schedule
Generate Environment File
async createEnvironmentFile () {
const envContent = `
# Application Settings
NODE_ENV=production
PORT=3456
LOG_LEVEL=info
# YouTube Settings
YOUTUBE_REGION=US
DEFAULT_PRIVACY_STATUS=public
# Content Settings
AUTO_SHORTEN_CONTENT=true
AUTO_ADD_BACKLINKS=true
PRESERVE_FORMATTING=true
# Rate Limiting
GLOBAL_RATE_LIMIT_PER_HOUR=50
DEFAULT_DELAY_BETWEEN_POSTS=60000
# Security
JWT_SECRET= ${ this . generateJWTSecret () }
# Automation
DAILY_CONTENT_ENABLED=true
AUTO_PUBLISH_ENABLED=true
OPTIMIZATION_ENABLED=true
CONTENT_BUFFER_DAYS=3
MAX_DAILY_POSTS=1
` ;
await fs . writeFile ( '.env' , envContent );
}
Validate Setup
async validateSetup () {
// Check directories exist
await fs . access ( 'data' );
await fs . access ( 'logs' );
await fs . access ( 'config' );
// Check database
const stats = await this . database . getStats ();
// Validate credentials
const valid = await this . credentialManager . validateAll ();
// Check environment
await fs . access ( '.env' );
}
Step 6: Start the Application
Launch the automation agent:
Successful startup shows:
🎬 YouTube Automation Agent v1.0
──────────────────────────────────────────────────
ℹ Initializing database...
✓ Database initialized successfully
ℹ Loading credentials...
ℹ Initializing agents...
ℹ ✓ strategy agent initialized
ℹ ✓ scriptWriter agent initialized
ℹ ✓ thumbnailDesigner agent initialized
ℹ ✓ seoOptimizer agent initialized
ℹ ✓ production agent initialized
ℹ ✓ publishing agent initialized
ℹ ✓ analytics agent initialized
ℹ Setting up automation scheduler...
ℹ Started scheduled task: daily-content-generation
ℹ Started scheduled task: publish-queue-processing
ℹ Started scheduled task: daily-analytics
ℹ Started scheduled task: weekly-strategy-review
ℹ Started scheduled task: daily-optimization
ℹ Started scheduled task: database-maintenance
✓ YouTube Automation Agent initialized successfully!
✅ YouTube Automation Agent running on port 3456
──────────────────────────────────────────────────
📊 Dashboard: http://localhost:3456
🔧 API Health: http://localhost:3456/health
📅 Schedule: http://localhost:3456/schedule
📈 Analytics: http://localhost:3456/analytics
──────────────────────────────────────────────────
🤖 Automation is active. Content will be generated and posted daily.
Deployment Options
Local Development
Run on your computer during development:
# Development mode with auto-restart
npm install -g nodemon
nodemon index.js
Production Deployment
Process Manager for Node.js # Install PM2
npm install -g pm2
# Start application
pm2 start index.js --name youtube-automation
# Enable startup script
pm2 startup
pm2 save
# Monitor
pm2 monit
# View logs
pm2 logs youtube-automation
# Restart
pm2 restart youtube-automation
The setup wizard creates ecosystem.config.js: module . exports = {
apps: [{
name: 'youtube-automation-agent' ,
script: 'index.js' ,
instances: 1 ,
autorestart: true ,
watch: false ,
max_memory_restart: '1G' ,
env: {
NODE_ENV: 'production' ,
PORT: 3456
}
}]
};
Docker Deployment Create Dockerfile: FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
EXPOSE 3456
CMD [ "node" , "index.js" ]
Create docker-compose.yml: version : '3.8'
services :
youtube-automation :
build : .
ports :
- "3456:3456"
volumes :
- ./data:/app/data
- ./logs:/app/logs
- ./config:/app/config
env_file :
- .env
restart : unless-stopped
Deploy: Cloud VPS Deployment
Create VPS
Provider: DigitalOcean, Linode, Vultr
Plan: $5-10/month (1-2 GB RAM)
OS: Ubuntu 22.04 LTS
SSH and Setup
# Connect to VPS
ssh root@your-vps-ip
# Update system
apt update && apt upgrade -y
# Install Node.js
curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
apt install -y nodejs
# Install Git
apt install -y git
Clone and Configure
# Clone repository
git clone https://github.com/darkzOGx/youtube-automation-agent.git
cd youtube-automation-agent
# Install dependencies
npm install
# Configure environment
nano .env
# (Add your API keys)
# Setup credentials
mkdir config
nano config/credentials.json
# (Paste YouTube API credentials)
Start with PM2
# Install PM2
npm install -g pm2
# Start application
pm2 start index.js --name youtube-automation
# Configure startup
pm2 startup systemd
pm2 save
# Setup nginx reverse proxy (optional)
apt install -y nginx
# Configure nginx for domain access
Configuration Reference
Environment Variables
NODE_ENV = production # Environment (development/production)
PORT = 3456 # Server port
LOG_LEVEL = info # Logging level (debug/info/warn/error)
YOUTUBE_REGION = US # YouTube region code
DEFAULT_PRIVACY_STATUS = public # Video privacy (public/private/unlisted)
CHANNEL_NAME = Your Channel Name
TARGET_AUDIENCE = Your target audience
POSTING_FREQUENCY = daily # daily/every-2-days/3-per-week/weekly
CONTENT_BUFFER_DAYS = 3 # Days of content to keep ready
MAX_DAILY_POSTS = 1 # Maximum posts per day
DAILY_CONTENT_ENABLED = true
AUTO_PUBLISH_ENABLED = true
OPTIMIZATION_ENABLED = true
ANALYTICS_ENABLED = true
Verification
Confirm everything is working:
Health Check
curl http://localhost:3456/health
Should return: {
"status" : "healthy" ,
"initialized" : true ,
"agents" : [ "strategy" , "scriptWriter" , "thumbnailDesigner" , "seoOptimizer" , "production" , "publishing" , "analytics" ],
"timestamp" : "2026-03-05T12:00:00.000Z"
}
Test Content Generation
curl -X POST http://localhost:3456/generate \
-H "Content-Type: application/json" \
-d '{"topic": "Test Video"}'
Check Logs
# View application logs
tail -f logs/application.log
# Or with PM2
pm2 logs youtube-automation
Next Steps
API Reference Explore available API endpoints
Configuration Advanced configuration options
Agents Learn about each AI agent
Troubleshooting Common issues and solutions
Installation Complete! Your YouTube Automation Agent is now running and will automatically generate and publish content according to your schedule.