Skip to main content

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

Step 1: Install Node.js

1

Download Node.js

Visit nodejs.org and download the LTS version.
brew install node@18
2

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:
npm install
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
}
{
  "node-cron": "^3.0.2",              // Task scheduling
  "cron": "^3.1.6",                   // Advanced scheduling
  "axios": "^1.6.0",                  // HTTP requests
  "moment": "^2.29.4"                 // Date/time handling
}
{
  "jimp": "^0.22.10",                           // Image manipulation
  "playwright": "^1.54.2",                      // Browser automation
  "microsoft-cognitiveservices-speech-sdk": "^1.45.0"  // TTS
}

Step 4: Configure API Credentials

YouTube Data API Setup

1

Create Google Cloud Project

  1. Navigate to Google Cloud Console
  2. Click “Select a project”“New Project”
  3. Enter project name: YouTube Automation Agent
  4. Click “Create”
Project creation takes 10-30 seconds. Wait for the notification before proceeding.
2

Enable YouTube Data API v3

  1. In the left sidebar: “APIs & Services”“Library”
  2. Search for: YouTube Data API v3
  3. Click on the API in results
  4. 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
3

Create OAuth 2.0 Credentials

  1. Navigate to: “APIs & Services”“Credentials”
  2. Click “Create Credentials”“OAuth client ID”
  3. If prompted, configure OAuth consent screen:
    • User Type: External
    • App name: YouTube Automation Agent
    • Support email: Your email
    • Scopes: Add youtube.upload, youtube.readonly
  4. Back to credentials, choose application type: Desktop app
  5. Name it: YouTube Automation Desktop
  6. Click “Create”
4

Download Credentials

  1. Click the download icon (⬇️) next to your new OAuth client
  2. Save the JSON file
  3. Rename to credentials.json
  4. 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:

Step 5: Run Setup Wizard

The interactive setup wizard configures everything:
npm run setup

Setup Wizard Flow

1

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 });
  }
}
2

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
}
3

Configure Credentials

Interactive prompts for:
  • YouTube channel selection
  • AI provider preference
  • API keys validation
  • Content preferences
  • Posting schedule
4

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);
}
5

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:
npm start
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

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:
1

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"
}
2

Test Content Generation

curl -X POST http://localhost:3456/generate \
  -H "Content-Type: application/json" \
  -d '{"topic": "Test Video"}'
3

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.