2020-09-21 20:16:57 +02:00
< a href = "https://zerodha.tech" > < img src = "https://zerodha.tech/static/images/github-badge.svg" align = "right" / > < / a >
2020-08-09 15:45:44 +02:00
![listmonk ](https://user-images.githubusercontent.com/547147/89733021-43fbf700-da70-11ea-82e4-e98cb5010257.png )
2019-06-26 12:35:50 +02:00
2019-07-09 21:11:36 +02:00
listmonk is a standalone, self-hosted, newsletter and mailing list manager. It is fast, feature-rich, and packed into a single binary. It uses a PostgreSQL database as its data store.
2019-07-09 13:36:23 +02:00
2020-08-09 15:45:44 +02:00
[![listmonk-dashboard ](https://user-images.githubusercontent.com/547147/89733057-87566580-da70-11ea-8160-855f6f046a55.png )](https://listmonk.app)
Visit [listmonk.app ](https://listmonk.app )
2019-06-26 12:35:50 +02:00
2020-08-09 15:45:44 +02:00
## Installation
2019-06-26 12:35:50 +02:00
2020-08-09 15:45:44 +02:00
### Docker
2020-03-14 16:37:14 +01:00
2020-08-09 15:45:44 +02:00
The latest image is available on DockerHub at `listmonk/listmonk:latest` . Use the sample [docker-compose.yml ](https://github.com/knadh/listmonk/blob/master/docker-compose.yml ) to run listmonk and Postgres DB with docker-compose as follows:
2019-07-12 04:21:48 +02:00
2020-08-09 15:45:44 +02:00
#### Demo
2021-01-21 17:06:32 +01:00
```bash
mkdir listmonk-demo
sh -c "$(curl -sSL https://raw.githubusercontent.com/knadh/listmonk/master/install-demo.sh)"
```
2019-07-12 14:27:32 +02:00
2020-08-09 15:45:44 +02:00
The demo does not persist Postgres after the containers are removed. DO NOT use this demo setup in production.
2019-07-12 04:21:48 +02:00
2020-08-09 15:45:44 +02:00
#### Production
- `docker-compose up db` to run the Postgres DB.
- `docker-compose run --rm app ./listmonk --install` to setup the DB (or `--upgrade` to upgrade an existing DB)
- Run `docker-compose up app` and visit `http://localhost:9000` .
2019-07-12 04:21:48 +02:00
2020-08-09 15:45:44 +02:00
More information on [docs ](https://listmonk.app/docs ).
2020-07-08 19:08:31 +02:00
2020-08-09 15:45:44 +02:00
__________________
2019-07-12 10:20:44 +02:00
2020-08-09 15:45:44 +02:00
### Binary
2021-05-19 13:53:15 +02:00
#### prerequisites Debian: system user and PostgreSQL
2021-05-19 15:57:23 +02:00
- install `sudo`
2021-05-19 13:53:15 +02:00
- install PostgreSQL `apt install postgresql`
2021-05-19 15:57:23 +02:00
- --create system user with config.toml data for the database:
`adduser listmonkuser` --
2021-05-19 13:53:15 +02:00
- create the postgreSQL database, the user and grant permissions:
`su - postgres` and then acces de PostgreSQL console `psql`
```
2021-05-19 15:57:23 +02:00
postgres=# CREATE DATABASE listmonkdatabase;
postgres=# CREATE USER listmonkuser WITH PASSWORD 'listmonkpassword';
postgres=# GRANT ALL PRIVILEGES ON DATABASE listmonkdatabase TO listmonkuser;
2021-05-19 13:53:15 +02:00
```
2021-05-19 15:57:23 +02:00
#### download an prepare config file
- `cd /var/www/` and make the directory `mkdir listmonk`
- `cd listmonk`
- Download the [latest release ](https://github.com/knadh/listmonk/releases ) and extract the listmonk binary.
```
wget https://github.com/knadh/listmonk/releases/download/v1.0.0/listmonk_1.0.0_linux_amd64.tar.gz
wget https://github.com/knadh/listmonk/releases/download/v1.0.0/listmonk_1.0.0_checksums.txt
sha256sum listmonk_1.0.0_linux_amd64.tar.gz
cat listmonk_1.0.0_checksums.txt |grep linux
```
- change ownership of files `chown -R www-data:www-data /var/www/listmonk`
- generate config file `sudo -u www-data ./listmonk --new-config`
- edit the config file with the data we created previously and more options `vim /var/www/listmonk/confif.toml`
#### reverse proxy
- create the apache config to work behind a reverse proxy `/etc/apache2/sites-available/listmonk.doamain.tdl.conf`
```
< VirtualHost * :80 >
ServerName listmonk.domain.tdl
ServerSignature Off
ErrorLog /var/log/apache2/listmonk.domain.tdl_error.log
TransferLog /var/log/apache2/listmonk.domain.tdl_access.log
LogLevel warn
ProxyPreserveHost On
ProxyPass "/" "http://127.0.0.1:9000/"
ProxyPassReverse "/" "http://127.0.0.1:9000/"
< / VirtualHost >
```
- enable the proxy module `a2enmod proxy_http` enable the site `a2ensite listmonk.domain.tdl` and restart apache `systemctl reload apache2`
2021-05-19 13:53:15 +02:00
#### proceed to install
2021-05-19 15:57:23 +02:00
- `sudo -u www-data ./listmonk --install` to setup the Postgres DB (or `--upgrade` to upgrade an existing DB. Upgrades are idempotent and running them multiple times have no side effects).
- Run `sudo -u www-data ./listmonk` and visit `http://listmonk.domain.tdl`
2020-04-02 12:23:01 +02:00
2021-05-19 13:53:15 +02:00
#### after install, fine tunning
oncen checked it works, stop the process.
- move the files to where you like most, usually `/opt/listmonk/` or inside `/var/www/html/`
- change ownership of the files to `www-data` or whatever user you have assigned the webserver `chown -R www-data:www-data listmonk`
- run listmonk as a service, create `/etc/systemd/system/listmonk.service` with:
```
[Unit]
2021-05-19 16:34:56 +02:00
Description=Listmonk domain.tdl server
2021-05-19 13:53:15 +02:00
After=syslog.target network.target postgressql.target
[Service]
Type=simple
# the user and group executing the service
User=www-data
Group=www-data
# the directory where you have listmonk
WorkingDirectory=/var/www/html/listmonk
# the file to execute
ExecStart=/var/www/html/listmonk/listmonk
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
2021-05-19 13:54:17 +02:00
```
2021-05-19 16:34:56 +02:00
- enable the service `systemct enable listmonk.service` and restart the daemon `systemctl daemon-restart` or you can start just the service `systemctl start listmonk.service`
#### fixing small dependencies
- uploads fail: `mkdir /var/www/html/listmonk/uploads` and `chown -R www-data:www-data /var/www/html/listmonk`
___________________
2020-08-09 15:45:44 +02:00
### Heroku
2020-04-02 12:23:01 +02:00
Using the [Nginx buildpack ](https://github.com/heroku/heroku-buildpack-nginx ) can be used to deploy listmonk on Heroku and use Nginx as a proxy to setup basicauth.
This one-click [Heroku deploy button ](https://github.com/bumi/listmonk-heroku ) provides an automated default deployment.
[![Deploy ](https://www.herokucdn.com/deploy/button.svg )](https://heroku.com/deploy?template=https://github.com/bumi/listmonk-heroku)
2020-08-29 08:04:30 +02:00
Please note that [configuration options ](https://listmonk.app/docs/configuration ) must be set using [environment configuration variables ](https://devcenter.heroku.com/articles/config-vars ).
2019-07-09 13:36:23 +02:00
2019-06-26 12:35:50 +02:00
## Developers
2020-08-09 15:45:44 +02:00
listmonk is a free and open source software licensed under AGPLv3. If you are interested in contributing, refer to the [developer setup ](https://listmonk.app/docs/developer-setup ). The backend is written in Go and the frontend is Vue with Buefy for UI.
2019-06-26 12:35:50 +02:00
2019-07-08 14:51:44 +02:00
## License
listmonk is licensed under the AGPL v3 license.