Skip to content

Getting Started

  • Bun (Node.js runtime)
  • SQLite3 (usually pre-installed on most systems)
  • ffmpeg (optional, for video processing)
Terminal window
git clone https://github.com/knitly-app/knitly.git
cd knitly
Terminal window
bun install
Terminal window
bun run dev

This starts:

Visit http://localhost:5173 and complete the setup wizard. The wizard also lets you set the instance name and pick a logo icon. To seed an admin from the command line instead:

Terminal window
# Admin account only
bun --cwd server run seed
# Admin plus 20 test users (development)
bun --cwd server run seed:dev

Override the seeded admin credentials with environment variables:

Terminal window
ADMIN_EMAIL=you@example.com ADMIN_PASSWORD=yourpass bun --cwd server run seed

For development, copy the sample file to .env:

Terminal window
cp .env.sample .env

For production, use the production template:

Terminal window
cp deploy/env.production.example server/.env.production
VariableExampleDescription
NODE_ENVproductionEnvironment mode
PORT3000API server port
BASE_URLhttps://your-domain.comPublic URL
ALLOWED_ORIGINShttps://your-domain.comCORS whitelist
VariableDefaultDescription
DATABASE_PATH../knitly.dbSQLite file path

Local Filesystem (default):

VariableDefaultDescription
USE_LOCAL_STORAGEtrueUse local storage
LOCAL_UPLOAD_DIR../uploadsMedia upload directory

S3-Compatible Storage:

VariableDescription
SPACES_ENDPOINTS3 endpoint (e.g., nyc3.digitaloceanspaces.com)
SPACES_REGIONS3 region (e.g., nyc3)
SPACES_BUCKETBucket name
SPACES_KEYAccess key
SPACES_SECRETSecret key
SPACES_PUBLIC_URLCDN URL for uploads
Terminal window
# Build and run
docker compose up -d
# View logs
docker compose logs -f

Environment variables should be set in docker-compose.yml:

environment:
- NODE_ENV=production
- BASE_URL=https://your-domain.com
- ALLOWED_ORIGINS=https://your-domain.com
  1. Install dependencies:
Terminal window
# Ubuntu/Debian
sudo apt install sqlite3 ffmpeg
# Arch Linux
sudo pacman -S sqlite ffmpeg
  1. Build and deploy:
Terminal window
bun install
bun run build
  1. Create systemd service:
Terminal window
sudo cp deploy/knitly.service /etc/systemd/system/
sudo systemctl edit knitly.service
  1. Configure environment:
Terminal window
sudo mkdir -p /etc/knitly
sudo cp deploy/env.production.example /etc/knitly/.env
sudo nano /etc/knitly/.env # Edit with your values
  1. Enable and start:
Terminal window
sudo systemctl daemon-reload
sudo systemctl enable knitly
sudo systemctl start knitly

Example Caddyfile:

knitly.example.com {
reverse_proxy localhost:3000
}
  1. Visit your domain
  2. Complete the setup wizard (create the admin account, set the instance name and logo icon)
  3. Invite others via the admin panel
  4. Adjust the instance name and logo icon later in admin settings
Terminal window
git pull origin main
bun install # if dependencies changed
bun run build
bun run start # or restart systemd
Terminal window
docker compose pull
docker compose up -d
Terminal window
# Find process using port 3000
lsof -i :3000
# or
netstat -tulpn | grep :3000

Knitly has no migration tool. It creates its SQLite tables programmatically on startup, so a fresh database is ready on first run. Back up the file before upgrading:

Terminal window
cp knitly.db knitly.db.backup
Terminal window
# Development
bun run dev # logs to console
# Production (systemd)
journalctl -u knitly -f
# Docker
docker compose logs -f
  1. Configuration - Deep dive into settings
  2. Custom Extensions - Add deployment-specific features
  3. API Documentation - Programmatic access
  4. Contributing - Development