Prerequisites
Before deploying, ensure you have:- A Slack app created with the provided manifest
- All required API keys and credentials (see Environment Variables)
- A PostgreSQL database (Neon, Supabase, or self-hosted)
- A Redis instance (Upstash, Redis Cloud, or self-hosted)
Production Deployment Options
Option 1: Socket Mode (Recommended for Quick Setup)
Socket Mode uses WebSocket connections and doesn’t require a public URL.Configure Socket Mode
Set these environment variables:The
SLACK_APP_TOKEN requires connections:write scope in your Slack app.Socket Mode is great for getting started quickly but HTTP mode is recommended for high-scale production deployments.
Option 2: HTTP Mode (Recommended for Production)
HTTP mode uses webhook endpoints and requires a public URL.Set up Request URL in Slack
Configure your Slack app’s Request URL:
- Go to your Slack app settings
- Navigate to Event Subscriptions
- Set Request URL to:
https://your-domain.com/slack/events - Slack will verify the endpoint
Deploy with a reverse proxy
Use nginx, Caddy, or your cloud provider’s load balancer to handle HTTPS:
Platform-Specific Guides
Railway
Create a new Railway project
- Connect your GitHub repository
- Railway will auto-detect the Bun runtime
Add databases
- Add PostgreSQL plugin
- Add Redis plugin
- Railway will automatically set
DATABASE_URLandREDIS_URL
Render
Docker
While there’s no production Dockerfile included, you can create one:VPS / Self-Hosted
Set up process manager
Use PM2, systemd, or another process manager. See Process Management below.
Process Management
Using PM2
Using systemd
Create/etc/systemd/system/gorkie.service:
Health Checks
Gorkie doesn’t include a built-in health check endpoint, but you can implement one:Monitoring
Application Logs
Gorkie uses Pino for structured logging. Logs are written to:- Console (stdout/stderr)
- Log files in
LOG_DIRECTORY(default:./logs)
Langfuse Observability
If configured, Langfuse provides AI tracing:- Set
LANGFUSE_SECRET_KEY,LANGFUSE_PUBLIC_KEY, andLANGFUSE_BASEURL - View traces at https://cloud.langfuse.com
- Monitor model calls, latencies, and costs
Database Migrations
Run migrations during deployment:Performance Optimization
Resource Allocation
- Memory: Allocate at least 512MB, recommended 1GB+
- CPU: 1 vCPU minimum, 2+ recommended for busy workspaces
Environment Settings
Redis Configuration
Use Redis for caching user permissions and rate limiting:- Connection pool: Handled by Bun’s
RedisClient - Persistence: Enable RDB or AOF in Redis config
- Eviction: Set
maxmemory-policytoallkeys-lru
Troubleshooting
Socket Mode Connection Issues
- Verify
SLACK_APP_TOKENhasconnections:writescope - Check firewall allows outbound WebSocket connections
- Review logs for connection errors
HTTP Mode Request Verification Failed
- Ensure
SLACK_SIGNING_SECRETis correct - Verify HTTPS is properly configured
- Check reverse proxy passes headers correctly
Database Connection Errors
- Verify
DATABASE_URLformat and credentials - Check database is accessible from deployment environment
- Ensure SSL mode matches database requirements
Redis Connection Errors
- Verify
REDIS_URLformat and credentials - Check Redis is accessible from deployment environment
- Test connection:
redis-cli -u $REDIS_URL ping
Security Checklist
All environment variables stored securely (not in code)
HTTPS enabled for HTTP mode deployments
Database uses SSL/TLS connections
Redis uses authentication and SSL (if exposed)
Firewall configured to allow only necessary ports
Regular updates of dependencies:
bun updateMonitoring and alerting configured
Log files rotated and secured