wildduck/setup/README.md

73 lines
3.9 KiB
Markdown
Raw Normal View History

2018-01-02 21:04:01 +08:00
# WildDuck Installer
2017-10-16 18:15:51 +08:00
2019-02-18 21:50:38 +08:00
Here you can find an example install script to install WildDuck with Haraka and ZoneMTA. The install script is self contained, you can upload to your server and start it as root. It fetches all required files from Github. After installation you should see exactly the same web interface as in https://webmail.wildduck.email/
2017-10-16 18:15:51 +08:00
2023-08-24 16:35:32 +08:00
The install script should work with Ubuntu version from 22.04 (probably also with 20.04) and the server must be blank. Blank meaning that there should be no existing software installed (eg. Apache, MySQL or Postfix). If the server already has something installed, then remove the extra applications before running this script. This also means that you should not run the install script in a VPS that you already use for other stuff.
2017-10-18 19:27:40 +08:00
## What does it do?
This install script installs and configures the following components:
2018-08-06 15:06:27 +08:00
1. **WildDuck Mail Server** for IMAP and POP3
2. **Haraka** with WildDuck plugin for incoming email
3. **ZoneMTA** with WildDuck plugin for outbound email
4. **WildDuck Webmail** for creating accounts and viewing messages
5. **Nginx** to serve the webmail component
6. **acme.sh** to manage Let's Encrypt certificates
7. **Rspamd** to check messages for spam. Messages detected as spam are routed to Junk Mail folder by default
8. **ClamAV** to check messages for viruses. ClamAV is disabled by default, you need to enable it in the Haraka plugins file
9. Unprivileged **Deploy** user to easily checkout and publish code changes via git
2018-01-27 00:52:31 +08:00
10. **ufw** firewall to only allow public ports (so make sure your ssh runs on port 22 or otherwise change the install script first)
2017-10-18 19:27:40 +08:00
What it does not configure:
2017-10-16 18:15:51 +08:00
2018-08-06 15:06:27 +08:00
1. **DNS settings**. These you need to handle yourself. See domainname-nameserver.txt file after installation for DNS configuration (includes DKIM)
2017-10-18 19:27:40 +08:00
## Security
All components use TLS/HTTPS with Let's Encrypt certificates by default. Webmail component allows to set up two factor authentication (both TOTP and U2F). If 2FA is enabled then you can also generate application specific passwords for external applications (eg. for the IMAP client) from the Webmail interface as master password can not be used in that case.
## Usage
2017-10-16 18:15:51 +08:00
2018-01-27 19:14:52 +08:00
Run the following commands as root user. Before actually starting _install.sh_ you could inspect it to see what it exactly does.
2018-08-06 15:06:27 +08:00
(run as `root`)
$ wget -O - https://raw.githubusercontent.com/nodemailer/wildduck/master/setup/get_install.sh | bash
2018-08-06 15:06:27 +08:00
$ ./install.sh mydomain.com mail.mydomain.com
2017-10-18 17:42:51 +08:00
2018-08-06 15:06:27 +08:00
Where _mydomain.com_ is the email address domain and _mail.mydomain.com_ is the hostname of current server.
2017-10-16 18:15:51 +08:00
2018-08-06 15:06:27 +08:00
Make sure that used hostname points to current server as the install script tries to fetch an SSL certificate from Let's Encrypt. The MX for email address domain should point to server hostname.
2017-10-16 18:15:51 +08:00
2017-10-18 19:27:40 +08:00
If the installation succeeds then the installer writes DNS configuration to domainname-nameserver.txt file. Set up the provided DNS entries from this file before sending and receiving email.
2017-10-16 18:15:51 +08:00
2018-01-02 21:04:01 +08:00
Next point your browser to https://mydomain.com/ and you should see the WildDuck example webmail app where you can create an email account.
2017-10-16 19:13:21 +08:00
## Config files
Configuration files are installed to the following locations:
2018-08-06 15:06:27 +08:00
1. WildDuck: /etc/wildduck
2. ZoneMTA: /etc/zone-mta
3. WildDuck Webmail: /etc/wildduck/wildduck-webmail.toml
4. Haraka: /opt/haraka/config
2017-12-25 18:17:36 +08:00
## Log files
2020-05-03 04:15:48 +08:00
All `stdout` and `stderr` is written to service specific log files. For example WildDuck server logs can be found from `/var/log/wildduck-server/wildduck-server.log`.
2017-12-25 18:17:36 +08:00
## Code changes
Install script sets up applications as remote git repositories. You can clone these to your own machine using a special deploy user. If you push changes back to the remote repo, related services are restarted automatically.
```
$ git clone deploy@hostname:/var/opt/wildduck.git
$ cd wildduck
$ git checkout master
$ .... make some changes
$ git add .
$ git commit -m "made some changes"
$ git push origin master -f
```