Skip to main content

Overview

Local deployment is the simplest way to get started with the YouTube Automation Agent. This option is perfect for:
  • Testing and development
  • Running automation on your personal computer
  • Small-scale operations (1-2 videos per day)
  • Learning how the system works
Local deployment is completely free but requires your computer to be running for automation to work.

Prerequisites

Node.js 18+

Download from nodejs.org

Google Account

For YouTube API access

AI Provider

OpenAI or Google Gemini account

10 Minutes

For initial setup and configuration

System Requirements

ComponentMinimumRecommended
CPUDual-coreQuad-core
RAM2 GB4 GB
Storage500 MB2 GB
OSWindows 10, macOS 10.15, Ubuntu 18.04Latest versions
InternetStable broadband connection

Installation Steps

1

Install Node.js

Download and install Node.js 18 or higher from nodejs.orgVerify installation:
node --version  # Should show v18.0.0 or higher
npm --version   # Should show 9.0.0 or higher
2

Clone the Repository

git clone https://github.com/darkzOGx/youtube-automation-agent.git
cd youtube-automation-agent
3

Install Dependencies

Install all required npm packages:
npm install
This will install:
  • Express server (port 3456)
  • Google APIs for YouTube
  • AI libraries (OpenAI, Google Generative AI)
  • Database (SQLite3)
  • Automation schedulers (node-cron)
  • And all other dependencies
4

Configure Environment Variables

Copy the example environment file:
cp .env.example .env
Edit .env with your preferred text editor and fill in:
# Application Settings
NODE_ENV=production
PORT=3456
LOG_LEVEL=info

# AI Provider (choose one)
OPENAI_API_KEY=sk-your-openai-key-here
# OR
GEMINI_API_KEY=your-gemini-key-here

# Channel Settings
CHANNEL_NAME=Your Channel Name
DEFAULT_AUTHOR=Your Name
TARGET_AUDIENCE=Your target audience

# YouTube Settings
YOUTUBE_REGION=US
DEFAULT_PRIVACY_STATUS=public

# Security
JWT_SECRET=generate-a-random-secret-here
5

Set Up YouTube API Credentials

  1. Go to Google Cloud Console
  2. Create a new project or select existing one
  3. Enable YouTube Data API v3
  4. Create OAuth 2.0 credentials (Desktop app)
  5. Download the JSON file
  6. Save it as config/credentials.json
Keep your credentials.json file secure and never commit it to version control!
6

Run Interactive Setup

The setup wizard will guide you through configuration:
npm run setup
This will:
  • Verify your credentials
  • Initialize the database
  • Configure your channel preferences
  • Set up automation schedules
7

Start the Agent

Start the main application:
npm start
You should see:
✓ Database initialized
✓ YouTube API connected
✓ AI service initialized
✓ Server running on http://localhost:3456
✓ Automation scheduler started
8

Access the Dashboard

Open your browser and navigate to:
http://localhost:3456
The dashboard provides:
  • Real-time automation status
  • Content generation controls
  • Analytics and performance metrics
  • Publishing schedule management

Available NPM Scripts

Core Commands

# Start the main application
npm start

# Run initial setup wizard
npm run setup

# Start daily automation scheduler
npm run scheduler

# Run system tests
npm run test

Agent Commands

Run individual agents manually:
npm run agent:strategy      # Content strategy planning
npm run agent:script        # Script writing
npm run agent:thumbnail     # Thumbnail generation
npm run agent:seo           # SEO optimization
npm run agent:production    # Production management
npm run agent:publishing    # Publishing & scheduling
npm run agent:analytics     # Analytics & optimization

Database Commands

npm run db:init             # Initialize database
npm run credentials:setup   # Set up OAuth credentials

Automation Schedule

Once running, the agent operates on this schedule:
TimeTaskDescription
6:00 AMContent GenerationStrategy, script, thumbnail, SEO
Every 15 minPublishing QueueProcesses scheduled uploads
9:00 AMAnalytics CollectionGathers performance data
10:00 PMOptimizationRuns improvement tasks
WeeklyStrategy ReviewPerformance analysis
All times are based on your system’s local timezone.

Manual Content Generation

Generate content on-demand using the API:
curl -X POST http://localhost:3456/generate \
  -H "Content-Type: application/json" \
  -d '{
    "topic": "10 Productivity Tips for 2026",
    "style": "listicle"
  }'

Monitoring and Logs

View Real-time Logs

# View application logs
tail -f logs/app.log

# View error logs
tail -f logs/error.log

# View agent-specific logs
tail -f logs/agents/*.log

Health Check

curl http://localhost:3456/health
Expected response:
{
  "status": "healthy",
  "uptime": 3600,
  "database": "connected",
  "youtube": "authenticated",
  "ai_service": "ready"
}

Running in Background

Using nohup:
nohup npm start > output.log 2>&1 &
Using screen:
screen -S youtube-agent
npm start
# Press Ctrl+A, then D to detach

# Reattach later:
screen -r youtube-agent

Troubleshooting

Port Already in Use

If port 3456 is already in use:
# Change port in .env
PORT=3457

YouTube API Quota Exceeded

  • Check Google Cloud Console quotas
  • Default limit: 10,000 units/day (sufficient for most use cases)
  • Implement rate limiting by adjusting schedule frequency

AI Service Connection Failed

1

Verify API Key

Check that your API key is correct in .env
2

Check Credits

For OpenAI: Ensure you have available credits For Gemini: Verify API is enabled
3

Test Connection

npm run test

Database Errors

Reinitialize the database:
# Backup existing data
cp data/youtube-automation.db data/youtube-automation.db.backup

# Reinitialize
npm run db:init

Stopping the Agent

Press Ctrl+C in the terminal

Data and Backups

Important Directories

  • data/ - Generated content, thumbnails, and database
  • logs/ - Application and error logs
  • uploads/ - Temporary upload files
  • config/ - Credentials and configuration

Backup Recommendations

# Create backup
tar -czf youtube-agent-backup-$(date +%Y%m%d).tar.gz \
  data/ config/ .env

# Restore from backup
tar -xzf youtube-agent-backup-20260305.tar.gz
Always backup before major updates or configuration changes!

Next Steps

VPS Deployment

Deploy to a VPS for 24/7 operation

Cloud Deployment

Scale with cloud platforms

Configuration

Advanced configuration options

API Reference

Explore API endpoints