Setup Guide

Get YAFS up and running in minutes. Choose your preferred installation method below.

Prerequisites

Before installing YAFS, make sure you have the following:

  • Node.js 20+ (for manual setup)
  • PostgreSQL database
  • Docker (for containerized deployment)

Docker Setup

The fastest way to get started with YAFS.

1. Build the image

docker build -t yafs .

2. Run with Docker

docker run -d \
  -p 3000:3000 \
  -e DATABASE_URL=postgresql://user:password@host:5432/yafs \
  -e SESSION_SECRET=your-secret-key \
  -e API_TOKEN=your-api-token \
  -e API_USER_ID=1 \
  -v /path/to/uploads:/app/uploads \
  yafs

Docker Compose

Recommended for production deployments with a bundled PostgreSQL database.

docker-compose.yml

version: '3.8'

services:
  yafs:
    build: .
    ports:
      - "3000:3000"
    environment:
      - DATABASE_URL=postgresql://yafs:yafs@db:5432/yafs
      - SESSION_SECRET=change-this-in-production
      - API_TOKEN=your-api-token
      - API_USER_ID=1
    volumes:
      - uploads:/app/uploads
    depends_on:
      - db

  db:
    image: postgres:16-alpine
    environment:
      - POSTGRES_USER=yafs
      - POSTGRES_PASSWORD=yafs
      - POSTGRES_DB=yafs
    volumes:
      - pgdata:/var/lib/postgresql/data

volumes:
  uploads:
  pgdata:

Run with Docker Compose

docker compose up -d

Manual Setup

For development or custom deployments.

1. Clone the repository

git clone https://github.com/Charmunks/yafs.git
cd yafs

2. Install dependencies

npm install

3. Create environment file

cp .env.example .env

Edit the .env file with your database credentials and secrets.

4. Run database migrations

npm run migrate

5. Start the server

# Production
npm start

# Development with auto-reload
npm run dev

Environment Variables

Configure YAFS using the following environment variables:

Variable Description
PORT Server port (default: 3000)
DATABASE_URL PostgreSQL connection string
SESSION_SECRET Secret key for session encryption
API_TOKEN Token for programmatic file uploads
API_USER_ID User ID associated with API uploads

Need help?

Check out the GitHub repository for issues, discussions, and more documentation.

View on GitHub