{"id":23637019,"url":"https://github.com/ansibleguy/sw_mailcow","last_synced_at":"2025-08-31T11:34:17.080Z","repository":{"id":56775053,"uuid":"524681743","full_name":"ansibleguy/sw_mailcow","owner":"ansibleguy","description":"Ansible role to deploy mailcow on a linux server","archived":false,"fork":false,"pushed_at":"2024-11-10T10:49:40.000Z","size":86,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"latest","last_synced_at":"2024-11-10T11:30:28.788Z","etag":null,"topics":["ansible","ansible-role","docker-container","iac","infrastructure-as-code","mailcow","mailcow-dockerized","mailing","mailserver","webmail"],"latest_commit_sha":null,"homepage":"","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ansibleguy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"ko_fi":"ansible0guy","github":"ansibleguy"}},"created_at":"2022-08-14T13:37:09.000Z","updated_at":"2024-11-10T10:49:44.000Z","dependencies_parsed_at":"2023-02-15T17:16:08.461Z","dependency_job_id":"5c2df937-35e9-4109-bdf4-213a7d82741c","html_url":"https://github.com/ansibleguy/sw_mailcow","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansibleguy%2Fsw_mailcow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansibleguy%2Fsw_mailcow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansibleguy%2Fsw_mailcow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansibleguy%2Fsw_mailcow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ansibleguy","download_url":"https://codeload.github.com/ansibleguy/sw_mailcow/tar.gz/refs/heads/latest","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231590686,"owners_count":18396934,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","ansible-role","docker-container","iac","infrastructure-as-code","mailcow","mailcow-dockerized","mailing","mailserver","webmail"],"created_at":"2024-12-28T06:17:24.165Z","updated_at":"2025-08-31T11:34:17.073Z","avatar_url":"https://github.com/ansibleguy.png","language":"Jinja","funding_links":["https://ko-fi.com/ansible0guy","https://github.com/sponsors/ansibleguy"],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://mailcow.email/\"\u003e\n\u003cimg src=\"https://www.servercow.de/img/cow_mailcow.svg\" alt=\"MailCow Logo\" width=\"300\"/\u003e\n\u003c/a\u003e\n\n# Ansible Role - MailCow\n\nRole to deploy [MailCow dockerized](https://github.com/mailcow/mailcow-dockerized) on a linux server.\n\nThis role follows the official [installation instructions](https://mailcow.github.io/mailcow-dockerized-docs/de/i_u_m/i_u_m_install/).\n\n[![Lint](https://github.com/ansibleguy/sw_mailcow/actions/workflows/lint.yml/badge.svg)](https://github.com/ansibleguy/sw_mailcow/actions/workflows/lint.yml)\n[![Ansible Galaxy](https://badges.ansibleguy.net/galaxy.badge.svg)](https://galaxy.ansible.com/ui/standalone/roles/ansibleguy/sw_mailcow)\n\n**Molecule Integration-Tests**:\n\n* Status: [![Molecule Test Status](https://badges.ansibleguy.net/sw_mailcow.molecule.svg)](https://github.com/ansibleguy/_meta_cicd/blob/latest/templates/usr/local/bin/cicd/molecule.sh.j2) |\n[![Functional-Tests](https://github.com/ansibleguy/sw_mailcow/actions/workflows/integration_test_result.yml/badge.svg)](https://github.com/ansibleguy/sw_mailcow/actions/workflows/integration_test_result.yml)\n* Logs: [API](https://ci.ansibleguy.net/api/job/ansible-test-molecule-sw_mailcow/logs?token=2b7bba30-9a37-4b57-be8a-99e23016ce70\u0026lines=1000) | [Short](https://badges.ansibleguy.net/log/molecule_sw_mailcow_test_short.log) | [Full](https://badges.ansibleguy.net/log/molecule_sw_mailcow_test.log)\n\nInternal CI: [Tester Role](https://github.com/ansibleguy/_meta_cicd) | [Jobs API](https://github.com/O-X-L/github-self-hosted-jobs-systemd)\n\n**Tested:**\n* Debian 11\n\n----\n\n## Install\n\n```bash\n# latest\nansible-galaxy role install git+https://github.com/ansibleguy/sw_mailcow\n\n# from galaxy\nansible-galaxy install ansibleguy.sw_mailcow\n\n# or to custom role-path\nansible-galaxy install ansibleguy.sw_mailcow --roles-path ./roles\n\n# install dependencies\nansible-galaxy install -r requirements.yml\n```\n\n----\n\n## Prerequisites\n\nSee: [Prerequisites](https://github.com/ansibleguy/sw_mailcow/blob/stable/Prerequisites.md)\n\n----\n\n## Usage\n\n### Config\n\nDefine the config as needed:\n\n```yaml\nmailcow:\n  fqdn: 'srv.template.ansibleguy.net'\n  # per example: 'srv.template.ansibleguy.net' must be a valid, public dns-hostname of the server\n\n  # if you don't have IPv6\n  ipv6: false  \n\n  nginx:  # configure the webserver settings =\u003e see: https://github.com/ansibleguy/infra_nginx\n    aliases: ['mail.template.ansibleguy.net']  # additional domains to add to the certificate\n    ssl:\n      mode: 'letsencrypt'  # or selfsigned/ca/snakeoil\n      #  if you use 'selfsigned' or 'ca':\n      #    cert:\n      #      cn: 'MailCow Server'\n      #      org: 'AnsibleGuy'\n      #      email: 'mailcow@template.ansibleguy.net'\n    letsencrypt:\n      email: 'mailcow@template.ansibleguy.net'\n\n  config:  # add config overrides for 'mailcow.conf'\n    WEBAUTHN_ONLY_TRUSTED_VENDORS: 'y'\n\n  auto_update:\n    enable: true  # enable auto-updates\n\n  backup:\n    retention_days: 60  # default = 14\n```\n\nBare minimum example:\n```yaml\nmailcow:\n  fqdn: 'srv.template.ansibleguy.net'\n```\n\nIf you want to use the built-in (_not ansible-managed_) webserver:\n```yaml\nmailcow:\n  fqdn: 'srv.template.ansibleguy.net'\n  # per example: 'srv.template.ansibleguy.net' must be a valid, public dns-hostname of the server\n\n  manage:\n    webserver: false\n\n  config:\n    HTTP_PORT: 80\n    HTTPS_PORT: 443\n    # if you want to use the built-in letsencrypt support\n    SKIP_LETS_ENCRYPT: 'n'\n    ACME_CONTACT: 'mailcow@template.ansibleguy.net'\n    ADDITIONAL_SAN: 'smtp.template.ansibleguy.net,mail.*'\n```\n\n\n### Execution\n\nRun the playbook:\n```bash\nansible-playbook -K -D -i inventory/hosts.yml playbook.yml\n```\n\nThere are also some useful **tags** available:\n* docker\n* webserver\n\nTo debug errors - you can set the 'debug' variable at runtime:\n```bash\nansible-playbook -K -D -i inventory/hosts.yml playbook.yml -e debug=yes\n```\n\n----\n\n## Functionality\n\n* **Package installation**\n  * Ansible dependencies (_minimal_)\n\n\n* **Configuration**\n  * Service to start containers on boot: 'mailcow.service'\n\n\n  * **Default config**:\n    * Directories:\n      * Base: '/var/lib/mailcow'\n      * Data: '/var/lib/docker/volumes' (_cannot be changed by role_)\n      * Backup: '/var/backups/mailcow'\n\n\n  * **Default opt-ins**:\n    * Docker =\u003e using [THIS Role](https://github.com/ansibleguy/infra_docker_minimal)\n      * Dependencies\n      * Server\n      * Docker-compose\n    * Nginx proxy on docker-host =\u003e using [THIS Role](https://github.com/ansibleguy/infra_nginx)\n  \n    * Features:\n      * [SOGo Groupware](https://www.sogo.nu/)\n      * Apache Solr\n      * ClamAV (_virus scanner_)\n  \n    * IPv6 enabled\n    * Daily backup using the [backup script](https://mailcow.github.io/mailcow-dockerized-docs/backup_restore/b_n_r-backup/)\n    \n  * **Default opt-outs**:\n    * Auto update using the [update script](https://mailcow.github.io/mailcow-dockerized-docs/i_u_m/i_u_m_update/)\n\n----\n\n## Info\n\n* **Info:** Consider using a **Mail Gateway to gain Security**!\n\n  Per example: [Proxmox Mail Gateway](https://github.com/ansibleguy/sw_proxmox_mail_gw)\n\n\n* **Info:** Check out the troubleshooting information: [Troubleshooting](https://github.com/ansibleguy/sw_mailcow/blob/stable/Troubleshooting.md)\n\n* **Note:** this role currently only supports debian-based systems\n\n\n* **Note:** Most of the role's functionality can be opted in or out.\n\n  For all available options - see the default-config located in [the main defaults-file](https://github.com/ansibleguy/sw_mailcow/blob/latest/defaults/main/1_main.yml)!\n\n\n* **Warning:** Not every setting/variable you provide will be checked for validity. Bad config might break the role!\n\n\n* **Info:** Default credentials:\n\n  User: admin\n\n  Password: moohoo\n\n\n* **Info:** For more detailed information - look into the [nice documentation](https://mailcow.github.io/mailcow-dockerized-docs) provided by MailCow!\n\n\n* **Info:** If the setup fails after creating the config - you need to remove the config file (_/var/lib/mailcow/mailcow.conf_) manually, so the role will know it isn't initialized already!\n\n\n* **Warning:** The automatic **BACKUPS** are placed on the same system and need to be copied to a **REMOTE** location to be SAFE!\n\n\n* **Warning:** Using **NFTables** on the MailCow host is **NOT RECOMMENDED** as IPTables rules are auto-managed by docker and the MailCow containers.\n\n  Containers may fail if the ruleset is not as expected.\n\n  You can disable the firewall check using the `ignore_firewall_check: true` setting. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fansibleguy%2Fsw_mailcow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fansibleguy%2Fsw_mailcow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fansibleguy%2Fsw_mailcow/lists"}