This repository contains a Docker Compose configuration for self-hosting Trigger.dev, a powerful workflow automation platform. The setup includes all necessary services: web application, PostgreSQL database, Redis, ElectricSQL, ClickHouse, Docker registry, MinIO object storage, and supervisor components.
- Create New Project: Go to Coolify v4 > Projects > New > Public GitHub
- Repository URL:
https://github.com/essamamdani/coolify-trigger-v4.git
- Build Settings: Select "Build" > "docker-compose"
- Click Next
- Add Ports:
- Web App:
:3000
(use Coolify generated URL or custom domain) - Registry:
:5000
(use Coolify generated URL or custom domain)
- Web App:
- Deploy the application
After the first deployment, you need to update the network configuration:
- Find Network Name: In your Coolify project, locate the generated network name (it will be something like
project-xxx-net
) - Update Environment: Add to your
.env
file:DOCKER_RUNNER_NETWORKS=your-generated-network-name
- Redeploy the application
Before going to production, update the registry credentials:
-
Generate new password file:
docker run --rm --entrypoint htpasswd httpd:2 -Bbn your-username your-secure-password > registry/auth.htpasswd
-
Update environment variables in Coolify:
REGISTRY_USERNAME=your-username REGISTRY_PASSWORD=your-secure-password
-
Redeploy to apply security changes
- Web App: Main Trigger.dev application (Port 3000)
- PostgreSQL: Primary database
- Redis: Caching and session storage
- ElectricSQL: Real-time database synchronization
- ClickHouse: Analytics and event storage
- Registry: Private Docker registry for deployments (Port 5000)
- MinIO: Object storage for packages and assets
- Supervisor: Manages worker execution and Docker operations
The Docker registry uses HTTP Basic Authentication with default credentials that are not secure for production use.
Default Settings:
- Registry URL:
localhost:5000
(internal) or your Coolify domain - Username:
trigger
- Password:
very-secure-indeed
You MUST change these default credentials before deploying to production!
The default password very-secure-indeed
is clearly insecure. To update the registry authentication:
-
Create the auth directory if it doesn't exist:
mkdir -p registry
-
Generate a new password file using Docker:
docker run \ --entrypoint htpasswd \ httpd:2 -Bbn your-username your-secure-password > registry/auth.htpasswd
On Windows, ensure correct encoding:
docker run --rm --entrypoint htpasswd httpd:2 -Bbn your-username your-secure-password | Set-Content -Encoding ASCII registry/auth.htpasswd
Replace
your-username
andyour-secure-password
with your desired credentials. -
Update your environment variables to match:
REGISTRY_USERNAME
: Set to your chosen usernameREGISTRY_PASSWORD
: Set to your secure password
-
Restart the registry service
For more information about Docker registry authentication, see the official Docker Registry documentation.
Coolify automatically generates all required SERVICE_*
environment variables. You can optionally customize the following variables in your .env
file (see .env-example
for defaults):
POSTGRES_DB
: PostgreSQL database name (default: trigger)REGISTRY_NAMESPACE
: Docker registry namespace (default: trigger)NODE_MAX_OLD_SPACE_SIZE
: Node.js memory limit in MB (default: 1024)TRIGGER_TELEMETRY_DISABLED
: Disable telemetry (default: 0)INTERNAL_OTEL_TRACE_LOGGING_ENABLED
: Enable internal tracing logs (default: 0)
These registry credentials are exposed to the public and MUST be changed before production deployment:
REGISTRY_USERNAME
: Registry username (default:trigger
) - Change this!REGISTRY_PASSWORD
: Registry password (default:very-secure-indeed
) - Change this!
Update these in your .env
file and regenerate the registry/auth.htpasswd
file as described in the Security Configuration section above.
All services communicate through the trigger-net
Docker network. The setup is designed to work behind Coolify's reverse proxy.
The following persistent volumes are used:
postgres-data
: PostgreSQL dataredis-data
: Redis dataclickhouse-data
: ClickHouse dataminio-data
: MinIO datashared-data
: Shared data between webapp and supervisorregistry-data
: Docker registry storage
All services include health checks to ensure proper startup and monitoring.
For local development, you can run:
docker-compose up -d
Monitor logs with:
docker-compose logs -f
Once your registry is running, you can deploy Trigger.dev workflows to it:
-
Login to your registry:
docker login -u your-username -p 'your-secure-password' registry-domain-name
-
Deploy using Trigger.dev CLI:
npx trigger.dev@latest deploy
This will build and deploy your workflows to your self-hosted Trigger.dev registry.
For issues specific to Trigger.dev, visit the Trigger.dev documentation or GitHub repository.