Skip to main content

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)
listmonk requires PostgreSQL as its database. It does not support MySQL, SQLite, or other databases.

Installation Methods

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:
  • 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
  • campaign_views: Track email opens
  • link_clicks: Track link clicks in campaigns
  • bounces: Bounce records with type classification
  • 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

  • CPU: 1 core
  • RAM: 2GB
  • Storage: 10GB
  • Suitable for: Up to 10,000 subscribers, occasional campaigns

Production Checklist

1

Secure the Database

  • Use strong passwords
  • Enable SSL/TLS connections (ssl_mode = "require")
  • Restrict PostgreSQL network access
  • Regular database backups
2

Configure Reverse Proxy

Use nginx or Apache as a reverse proxy:
server {
    listen 80;
    server_name listmonk.example.com;
    
    location / {
        proxy_pass http://localhost:9000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
}
Enable HTTPS with Let’s Encrypt:
certbot --nginx -d listmonk.example.com
3

Setup SMTP

Configure production SMTP servers in Admin → Settings → SMTP after installation.Consider using:
  • Amazon SES
  • SendGrid
  • Mailgun
  • Postmark
  • Your own SMTP server
4

Configure Backups

Regular PostgreSQL backups:
pg_dump -U listmonk listmonk > backup_$(date +%Y%m%d).sql
Backup the uploads directory:
tar -czf uploads_backup.tar.gz ./uploads
5

Setup Monitoring

Monitor:
  • Application logs
  • Database performance
  • Disk space
  • SMTP delivery rates
  • Bounce rates
6

Performance Tuning

Optimize PostgreSQL for your workload:
-- Increase shared_buffers for better caching
shared_buffers = 256MB

-- Increase work_mem for complex queries
work_mem = 16MB

-- Enable query plan caching
effective_cache_size = 1GB
Tune listmonk settings in Admin → Settings:
  • Concurrency (default: 10)
  • Message rate (default: 10/sec)
  • Batch size (default: 1000)
Security Considerations:
  • Always use HTTPS in production
  • Keep listmonk updated to the latest version
  • Use strong passwords for admin accounts
  • Enable two-factor authentication
  • Restrict database access to localhost or private network
  • Configure firewall rules appropriately

Troubleshooting

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
Change the port in configuration:
[app]
address = "localhost:8080"  # Use different port
Or in Docker:
ports:
  - "8080:9000"
Ensure:
  • Binary has execute permissions: chmod +x listmonk
  • Database user has proper grants
  • Uploads directory is writable
  • 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

Build docs developers (and LLMs) love