Prerequisites
Before installing listmonk, ensure you have:- PostgreSQL 12+ (PostgreSQL 17 recommended for Docker)
- 2GB RAM minimum (4GB+ recommended for production)
- Linux, macOS, or Windows (Linux recommended for production)
- Port 9000 available (or your chosen port)
Installation Methods
- Docker (Recommended)
- Binary Installation
Docker is the recommended installation method as it handles all dependencies and configuration automatically.
Download docker-compose.yml
Download the official Docker Compose configuration:This downloads a complete setup with both listmonk and PostgreSQL configured and ready to run.
Optional: Configure Admin Credentials
Set admin credentials before first run (optional):
If you don’t set these environment variables, you’ll be prompted to create an admin user when you first visit the web interface.
Start the Services
Launch listmonk and PostgreSQL:This command:
- Downloads the latest listmonk image
- Creates a PostgreSQL database container
- Automatically runs database installation and migrations
- Starts both services in the background
Docker Configuration Details
Thedocker-compose.yml includes:Understanding the Docker Setup
Understanding the Docker Setup
- —install —idempotent: Ensures database is initialized only once on first run
- —upgrade: Automatically applies database migrations on updates
- Volumes:
./uploadsis mounted for media storage - Networks: Isolated network for app-db communication
- Health Checks: Ensures PostgreSQL is ready before app starts
Changing the Port
To expose listmonk on a different port:Using Docker Secrets
For production, use Docker secrets instead of environment variables:All
LISTMONK_* environment variables support the _FILE suffix for loading secrets from files.Database Setup Details
PostgreSQL Requirements
listmonk uses advanced PostgreSQL features:Extensions
- pgcrypto: UUID generation and encryption functions
Custom Types
14 custom ENUM types for type-safe status management
JSONB Support
Flexible metadata storage for subscribers, campaigns, and settings
Materialized Views
Pre-computed statistics for dashboard performance
Schema Overview
The database schema includes:Core Tables
Core Tables
- subscribers: Subscriber data with JSONB attributes
- lists: Mailing lists with type and opt-in settings
- subscriber_lists: Many-to-many relationship with subscription status
- campaigns: Email campaigns with content and statistics
- templates: Reusable email templates
Analytics Tables
Analytics Tables
- campaign_views: Track email opens
- link_clicks: Track link clicks in campaigns
- bounces: Bounce records with type classification
System Tables
System Tables
- settings: Application configuration stored as JSONB
- users: Multi-user support with roles
- roles: Role-based permission system
- sessions: User session management
- media: Media library for campaign assets
Production Deployment
System Requirements
- Minimum
- Recommended
- High Volume
- CPU: 1 core
- RAM: 2GB
- Storage: 10GB
- Suitable for: Up to 10,000 subscribers, occasional campaigns
Production Checklist
Secure the Database
- Use strong passwords
- Enable SSL/TLS connections (
ssl_mode = "require") - Restrict PostgreSQL network access
- Regular database backups
Setup SMTP
Configure production SMTP servers in Admin → Settings → SMTP after installation.Consider using:
- Amazon SES
- SendGrid
- Mailgun
- Postmark
- Your own SMTP server
Setup Monitoring
Monitor:
- Application logs
- Database performance
- Disk space
- SMTP delivery rates
- Bounce rates
Troubleshooting
Database Connection Failed
Database Connection Failed
Check:
- PostgreSQL is running:
pg_isready -h localhost -p 5432 - Credentials are correct in
config.toml - Database exists:
psql -U listmonk -l - Network connectivity if using remote database
- SSL mode matches PostgreSQL configuration
Port Already in Use
Port Already in Use
Change the port in configuration:Or in Docker:
Permission Denied Errors
Permission Denied Errors
Ensure:
- Binary has execute permissions:
chmod +x listmonk - Database user has proper grants
- Uploads directory is writable
Schema Installation Fails
Schema Installation Fails
- Verify PostgreSQL version is 12+
- Check database user has CREATE privileges
- Review PostgreSQL logs for specific errors
- Ensure pgcrypto extension can be installed
Next Steps
Quick Start Guide
Send your first campaign in 5 minutes
Configuration
Configure SMTP, settings, and preferences
Core Concepts
Understand subscribers, lists, and campaigns
API Documentation
Integrate with the REST API