Jump to content

Install Mailcow in unraid


Gremmi

Recommended Posts

Hey,

 

I´m just evaluating unraid (I think I will buy a license :)). Currently I have a fully overpowered NAS with several virtual machines. My plan is to use a low power hardware in the future and ebay will take care of my old NAS.

Now I just tried to install Mailcow (my mail actual mail solution) with unraid but it was not that easy I expected:

docker-compose: Since the CA don´t have compose on board anymore I decided to use docker-compose as docker image with an alias (

Seems to do it´s job good :). Check.

The installation manual of mailcow ask to do clone the git repo to /opt/mailcow-dockerized

Since I learned unraid is unpacking every time in RAM and the only persistent volumes are /boot, /mnt/diskX and /mnt/cache “opt” would probably the wrong place to clone the repo to. I would need an additional data directory where the configuration and data is stored.

 

This is my point I´m a little bit stuck because I´m not sure which solution is the “unraid-way” to solve the problem:

·         Create the directories via ssh in /mnt/diskX ? Or is this per default a bad idea?

·         Create the directories with the gui?

Maybe I´m doing it totally wrong?

Some ppl are suggesting to use a VM to install Mailcow but I have a bad feeling to have a system with docker and all I need and create a VM to only host a mailsys into.

 

Thank you for your help in advance. Maybe someone is using mailcow already (I think @GuildDarts is using it this way too :)

 

Cheers

Gremmi

Link to comment

Sadly i'm no longer running mailcow (my new isp blocks port 25 :()
Bellow is what i did to install

cd /mnt/user/appdata
git clone https://github.com/mailcow/mailcow-dockerized
cd mailcow-dockerized
./generate_config.sh

The only thing i changed in mailcow.conf was the http/https ports to 7080 and 7443. i also disabled ipv6

Hope you get it working ^_^
i do remember having issues with getting letsencrypt certs but got it working after some tinkering. Might have just been my setup

Link to comment
1 hour ago, Gremmi said:

Since I learned unraid is unpacking every time in RAM and the only persistent volumes are /boot, /mnt/diskX and /mnt/cache “opt” would probably the wrong place to clone the repo to.

The usual way is a User Script to run at startup that copies from persistent storage to the OS folders in RAM. And if necessary, another to copy it back to persistent storage to maintain any updates.

Link to comment

... and I´m back :)

 

What I have done

 

mkdir /opt/mailcow-dockerized
mkdir /mnt/user/appdata/mailcow/mailcow-dockerized

mount --bind /opt/mailcow-dockerized /mnt/user/appdata/mailcow/mailcow-dockerized

cd /opt
git clone https://github.com/mailcow/mailcow-dockerized
cd mailcow-dockerized

 

I started the containers (one failed but my fault .. wrong config). I restarted unraid .... aaaaaaaaand: Everything is gone :o

 

"/opt/mailcow-dockerized" => OK because it has to be mounted manually (later via go script) but what I really don´t understand: Why is the folder "/mnt/user/appdata/mailcow/mailcow-dockerized" empty?!?

 

Link to comment
  • 2 months later...
On 9/3/2020 at 8:49 PM, GuildDarts said:

Just git clone inside /mnt/user/appdata you dont have to install it in /opt

Hi, I installed mailcow in the virtual machine Ubuntu. Now I want to put it on Unraid. To do this, I decided to create templates for all 18 containers. I have little experience, so immediately there is a question.
As denoted in Unraid,  :z, :Z, :ro,Z in mount folder?

docker-compose:
    unbound-mailcow:
      image: mailcow/unbound:1.12
      environment:
        - TZ=${TZ}
      volumes:
        - ./data/hooks/unbound:/hooks:Z
        - ./data/conf/unbound/unbound.conf:/etc/unbound/unbound.conf:ro,Z

Edited by muwahhid
Link to comment
  • 1 year later...
On 9/2/2020 at 3:29 PM, GuildDarts said:

Sadly i'm no longer running mailcow (my new isp blocks port 25 :()
Bellow is what i did to install

cd /mnt/user/appdata
git clone https://github.com/mailcow/mailcow-dockerized
cd mailcow-dockerized
./generate_config.sh

The only thing i changed in mailcow.conf was the http/https ports to 7080 and 7443. i also disabled ipv6

Hope you get it working ^_^
i do remember having issues with getting letsencrypt certs but got it working after some tinkering. Might have just been my setup

Hi,

Here is my problem :

 

which: no docker-compose in (.:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin)
Cannot find docker-compose, exiting...

 

Any solution ? Thanks ;)

Link to comment
  • 10 months later...
  • 1 year later...

@Marshalleq @Gremmi a bit late, but yes got it working without am VM (yesterday).

I still have my VM productive, but it's an old debian 9 so I have to replace it....

 

This is what has to be done:

mkdir /mnt/cache/appdata/mailcowdockerized
cd /mnt/cache/appdata/mailcowdockerized
git clone https://github.com/mailcow/mailcow-dockerized
./generate_config.sh

 

This generates two files whose content is needed for the Unraid Plugin Docker Compose.Manager: 
 - docker-compose.yml
 - mailcow.conf 

 

Then edit the file "mailcow.conf" to your needs: I changed the HTTP and HTTPS Ports.

Then edit the file "docker-compose.yaml" for the volume paths to match your appdata  path:

In my case I changed all volume paths by replacing all strings that began with "- ./data/" with "- /mnt/cache/appdata/mailcowdockerized/data/"

Important: Do this BEFORE starting the Stack for the first time!


Then add a new Stack "mailcow" with the Plugin Compose.Manager for Docker and edit it:

  1. Select Stack File to Edit: COMPOSE FILE
    Copy the content of the modified file "docker-compose.yml" and paste it here
     
  2. Select Stack File to Edit: ENV FILE
    Copy the the content of the modified file "mailcow.conf" and paste it here

Then pushed the button "Compose up"

Et voilà, MailCow whith SOGo is up.

Link to comment

Important note: 

Your data will persist in multiple Docker volumes, that are not deleted when you recreate or delete containers.
Run docker volume ls to see a list of all volumes. You can safely run docker compose down without removing persistent data.

(See https://docs.mailcow.email/getstarted/install/#start-mailcow)

 

But, very importasnt note: 

I have a user script that removes "dangeling docker images" using these commands:

### delete immages
docker rmi $(docker images --filter "dangling=true" -q --no-trunc)
#delete volumes
docker volume rm $(docker volume ls -qf dangling=true)

 

NEVER start this script while Mailcow is NOT running, because it WILL remove those MailCow Docker volumes where the persistand data is stored.....

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...