Docker Deployment
Deploy GOTRS using Docker Compose for simple, self-contained deployments with automatic TLS.
Prerequisites
- Docker 20.10+ with Compose plugin OR Podman 3.0+ with Compose
- A domain name pointed to your server (for automatic TLS)
- Ports 80 and 443 available
Quick Start
# Create a directory for GOTRS
mkdir gotrs && cd gotrs
# Download deployment files
curl -O https://raw.githubusercontent.com/gotrs-io/gotrs-ce/main/deploy/docker-compose.yml
curl -O https://raw.githubusercontent.com/gotrs-io/gotrs-ce/main/deploy/.env.example
# Configure
cp .env.example .env
# Edit .env - see Configuration section below
# Start
docker compose up -d
Your GOTRS instance will be available at https://your-domain.com with automatic Let’s Encrypt TLS.
Configuration
Edit .env with your values. All CHANGE_ME values must be changed:
# Domain & TLS
DOMAIN=gotrs.example.com
ACME_EMAIL=[email protected]
# Image version (latest, stable, or specific like v0.6.0)
GOTRS_TAG=latest
# Database - CHANGE THESE
DB_ROOT_PASSWORD=your-secure-root-password
DB_USER=gotrs
DB_PASSWORD=your-secure-password
DB_NAME=gotrs
# Security - CHANGE THIS
# Generate with: openssl rand -base64 32
JWT_SECRET=your-random-string-minimum-32-characters
# Application
APP_ENV=production
GIN_MODE=release
LOG_LEVEL=warn
BASE_URL=https://gotrs.example.com
Environment Variables Reference
| Variable | Required | Description | Default |
|---|---|---|---|
DOMAIN | Yes | Your domain name for HTTPS | - |
ACME_EMAIL | Yes | Email for Let’s Encrypt | - |
GOTRS_TAG | No | Image tag to use | latest |
DB_ROOT_PASSWORD | Yes | MariaDB root password | - |
DB_USER | No | MariaDB username | gotrs |
DB_PASSWORD | Yes | MariaDB user password | - |
DB_NAME | No | Database name | gotrs |
JWT_SECRET | Yes | JWT signing secret (32+ chars) | - |
BASE_URL | No | Public URL for the application | https://$DOMAIN |
LOG_LEVEL | No | Logging verbosity | warn |
Image Tags
| Tag | Description |
|---|---|
latest | Latest release from main branch |
stable | Alias for latest stable release |
v1.2.3 | Specific version (recommended for production) |
dev | Latest development build (unstable) |
Services
The deployment includes:
| Service | Purpose |
|---|---|
caddy | Reverse proxy with automatic TLS |
app | Main GOTRS application (agent interface) |
customer-fe | Customer portal frontend |
runner | Background job processor |
mariadb | MariaDB database |
valkey | Redis-compatible cache |
Operations
View Logs
# All services
docker compose logs -f
# Specific service
docker compose logs -f app
docker compose logs -f runner
Stop and Start
# Stop
docker compose down
# Start
docker compose up -d
# Restart a service
docker compose restart app
Update to Latest Version
docker compose pull
docker compose up -d
Update to Specific Version
# Edit .env
GOTRS_TAG=v0.6.0
# Then pull and restart
docker compose pull
docker compose up -d
Backup and Restore
Database Backup
# Backup
docker compose exec mariadb mariadb-dump -u root -p gotrs > backup-$(date +%Y%m%d).sql
# Restore
docker compose exec -T mariadb mariadb -u root -p gotrs < backup.sql
Automated Backups
Create a cron job for regular backups:
# /etc/cron.daily/gotrs-backup
#!/bin/bash
cd /path/to/gotrs
docker compose exec -T mariadb mariadb-dump -u root -p"$DB_ROOT_PASSWORD" gotrs | gzip > /backups/gotrs-$(date +%Y%m%d).sql.gz
find /backups -name "gotrs-*.sql.gz" -mtime +30 -delete
Production Considerations
This deployment is suitable for small to medium installations. For larger deployments, consider:
- External database: Use managed MariaDB/MySQL (RDS, Cloud SQL, etc.)
- Secrets management: Use Docker secrets or external vault instead of
.envfiles - Volume backups: Implement automated backup strategy
- Resource limits: Add memory and CPU limits to services
- Monitoring: Add Prometheus/Grafana for observability
- High availability: Consider Kubernetes deployment for HA requirements
Troubleshooting
Check Service Status
docker compose ps
Service Won’t Start
# Check logs for errors
docker compose logs app
# Verify environment variables
docker compose config
Database Connection Issues
# Check if database is healthy
docker compose ps mariadb
# Test connectivity
docker compose exec app nc -zv mariadb 3306
TLS Certificate Issues
# Check Caddy logs
docker compose logs caddy
# Verify domain DNS
dig your-domain.com
Reset to Clean State
# Stop and remove everything including volumes
docker compose down -v
# Start fresh
docker compose up -d
Next Steps
- Admin Guide - Configure GOTRS after installation
- Kubernetes Deployment - Scale with Kubernetes for enterprise
- API Documentation - Integrate with external systems