Deployment
SQLPage applications are easy to deploy using Docker containers, systemd services, or cloud platforms. This guide covers production deployment strategies.Docker Deployment
Docker is the recommended deployment method for most production environments.Official Docker Images
SQLPage provides official Docker images:lovasoa/sqlpage:latest- Latest stable release (minimal busybox-based image)lovasoa/sqlpage:main- Latest development buildlovasoa/sqlpage:duckdb- With DuckDB ODBC driver (Debian-based)
Basic Docker Setup
Dockerfile for Your Application
Create a custom image with your application:Docker Compose
For multi-container setups with a database:Systemd Service
For Linux servers without Docker, deploy using systemd.Installation
Systemd Unit File
Create/etc/systemd/system/sqlpage.service:
Manage the Service
Reverse Proxy Setup
NGINX
NGINX is recommended as a reverse proxy for SQLPage:Using Unix Sockets
For better performance when NGINX and SQLPage run on the same host: SQLPage configuration:Apache
Alternatively, use Apache as a reverse proxy:SSL/TLS Certificates
Option 1: Built-in HTTPS
SQLPage can handle HTTPS automatically with Let’s Encrypt:- Listen on port 443
- Request and renew certificates automatically
- Cache certificates in
sqlpage/https/
Option 2: Reverse Proxy SSL
Use Certbot with NGINX:Production Configuration
sqlpage/sqlpage.json
Environment Variables
For sensitive data, use environment variables:.env file (not committed to version control):
Database Migrations
SQLPage runs migrations automatically fromsqlpage/migrations/ on startup:
Monitoring and Logging
Application Logs
Docker:Log Levels
Set viaRUST_LOG environment variable:
Health Check Endpoint
Create a health check page:/health.sql.
Performance Tuning
Connection Pooling
Adjust based on your database and traffic:Caching
Use proxy caching for static content:Response Compression
Disable in SQLPage, enable in NGINX:Backup Strategies
SQLite Backups
PostgreSQL Backups
Security Checklist
- Use HTTPS (built-in or reverse proxy)
- Set secure cookie flags in production
- Enable Content Security Policy
- Use environment variables for secrets
- Implement authentication for sensitive pages
- Set appropriate file upload limits
- Enable rate limiting at reverse proxy
- Keep SQLPage updated
- Regular database backups
- Monitor logs for suspicious activity
Zero-Downtime Deployments
Blue-Green Deployment with Docker
Rolling Updates with Docker Swarm
Cloud Platform Deployment
AWS ECS
Use the official Docker image with ECS task definitions.Google Cloud Run
Deploy as a container:Fly.io
Createfly.toml:
Examples
See deployment examples:- NGINX reverse proxy:
examples/nginx/ - Apache proxy:
examples/web servers - apache/ - Docker Compose: Various examples include
docker-compose.yml