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):
- Enable YouTube Data API v3
- Create OAuth 2.0 credentials
- Add redirect URI:
http://localhost:3000/api/auth/callback/google - Set
GOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRETin.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
| Script | Purpose |
|---|---|
npm run dev | Next.js dev server |
npm run worker | Background job processor |
npm run db:push | Push Prisma schema to the database |
npm run build | Production build |
npm run docs:dev | This documentation site (port 3001) |