Skip to main content

Getting started

Run Songs2YT locally for development or self-hosting.

1. Environment file

Copy the template, then edit only .env with your real values:

cp .env.example .env

See Environment variables for required vs optional keys.

2. PostgreSQL and Redis

docker compose up -d

3. Install and migrate

npm install
npm run db:push

4. Google OAuth

In Google Cloud Console (server-side only — end users never enter credentials):

  1. Enable YouTube Data API v3
  2. Create OAuth 2.0 credentials
  3. Add redirect URI: http://localhost:3000/api/auth/callback/google
  4. Set GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET in .env

5. FFmpeg

The worker needs FFmpeg. The ffmpeg-static npm package is used by default. Set FFMPEG_PATH only if you want a system binary instead.

6. Start web + worker

npm run dev
npm run worker

Or both together:

npm run dev:all

Open http://localhost:3000.

Authentication

Users sign in with Google via OAuth 2.0. The app connects their YouTube channel automatically — end users do not need Google Cloud credentials or API keys.

Useful scripts

ScriptPurpose
npm run devNext.js dev server
npm run workerBackground job processor
npm run db:pushPush Prisma schema to the database
npm run buildProduction build
npm run docs:devThis documentation site (port 3001)