Getting Started
Getting Started with Knitly
Section titled “Getting Started with Knitly”Installation
Section titled “Installation”Requirements
Section titled “Requirements”- Bun (Node.js runtime)
- SQLite3 (usually pre-installed on most systems)
- ffmpeg (optional, for video processing)
Quick Start
Section titled “Quick Start”1. Clone the Repository
Section titled “1. Clone the Repository”git clone https://github.com/knitly-app/knitly.gitcd knitly2. Install Dependencies
Section titled “2. Install Dependencies”bun install3. Start the Development Server
Section titled “3. Start the Development Server”bun run devThis starts:
- Frontend at http://localhost:5173
- API at http://localhost:3000
4. Create Your First Admin Account
Section titled “4. Create Your First Admin Account”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:
# Admin account onlybun --cwd server run seed
# Admin plus 20 test users (development)bun --cwd server run seed:devOverride the seeded admin credentials with environment variables:
ADMIN_EMAIL=you@example.com ADMIN_PASSWORD=yourpass bun --cwd server run seedEnvironment Variables
Section titled “Environment Variables”For development, copy the sample file to .env:
cp .env.sample .envFor production, use the production template:
cp deploy/env.production.example server/.env.productionRequired Variables (production)
Section titled “Required Variables (production)”| Variable | Example | Description |
|---|---|---|
NODE_ENV | production | Environment mode |
PORT | 3000 | API server port |
BASE_URL | https://your-domain.com | Public URL |
ALLOWED_ORIGINS | https://your-domain.com | CORS whitelist |
Database
Section titled “Database”| Variable | Default | Description |
|---|---|---|
DATABASE_PATH | ../knitly.db | SQLite file path |
Storage
Section titled “Storage”Local Filesystem (default):
| Variable | Default | Description |
|---|---|---|
USE_LOCAL_STORAGE | true | Use local storage |
LOCAL_UPLOAD_DIR | ../uploads | Media upload directory |
S3-Compatible Storage:
| Variable | Description |
|---|---|
SPACES_ENDPOINT | S3 endpoint (e.g., nyc3.digitaloceanspaces.com) |
SPACES_REGION | S3 region (e.g., nyc3) |
SPACES_BUCKET | Bucket name |
SPACES_KEY | Access key |
SPACES_SECRET | Secret key |
SPACES_PUBLIC_URL | CDN URL for uploads |
Deployment Options
Section titled “Deployment Options”Docker
Section titled “Docker”# Build and rundocker compose up -d
# View logsdocker compose logs -fEnvironment variables should be set in docker-compose.yml:
environment: - NODE_ENV=production - BASE_URL=https://your-domain.com - ALLOWED_ORIGINS=https://your-domain.comBare Metal (systemd)
Section titled “Bare Metal (systemd)”- Install dependencies:
# Ubuntu/Debiansudo apt install sqlite3 ffmpeg
# Arch Linuxsudo pacman -S sqlite ffmpeg- Build and deploy:
bun installbun run build- Create systemd service:
sudo cp deploy/knitly.service /etc/systemd/system/sudo systemctl edit knitly.service- Configure environment:
sudo mkdir -p /etc/knitlysudo cp deploy/env.production.example /etc/knitly/.envsudo nano /etc/knitly/.env # Edit with your values- Enable and start:
sudo systemctl daemon-reloadsudo systemctl enable knitlysudo systemctl start knitlyReverse Proxy (Caddy)
Section titled “Reverse Proxy (Caddy)”Example Caddyfile:
knitly.example.com { reverse_proxy localhost:3000}First Run
Section titled “First Run”- Visit your domain
- Complete the setup wizard (create the admin account, set the instance name and logo icon)
- Invite others via the admin panel
- Adjust the instance name and logo icon later in admin settings
Updating
Section titled “Updating”Git Update
Section titled “Git Update”git pull origin mainbun install # if dependencies changedbun run buildbun run start # or restart systemdDocker Update
Section titled “Docker Update”docker compose pulldocker compose up -dTroubleshooting
Section titled “Troubleshooting”Port Already in Use
Section titled “Port Already in Use”# Find process using port 3000lsof -i :3000# ornetstat -tulpn | grep :3000Database Schema
Section titled “Database Schema”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:
cp knitly.db knitly.db.backup# Developmentbun run dev # logs to console
# Production (systemd)journalctl -u knitly -f
# Dockerdocker compose logs -fNext Steps
Section titled “Next Steps”- Configuration - Deep dive into settings
- Custom Extensions - Add deployment-specific features
- API Documentation - Programmatic access
- Contributing - Development