Skip to main content

Bun Installation

Run BugPin directly with Bun for development or production deployments without Docker.

Prerequisites

  • Bun v1.1 or later
  • Git (to clone the repository)

Installation

1. Clone the Repository

git clone https://github.com/aranticlabs/bugpin.git
cd bugpin

2. Install Dependencies

bun install

Or using the Makefile:

make install

3. Configure Environment

# Copy the example environment file
cp .env.example .env

# Generate a secure secret key
echo "SECRET_KEY=$(openssl rand -base64 32)" >> .env

Edit .env to set your admin credentials:

SECRET_KEY=your-generated-secret-key
ADMIN_EMAIL=admin@yourdomain.com
ADMIN_PASSWORD=your-secure-password

4. Build for Production

bun run build

Or using the Makefile:

make build

This builds:

  • Server (TypeScript compilation)
  • Admin UI (React/Vite build)
  • Widget (Preact/Vite build)

5. Start the Server

bun run start

Or run directly:

bun run src/server/index.ts

BugPin is now running at http://localhost:7300.

Development Mode

For development with hot reload:

# Start everything (server + watch modes)
make dev

# Or start components separately:
bun run dev:server # Server with hot reload
bun run dev:admin # Admin UI with Vite HMR
bun run dev:widget # Widget with watch mode

Available Commands

CommandDescription
bun run devStart development server
bun run buildBuild all components for production
bun run startStart production server
bun run typecheckRun TypeScript type checking
bun run testRun tests
bun run migrateRun database migrations

Makefile Shortcuts

CommandDescription
make installInstall all dependencies
make devStart development server
make buildBuild for production
make typecheckType check all projects
make dev-adminStart admin UI dev server
make build-widgetBuild widget only

Data Directory

BugPin stores data in the data/ directory by default:

data/
├── bugpin.db # SQLite database
└── uploads/ # Uploaded screenshots and attachments

Configure the location with the DATA_DIR environment variable:

DATA_DIR=/var/lib/bugpin

Running as a Service

systemd (Linux)

Create /etc/systemd/system/bugpin.service:

[Unit]
Description=BugPin Bug Reporting Server
After=network.target

[Service]
Type=simple
User=bugpin
WorkingDirectory=/opt/bugpin
ExecStart=/usr/local/bin/bun run start
Restart=on-failure
RestartSec=10
Environment=NODE_ENV=production

[Install]
WantedBy=multi-user.target

Enable and start:

sudo systemctl enable bugpin
sudo systemctl start bugpin

PM2

# Install PM2
bun add -g pm2

# Start BugPin
pm2 start "bun run start" --name bugpin

# Save process list
pm2 save

# Setup startup script
pm2 startup

Updating

# Pull latest changes
git pull origin main

# Install any new dependencies
bun install

# Rebuild
bun run build

# Restart the server
# (method depends on how you're running it)

Reverse Proxy

For production, place BugPin behind a reverse proxy. See the Docker installation guide for Nginx and Traefik examples.

Comparison with Docker

AspectBunDocker
Setup complexityMore stepsSimpler
Resource usageLower overheadContainer overhead
UpdatesGit pull + rebuildDocker pull
IsolationShared systemContainerized
Best forDevelopment, custom setupsProduction, simplicity

Next Steps