Getting started

You have two options to deploy Notifuse: This option includes an embedded PostgreSQL database for easy testing and development:
# Clone the repository or download docker-compose.yml
curl -O https://raw.githubusercontent.com/notifuse/notifuse/main/docker-compose.yml

# Start Notifuse with embedded PostgreSQL
docker-compose up -d
This will start Notifuse on port 8080 with a PostgreSQL database. You’ll still need to configure the required environment variables in a .env file or directly in the docker-compose.yml.

Option 2: Standalone Docker (Production)

For production deployments, use the standalone Docker image with your own PostgreSQL database:
docker run -d --name notifuse -p 8080:8080 notifuse/notifuse:latest
Note: You’ll need to set the required environment variables and provide your own PostgreSQL database.

PASETO keys

You can generate PASETO keys with https://paseto.notifuse.com Alternatively, you can generate keys manually using the built-in keygen command:
# If you have the source code
make keygen

# Or directly with Go
go run cmd/keygen/main.go

PostgreSQL database (Option 2 only)

If using the standalone Docker option, you can use any PostgreSQL database with root credentials. Notifuse automatically creates a system database for itself. A new database will be created for each Notifuse workspace to avoid multi-tenant issues (that’s why you need root credentials). Note: This is not required when using Docker Compose as PostgreSQL is included.

An SMTP server

Notifuse needs an SMTP server to send system emails (e.g. password reset emails, invitation emails, etc.).

A public API endpoint

Notifuse needs a public API endpoint to be accessible from the web. Example: https://emails.yourcompany.com

A cron scheduler

The Notifuse API is 100% stateless: you can run many instances of it in parallel behind a load balancer. However, to trigger the automatic sending of emails, you will need to run a cron job that will call the https://YOUR_ENDPOINT/api/cron endpoint every minute.
# Run every minute
* * * * * curl -X POST https://YOUR_ENDPOINT/api/cron > /dev/null 2>&1
When a newsletter campaign is being sent, the task is executed for at most 55 seconds and will wait for the next cron tick to continue its execution.

Environment Variables

Required Variables

VariableDescription
ROOT_EMAILRoot administrator email (e.g., admin@yourcompany.com)
API_ENDPOINTPublic API endpoint URL (e.g., https://emails.yourcompany.com)
DB_HOSTPostgreSQL host (e.g., localhost or db.yourcompany.com)
DB_PORTPostgreSQL port (e.g., 5432)
DB_USERDatabase username (e.g., postgres)
DB_PASSWORDDatabase password (e.g., postgres)
PASETO_PRIVATE_KEYBase64 encoded PASETO private key (e.g., 1IC3m5Hk2jkVW...) - generate at https://paseto.notifuse.com
PASETO_PUBLIC_KEYBase64 encoded PASETO public key (e.g., 5p36ZqXdo7...) - generate at https://paseto.notifuse.com
| SMTP_HOST | SMTP server host (e.g., smtp.gmail.com) | | SMTP_PORT | SMTP server port (e.g., 587 or 465) | | SMTP_USERNAME | SMTP username (e.g., noreply@yourcompany.com) | | SMTP_PASSWORD | SMTP password (e.g., your_smtp_password) | | SMTP_FROM_EMAIL | From email address (e.g., noreply@yourcompany.com) | | SMTP_FROM_NAME | From name (e.g., Your Company Name) |

Optional Variables

VariableDescriptionDefault
Server Configuration
SERVER_PORTPort for the server to listen on (e.g., 8080)8080
SERVER_HOSTHost address to bind to (e.g., 0.0.0.0)0.0.0.0
CORS_ALLOW_ORIGINCORS allowed origins (e.g., https://yourapp.com,https://admin.yourapp.com)*
ENVIRONMENTEnvironment mode (e.g., production)production
LOG_LEVELLogging level (e.g., debug or warn)info
Database Configuration
DB_PREFIXDatabase table prefix (e.g., notifuse)notifuse
DB_NAMEDatabase name (e.g., notifuse_system)${DB_PREFIX}_system
DB_SSLMODESSL mode for database (e.g., require or disable)require
Tracing Configuration
TRACING_ENABLEDEnable tracing (e.g., true)false
TRACING_SERVICE_NAMEService name for tracing (e.g., notifuse-production)notifuse-api
TRACING_SAMPLING_PROBABILITYSampling probability (e.g., 0.05)0.1
TRACING_TRACE_EXPORTERTrace exporter: jaeger/zipkin/stackdriver/datadog/xray/none (e.g., jaeger or datadog)none
TRACING_JAEGER_ENDPOINTJaeger endpoint (e.g., http://jaeger:14268/api/traces)http://localhost:14268/api/traces
TRACING_ZIPKIN_ENDPOINTZipkin endpoint (e.g., http://zipkin:9411/api/v2/spans)http://localhost:9411/api/v2/spans
TRACING_STACKDRIVER_PROJECT_IDStackdriver project ID (e.g., my-gcp-project-id)-
TRACING_AZURE_INSTRUMENTATION_KEYAzure Monitor instrumentation key (e.g., 12345678-1234-1234-1234-123456789012)-
TRACING_DATADOG_AGENT_ADDRESSDatadog agent address (e.g., datadog-agent:8126)localhost:8126
TRACING_DATADOG_API_KEYDatadog API key (e.g., 1234567890abcdef1234567890abcdef)-
TRACING_XRAY_REGIONAWS X-Ray region (e.g., us-east-1)us-west-2
TRACING_AGENT_ENDPOINTGeneral agent endpoint (e.g., monitoring-agent:8126)localhost:8126
TRACING_METRICS_EXPORTERMetrics exporter: stackdriver/prometheus/datadog/none (e.g., prometheus)none
TRACING_PROMETHEUS_PORTPrometheus metrics port (e.g., 9464)9464