Installing docker-mailserver on Windows 11

In this tutorial, we will guide you through the installation process of docker-mailserver on your Windows 11 machine.

Prerequisites

  1. Install Docker Desktop on your Windows 11 machine. You can download Docker Desktop from the following link: https://www.docker.com/products/docker-desktop

  2. Make sure that virtualization is enabled on your machine.

Installation

  1. Open PowerShell on your Windows 11 machine.

  2. Clone the docker-mailserver repository using the following command: git clone https://github.com/docker-mailserver/docker-mailserver.git

  3. Change the directory to the docker-mailserver folder using the following command: cd docker-mailserver

  4. Create a .env file by running the following command: cp env-example .env

  5. Open the .env file using your favorite text editor and set the values for the following parameters:

    # Full qualified domain name of the mail server
    FIRST_DOMAIN=example.com
    
    # Email domain(s) for virtual accounts
    # Example: SECOND_DOMAIN=mysecondexample.com,mythirdexample.com
    SECOND_DOMAIN=
    
    # Email domain(s) for aliases
    # Example: THIRD_DOMAIN=myaliasexample.com,mysecondaliasexample.com
    THIRD_DOMAIN=
    
    # Email domain(s) for virtual catch-all accounts
    # Example: FOURTH_DOMAIN=mycatchallexample.com
    FOURTH_DOMAIN=
    
    # Postmaster account (user created on new system installation)
    POSTMASTER_ADDRESS=postmaster@example.com
    
    # SMTP relay host (used to relay email to another SMTP server)
    RELAY_HOST=
    
    # Whether to use encryption for the SMTP relay host connection
    RELAY_AUTH_TLS=
    
    # Username for authentication on the SMTP relay host (if needed)
    RELAY_AUTH_USERNAME=
    
    # Password for authentication on the SMTP relay host (if needed)
    RELAY_AUTH_PASSWORD=
    
    # Default email recipient for system notifications
    NOTIF_EMAIL=notifications@example.com
    
    # Docker network name to use
    DOCKER_NETWORK=docker-mailserver_default
    
    # Configuration storage folder (must exist on the host)
    # Example: STORAGE_HOST_PATH=/mnt/docker-mailserver/
    STORAGE_HOST_PATH=
    
  6. Run the following command to build the mail server container: docker-compose up -d

  7. Wait for the container to start up. You can check the container logs to see the progress by running the following command: docker-compose logs -f

  8. Once the container is running, you can access the webmail interface by navigating to http://localhost:80 in your web browser.

Congratulations! You have successfully installed docker-mailserver on your Windows 11 machine. You can now start sending and receiving emails using your local mail server.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!