> ## Content Index
> Fetch the complete content index at: https://linuxhandbook.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Installing Listmonk - Self-hosted Newsletter and Mailing List Manager
- URL: https://linuxhandbook.com/listmonk-self-hosting/
- Published: 2025-01-08T12:27:46.000Z
- Updated: 2025-01-08T12:27:46.000Z
- Description: Listmonk is a popular open source mailing list manager. Learn how I deployed it using Docker and Docker Compose.
- Author: Abhishek Kumar
- Tags: Self Hosting Tutorials

As a tech-enthusiast content creator, I'm always on the lookout for innovative ways to connect with my audience and share my passion for technology and self-sufficiency. 

But as my newsletter grew in popularity, I found myself struggling with the financial burden of relying on external services like [Mailgun](https://www.mailgun.com/?ref=linuxhandbook.com) \- a problem many creators face when trying to scale their outreach efforts without sacrificing quality.

That's when I discovered [Listmonk](https://listmonk.app/?ref=linuxhandbook.com), a free and open-source mailing list manager that not only promises high performance but also gives me complete control over my data. 

In this article, I'll walk you through how I successfully installed and deployed Listmonk locally using Docker, sharing my experiences and lessons learned along the way.

I used Linode's cloud server to test the scenario. You may try either of Linode or DigitalOcean or your own servers.

[Customer Referral Landing Page - $100Cut Your Cloud Bills in Half Deploy more with Linux virtual machines, global infrastructure, and simple pricing. No surprise bills, no lock-in, and the![](https://www.linode.com/media/images/apple-touch-icon.png)Linode![](https://www.linode.com/wp-content/uploads/2019/07/linode-splash-predictable-pricing-more-competetive.svg)](https://www.linode.com/lp/refer/?r=19db9d1ce8c1c91023c7afef87a28ce8c8c067bd&ref=linuxhandbook.com)

Get started on Linode with a $100, 60-day credit for new users.

[DigitalOcean – The developer cloudHelping millions of developers easily build, test, manage, and scale applications of any size – faster than ever before.![](https://m.do.co/_next/static/media/android-chrome-512x512.5f2e6221.png)Explore our products![](https://www.digitalocean.com/_next/static/media/social-share-default.e8530e9e.jpeg)](https://m.do.co/c/d58840562553?ref=linuxhandbook.com)

Get started on DigitalOcean with a $100, 60-day credit for new users.

## Prerequisites

Before diving into the setup process, make sure you have the following:

- **Docker** and **Docker Compose** installed on your server.
- A **custom domain** that you want to use for Listmonk.
- Basic knowledge of shell commands and editing configuration files.

If you are absolutely new to Docker, we have a course just for you:

[Learn Docker: Complete Beginner’s CourseLearn Docker, an important skill to have for any DevOps and modern sysadmin. Learn all the essentials of Docker in this series.![](https://linuxhandbook.com/content/images/icon/Linux-Handbook-New-Logo-20.png)Linux HandbookAbdullah Tarek![](https://linuxhandbook.com/content/images/thumbnail/learn-docker-1.png)](https://linuxhandbook.com/courses/docker/)

## Step 1: Set up the project directory

The first thing you need to do is create the directory where you'll store all the necessary files for Listmonk, I like an organized setup (helps in troubleshooting). 

In your terminal, run:

```bash
mkdir listmonk
cd listmonk

```

![creating listmonk directory](https://linuxhandbook.com/content/images/2025/01/creating-listmonk-directory.png)

This will set up a dedicated directory for Listmonk’s files.

## Step 2: Create the Docker compose file

Listmonk has made it incredibly easy to get started with Docker. Their [official documentation](https://listmonk.app/docs/installation/?ref=linuxhandbook.com) provides a detailed guide and even a sample `docker-compose.yml` file to help you get up and running quickly. 

Download the sample file to the current directory:

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

```

![downloading sample docker-compose.yml file from listmonk](https://linuxhandbook.com/content/images/2025/01/downloading-example-docker-compose-file.png)

Here is the sample `docker-compose.yml` file, I tweaked some default environment variables:

💡

It's crucial to keep your credentials safe! Store them in a separate `.env` file, not hardcoded in your `docker-compose.yml`. I know, I know, I did it for this tutorial... but you're smarter than that, right? 😉

![editing the environment variables in sample docker-compose.yml ](https://linuxhandbook.com/content/images/2025/01/editing-docker-compose-file-1.png)

For most users, this setup should be sufficient but you can always tweak settings to your own needs.

then run the container in the background:

```bash
docker compose up -d
```

![running listmonk containers](https://linuxhandbook.com/content/images/2025/01/running-containers.png)

Once you've run these commands, you can access Listmonk by navigating to `http://localhost:9000` in your browser. 

### Setting up SSL

By default, Listmonk runs over HTTP and doesn’t include built-in SSL support. It is kinda important if you are running any service these days. So the next thing we need to do is to set up SSL support.

While I personally prefer using [**Cloudflare Tunnels**](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/?ref=linuxhandbook.com) for SSL and remote access, this tutorial will focus on Caddy for its straightforward integration with Docker.

Start by creating a folder named `caddy` in the same directory as your `docker-compose.yml` file:

```bash
mkdir caddy
```

Inside the `caddy` folder, create a file named `Caddyfile` with the following content:th the following contents:

```bash
listmonk.example.com {
    reverse_proxy app:9000
}
```

Replace `listmonk.example.com` with your actual domain name. This tells Caddy to proxy requests from your domain to the Listmonk service running on port `9000`.

![creating caddyfile](https://linuxhandbook.com/content/images/2025/01/listmonk-caddyfile.png)

Ensure your domain is correctly configured in DNS. Add an **A record** pointing to your server's IP address (in my case, the Linode server's IP). 

If you’re using Cloudflare, set the proxy status to **DNS only** during the initial setup to let Caddy handle SSL certificates.

![creating a dns record for listmonk](https://linuxhandbook.com/content/images/2025/01/listmonk-dns-record.png)

Next, add the Caddy service to your `docker-compose.yml` file. Here’s the configuration to include:

```bash
  caddy:
    image: caddy:latest
    restart: unless-stopped
    container_name: caddy
    ports:
      - 80:80
      - 443:443
    volumes:
      - ./caddy/Caddyfile:/etc/caddy/Caddyfile
      - ./caddy/caddy_data:/data
      - ./caddy/caddy_config:/config
    networks:
      - listmonk
```

![adding caddy service in docker-compose file](https://linuxhandbook.com/content/images/2025/01/adding-caddy-service-in-docker-compose-file.png)

This configuration sets up Caddy to handle HTTP (port 80) and HTTPS (port 443) traffic, automatically obtain SSL certificates, and reverse proxy requests to the Listmonk container.

Finally, restart your containers to apply the new settings:

```
docker-compose restart
```

Once the containers are up and running, navigate to your domain (e.g., `https://listmonk.example.com`) in a browser. 

Caddy will handle the SSL certificate issuance and proxy the traffic to Listmonk seamlessly.

## Step 3: Accessing Listmonk webUI

Once Listmonk is up and running, it’s time to access the web interface and complete the initial setup. 

Open your browser and navigate to your domain or IP address where Listmonk is hosted. If you’ve configured HTTPS, the URL should look something like this:

`https://listmonk.yourdomain.com`

and you’ll be greeted with the login page. Click **Login** to proceed.

![](https://linuxhandbook.com/content/images/2025/01/listmonk-login-1.png)

#### Creating the admin user

On the login screen, you’ll be prompted to create an administrator account. Enter your email address, a username, and a secure password, then click **Continue**. 

![creating admin account for listmonk](https://linuxhandbook.com/content/images/2025/01/listmonk-login-page.png)

This account will serve as the primary admin for managing Listmonk.

### Configure general settings

Once logged in, navigate to **Settings** \> **Settings** in the left sidebar. Under the **General** tab, customize the following:

- **Site Name**: Enter a name for your Listmonk instance.
- **Root URL**: Replace the default `http://localhost:9000` with your domain (e.g., `https://listmonk.yourdomain.com`).
- **Admin Email**: Add an email address for administrative notifications.

Click **Save** to apply these changes.

![editing general settings](https://linuxhandbook.com/content/images/2025/01/listmonk-general-settings-1.png)

### Configure SMTP settings

To send emails, you’ll need to configure SMTP settings:

1. Click on the **SMTP** tab in the settings.
2. Fill in the details:
  - **Host**: `smtp.emailhost.com`
  - **Port**: `465`
  - **Auth Protocol**: `Login`
  - **Username**: Your email address
  - **Password**: Your email password (or Gmail App password, generated via Google’s security settings)
  - **TLS**: `SSL/TLS`
3. Click **Save** to confirm the settings.

![adding smtp settings to send emails](https://linuxhandbook.com/content/images/2025/01/listmonk-smtp-settings-1.png)

### Create a new campaign list

Now, let’s create a list to manage your subscribers:

1. Go to **All Lists** in the left sidebar and click **\+ New**.
2. Give your list a name, set it to **Public**, and choose between **Single Opt-In** or **Double Opt-In**.
3. Add a description, then click **Save**.

![creating a test newsletter](https://linuxhandbook.com/content/images/2025/01/creating-listmonk-newsletter-1.png)

Your newsletter subscription form will now be available at:

`https://listmonk.yourdomain.com/subscription/form`

![newsletter subscribe page](https://linuxhandbook.com/content/images/2025/01/newsletter-subscribe-form.png)

With everything set up and running smoothly, it’s time to put Listmonk to work.

You can easily import your existing subscribers, customize the look and feel of your emails, and even change the logo to match your brand. 

## Final thoughts

And that’s it! You’ve successfully set up Listmonk, configured SMTP, and created your first campaign list. From here, you can start sending newsletters and growing your audience.

I’m currently testing Listmonk for my own newsletter solution on my website, and while it’s a robust solution, I’m curious to see how it performs in a production environment. 

That said, I’m genuinely impressed by the thought and effort that Kailash Nadh and the contributors have put into this software, it’s a remarkable achievement.

For any questions or challenges you encounter, the Listmonk GitHub page is an excellent resource and the developers are highly responsive.

Finally, I’d love to hear your thoughts! Share your feedback, comments, or suggestions below. I’d love to hear about your experience with Listmonk and how you’re using it for your projects. 

Happy emailing! 📨