wildduck/setup
Joosep Jõeleht c209b3af26
fix(setup-script): ZMS-252 Install script updates (#847)
* Switches to latest tagged release for repo checkouts

Replaces hardcoded commit hashes with a function that checks out
the latest tagged release for each repository. Improves deployment flow
by automatically tracking stable upstream releases.

* Enforces supported architectures in install scripts

Adds explicit architecture detection and validation to setup scripts,
restricting them to amd64, arm64, and armhf. Updates repository
configuration to use detected architecture for package sources,
improving compatibility and preventing installation on unsupported systems.

* Updates npm install flags for improved dependency handling

Replaces deprecated and less explicit npm install flags with
--omit=dev and --omit=optional to better control installed
dependencies and align with modern npm practices. Reduces
potential for installing unnecessary packages and improves
script reliability.

* Reformats SSL certificate issuance command by placing each argument
on a separate line, enhancing readability and simplifying future
modifications.

* Updates Node.js and MongoDB to latest major versions

Ensures compatibility and access to new features by moving to Node.js 22 and MongoDB 8.0. Prepares environment for current ecosystem dependencies and future-proofing.

* add ending line

* fix typos, improve consistency, fix npm install script, make it more modern

* improve consistency

---------

Co-authored-by: Joosep Jõeleht <joosep@zone.ee>
Co-authored-by: Nikolai Ovtsinnikov <nikolai@zone.ee>
2025-08-01 10:31:16 +03:00
..
00_install_global_functions_variables.sh fix(setup-script): ZMS-252 Install script updates (#847) 2025-08-01 10:31:16 +03:00
01_install_commits.sh fix(setup-script): ZMS-252 Install script updates (#847) 2025-08-01 10:31:16 +03:00
02_install_prerequisites.sh fix(setup-script): ZMS-252 Install script updates (#847) 2025-08-01 10:31:16 +03:00
03_install_check_running_services.sh fix(setup-script): ZMS-252 Install script updates (#847) 2025-08-01 10:31:16 +03:00
04_install_import_keys.sh fix(setup-script): ZMS-252 Install script updates (#847) 2025-08-01 10:31:16 +03:00
05_install_packages.sh updated install scrips 2023-08-24 10:34:17 +03:00
06_install_enable_services.sh fix: Update all urls in all files to point to new repo url. ZMS-180 (#791) 2025-03-10 11:21:48 +02:00
07_install_wildduck.sh fix(setup-script): ZMS-252 Install script updates (#847) 2025-08-01 10:31:16 +03:00
08_install_haraka.sh fix(setup-script): ZMS-252 Install script updates (#847) 2025-08-01 10:31:16 +03:00
09_install_zone_mta.sh fix(setup-script): ZMS-252 Install script updates (#847) 2025-08-01 10:31:16 +03:00
10_install_wildduck_webmail.sh fix(setup-script): ZMS-252 Install script updates (#847) 2025-08-01 10:31:16 +03:00
11_install_nginx.sh Update 11_install_nginx.sh 2021-06-25 15:42:15 +02:00
12_install_ufw_rules.sh Update 12_install_ufw_rules.sh 2021-06-25 15:43:47 +02:00
13_install_ssl_certs.sh fix(setup-script): ZMS-252 Install script updates (#847) 2025-08-01 10:31:16 +03:00
14_install_start_services.sh Pin acme.sh in setup script 2023-08-24 11:18:18 +03:00
15_install_deploy.sh Updated setup instructions 2024-02-08 10:33:41 +02:00
get_install.sh fix: Update all urls in all files to point to new repo url. ZMS-180 (#791) 2025-03-10 11:21:48 +02:00
install.sh DKIM and SPF correction, some renaming 2018-06-08 22:12:08 +02:00
README.md fix: Update all urls in all files to point to new repo url. ZMS-180 (#791) 2025-03-10 11:21:48 +02:00

WildDuck Installer

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/

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.

What does it do?

This install script installs and configures the following components:

  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
  10. ufw firewall to only allow public ports (so make sure your ssh runs on port 22 or otherwise change the install script first)

What it does not configure:

  1. DNS settings. These you need to handle yourself. See domainname-nameserver.txt file after installation for DNS configuration (includes DKIM)

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

Run the following commands as root user. Before actually starting install.sh you could inspect it to see what it exactly does.

Important

Run the following commands as root

wget -O - https://raw.githubusercontent.com/zone-eu/wildduck/master/setup/get_install.sh | bash
./install.sh mydomain.com mail.mydomain.com

Where mydomain.com is the email address domain and mail.mydomain.com is the hostname of current server.

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.

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.

Next point your browser to https://mydomain.com/ and you should see the WildDuck example webmail app where you can create an email account.

Config files

Configuration files are installed to the following locations:

  1. WildDuck: /etc/wildduck
  2. ZoneMTA: /etc/zone-mta
  3. WildDuck Webmail: /etc/wildduck/wildduck-webmail.toml
  4. Haraka: /opt/haraka/config

Log files

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.

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