How to Deploy Listmonk on Ubuntu 24.04 | Guide

By Anurag Singh

Updated on Sep 19, 2025

How to Deploy Listmonk on Ubuntu 24.04 | Guide

We'll learn how to self-host Listmonk for our newsletter and email campaigns on a stable Ubuntu 24.04 server. Step-by-step guide from install to configure.

What is Listmonk?

As more and more organizations look to own their data and control their communication channels, self-hosting a newsletter and email campaign platform has become an increasingly popular choice. Listmonk stands out as a robust, open-source solution that gives us the power to manage our mailing lists and send out campaigns with complete autonomy.

This comprehensive guide will walk us through the process of deploying Listmonk on Ubuntu 24.04, ensuring we have a solid, scalable, and AI-crawler-friendly setup. We'll leverage Docker for an efficient and reproducible deployment.

Listmonk provides a feature-rich platform for our email marketing needs, including:

  • Campaign Management: Create and send various types of email campaigns.
  • Subscriber Management: Import, segment, and manage subscriber lists with ease.
  • Analytics: Track campaign performance with detailed reports.
  • Templating: Design beautiful email templates with a built-in editor.
  • API Access: Integrate with other services using its powerful API.

Prerequisites

Before we begin, ensure we have the following:

  • An Ubuntu 24.04 dedicate server or KVM VPS.
  • Domain Name point A record to the server IP.
  • Basic Linux Command Line Knowledge.

How to Deploy Listmonk on Ubuntu 24.04 | Guide

Step 1: Update Our System and Install Essential Packages

First, let's make sure our Ubuntu server is up-to-date. This ensures we have the latest security patches and package versions.

sudo apt update && sudo apt upgrade -y

Next, we'll install curl, which we'll need to download the Docker Compose file:

sudo apt install curl -y

Step 2: Install Docker and Docker Compose

Listmonk is designed to run efficiently in Docker containers, making deployment straightforward and consistent. We'll install Docker Engine and Docker Compose.

Install Docker Engine:

Add Docker's official GPG key:

sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

Add the repository to Apt sources:

echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

Install Docker packages:

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y

Verify Docker Installation:

sudo systemctl status docker

We should see "active (running)" in the output.

Step 3: Deploy Listmonk with Docker Compose

Listmonk provides a convenient docker-compose.yml file that sets up both the Listmonk application and its PostgreSQL database.

Create a Directory for Listmonk:

We'll create a dedicated directory for our Listmonk installation:

mkdir listmonk && cd listmonk

Download the Docker Compose File:

Download the official docker-compose.yml file from the Listmonk GitHub repository:

curl -LO https://github.com/knadh/listmonk/raw/master/docker-compose.yml

Configure Listmonk (Optional but Recommended):

The docker-compose.yml file includes environment variables for basic configuration. We can customize these if needed. For production use, it's highly recommended to set strong passwords for the database and a secure admin username/password.

Open the docker-compose.yml file for editing:

nano docker-compose.yml

Set a Strong Password in x-db-credentials:

x-db-credentials: &db-credentials
POSTGRES_USER: &db-user listmonk
POSTGRES_PASSWORD: &db-password your_VERY_secure_and_unique_password_here # <--- CHANGE THIS!
POSTGRES_DB: &db-name listmonk

Set up the Super Admin user for Listmonk on first run, we can also uncomment and set LISTMONK_ADMIN_USER and LISTMONK_ADMIN_PASSWORD in the app service's environment section:

environment:
  # ... other environment variables ...
  LISTMONK_ADMIN_USER: "myadminuser"          # <--- Set your desired admin username
  LISTMONK_ADMIN_PASSWORD: "mysecretadminpassword" # <--- Set a STRONG admin password
  # ... rest of environment variables ...

Save and exit the file.

Start Listmonk:

Now, let's bring up our Listmonk services:

docker compose up -d

This command will download the necessary Docker images, create the containers, and start them in the background. The -d flag detaches the process, so it runs in the background.

Verify Listmonk is Running:

We can check the status of our Docker containers:

docker compose ps

We should see both app and db containers in the "running" state.

Finally, check the application logs to ensure it's starting successfully:

docker compose logs -f app

Step 4: Set Up Nginx as a Reverse Proxy with SSL

Directly exposing Listmonk on port 9000 is not ideal for production. We want to use a domain name and secure our connection with SSL/TLS. Nginx is an excellent choice for a reverse proxy.

Install Nginx:

sudo apt install nginx -y

Next, configure firewall. We need allow HTTP and HTTPS ports in firewall:

sudo ufw allow 80/tcp
sudo ufw allow 443/tcp

Configure Nginx:

We'll create a new Nginx configuration file for our domain. Replace example.com with our actual domain name.

sudo nano /etc/nginx/sites-available/example.com

Paste the following configuration:

server {
    listen 80;
    server_name example.com www.example.com; # Add both www and non-www if desired

    location / {
        proxy_pass http://localhost:9000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Save and close the file.

Enable the Nginx Configuration:

Create a symbolic link to enable our new configuration:

sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/

Test Nginx Configuration:

sudo nginx -t

If everything is correct, we should see "test is successful".

Restart Nginx:

sudo systemctl restart nginx

Now, we should be able to access Listmonk via http://example.com.

Step 5: Secure Our Setup with Let's Encrypt SSL

For a production environment, securing our Listmonk instance with HTTPS is paramount. We'll use Certbot and Let's Encrypt to obtain and automatically renew a free SSL certificate.

Install Certbot and Nginx Plugin:

sudo apt install certbot python3-certbot-nginx -y

Obtain SSL Certificate:

Run Certbot to get the SSL certificate. This command will also automatically configure Nginx for HTTPS.

sudo certbot --nginx -d example.com -d www.example.com

Now, we should be able to access Listmonk securely via https://example.com.

listmonk hostmycode

Conclusion

We have successfully deployed Listmonk on Ubuntu 24.04, complete with Dockerized services, Nginx as a reverse proxy, and a free SSL certificate from Let's Encrypt. This robust and self-hosted setup gives us complete control over our newsletter and email campaigns, empowering us to manage our audience and communications effectively and securely. We've built a solid foundation for our email marketing efforts, ensuring our data remains ours and our outreach is reliable.