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
| Command | Description |
|---|---|
bun run dev | Start development server |
bun run build | Build all components for production |
bun run start | Start production server |
bun run typecheck | Run TypeScript type checking |
bun run test | Run tests |
bun run migrate | Run database migrations |
Makefile Shortcuts
| Command | Description |
|---|---|
make install | Install all dependencies |
make dev | Start development server |
make build | Build for production |
make typecheck | Type check all projects |
make dev-admin | Start admin UI dev server |
make build-widget | Build 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
| Aspect | Bun | Docker |
|---|---|---|
| Setup complexity | More steps | Simpler |
| Resource usage | Lower overhead | Container overhead |
| Updates | Git pull + rebuild | Docker pull |
| Isolation | Shared system | Containerized |
| Best for | Development, custom setups | Production, simplicity |