This guide will help you deploy Better Uptime using Docker and set up your first monitor in under 10 minutes.
Prerequisites
Before you begin, ensure you have the following installed:- Docker and Docker Compose (v2.0+)
- PostgreSQL database (local or cloud-hosted)
- GitHub OAuth App for authentication (Create one here)
- Resend API Key for email notifications (Get one here)
Environment Setup
Create a.env file in your project root with the following configuration:
.env
Docker Setup
Better Uptime provides two Docker configurations: development and production. Choose the one that fits your needs.- Development
- Production
Development Setup
The development configuration includes hot reload and is optimized for local development.Start development services
- Redis - Self-hosted Redis for streams
- Backend - Bun server with tRPC API
- Frontend - Next.js client with hot reload
- Worker - Processes uptime checks from Redis streams
- Publisher - Publishes website checks every 3 minutes
Access the application
- Frontend: http://localhost:3000
- Backend API: http://localhost:8084
- Redis: localhost:6379
Development Features
- Hot reload for all services (Bun
--hotflag, Next.js dev mode) - Volume mounts for live code changes
- Separate networks and volumes (
better-uptime-network-dev) - Development-friendly defaults
Useful Commands
Setting Up Your First Monitor
Once Better Uptime is running, you can create your first website monitor through the API or UI.Using the API
Authenticate
Sign in through GitHub OAuth at http://localhost:3000
Create a monitor
Use the tRPC API to register a website:The API validates URLs to ensure they use HTTP/HTTPS protocol:
Monitor Data Structure
When you create a monitor, the following data is stored:Viewing Monitor Status
Retrieve the status of your monitors:System Architecture
Better Uptime uses a modern tech stack for performance and reliability:- Backend: tRPC for type-safe APIs
- Time-Series Data: ClickHouse for metrics storage
- Streams: Redis for real-time uptime checks
- Monorepo: Turborepo for efficient builds
- Runtime: Bun for fast JavaScript execution
- Database: Prisma ORM with PostgreSQL
- Validation: Zod for schema validation
View Full Architecture
Explore the complete system architecture and data flow diagrams
Next Steps
Configure Monitoring
Learn about advanced monitoring options and configurations
Set Up Notifications
Configure email and webhook notifications for downtime alerts
API Reference
Explore the complete tRPC API documentation
Deploy to Production
Best practices for production deployment and scaling
Troubleshooting
Redis connection issues
Redis connection issues
If services can’t connect to Redis:
- Check Redis is healthy:
docker compose ps - Verify Redis password matches in
.env - Check network connectivity:
docker compose exec backend ping redis - View Redis logs:
docker compose logs redis
Port conflicts
Port conflicts
If ports are already in use:
- Change ports in
.envfile - Update docker-compose.yaml port mappings
- Restart services:
docker compose restart
Hot reload not working
Hot reload not working
For development environments:
- Verify volume mounts:
docker compose config - Check file permissions on mounted volumes
- Restart the service:
docker compose restart backend
Build failures
Build failures
If Docker builds fail:
- Clear Docker cache:
docker compose build --no-cache - Verify all package.json files exist
- Ensure pnpm-lock.yaml is up to date