How to build a Linux-powered smart home

Mailcow:Dockerized

Nextcloud’s own groupware, its Calendar, Talk and Mail applications, can be used for collaboration among users. 

The Mail app is just a client, so you set it up with a provider just as you would in a desktop email client. 

It’s often been said (including by us) that setting up an email server properly is hard. 

This is true, but we can set up a rough and ready container running Postfix, Dovecot and Roundcube and have a working (but not necessarily well-configured) email set up in just a few keystrokes thanks to the Mailcow:Dockerized image.

Setting this up might offend the sensitivities of those adverse to running things as root, but the image uses extended attributes and requires it. 

So let’s be a superuser and check our umask is set correctly (it should print 0022):

$ sudo -i
# umask

Now we’ll clone the repository into /opt:

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

You’ll be asked for your domain name; this is the host that it’s running on, not the domain of any email addresses you want to set up. 

If your machine has limited memory the script will suggest you disable Solr (the heavy-duty Java search platform), which you should. 

The script generates mailcow.conf which you may wish to tweak. We’ll just plough right ahead. First, in case they get in the way, stop Nextcloud and any other containers now. 

In Portainer do this by choosing Containers from the menu on the left, selecting all of them except Portainer (because that would be silly), and pushing the stop button. 

There’s a Kill button next to it in case they don’t shut down gracefully, and you can also remove them entirely if you don’t like them. Now return to the terminal (still using the root account) and let’s fetch and unleash the Mailcow:

# docker-compose pull
# docker-compose up -d

At this point, you technically have a working mail server. You should now be able to log in from the web interface, using the credentials admin:moohoo  

But there’s still a lot of configuration to do. Not least of this involves changing that password, which can be done by clicking Edit next to the admin user to do this. 

If you want to receive mail you’ll need to properly set up MX records for your domain(s) with your DNS provider, otherwise mail won’t be routed correctly.

Mailcow:Dockerized

Mailcow:Dockerized involves about 20 containers, but you can disable a few of them. (Image credit: mailcow:dockerized)

Once you’ve done that, you can configure them from Mailcow’s Domains section, then you can configure the actual addresses in the Mailboxes section. 

In a world of endless spam, it’s important to do your bit by enabling DKIM (Domain Keys Identified Mail), which signs messages originating from your server. DKIM-enabled servers will verify this key when they receive mail from your domain, preventing malfeasance.

TOPICS
Read more
Linux penguin logo on wood.
Best Linux server distro of 2025
A person using a desktop computer.
Best weird and wonderful niche Linux distros of 2025
A close up of a SATA hard drive.
Best NAS & media server distro of 2025
Ubuntu website screenshot
Best Ubuntu app of 2025
A person in a wheelchair working at a computer.
Best Linux distro for beginners of 2025
Padlock against circuit board/cybersecurity background
Kali laid bare: the most famous Linux hacking distro of all time
Latest in Software & Services
Windows 11 Start menu layout choices: Grid view
Windows 11 vs Linux for business: which operating system should you embrace?
A phone sitting on a laptop keyboard with the Microsoft Outlook logo on the screen.
Gmail vs Outlook for business: which email system is right for your organization?
Windows 11 logo
Windows 11 Pro vs Windows 11 Home: which version is right for you?
Canva HubSpot
HubSpot and Canva team up to level the creative playing field
a laptop computer
Windows 11 vs ChromeOS for business: Is one better than the other for your needs?
a laptop computer
Windows 11 vs macOS for business: which side are you on?
Latest in How Tos
Cheltenham racing festival 2024 day four: Paul Townend on Galopin Des Champs crosses the finishing line for victory in the Gold Cup
Cheltenham Festival 2025 live stream: How to watch world-class horse racing online
Ousmane Dembele of Paris Saint-Germain watches the ball during a UEFA Champions League 2024/25 match in March 2025
Liverpool vs PSG live stream: How to watch the UEFA Champions League match online
Still from the sneak peek trailer of Ring & Friends showing the ex-beatles singer on stage at the Ryman
Ringo & Friends at The Ryman: how to watch the country music show online
Lewis Hamilton of Great Britain and Scuderia Ferrari waves to the crowd from the stage during F1 75 Live in the run up to the 2025 F1 season
How to watch F1 online: your guide to 2025 Formula 1 season
Rachin Ravindra of New Zealand plays a shot during an ICC Champions Trophy 2025 match in February.
India vs New Zealand live stream: Watch ICC Champions Trophy final online (it's free) – India chasing 252
CARDIFF, WALES - FEBRUARY 22: Jamie Osborne of Ireland celebrates with team-mates after scoring a try ahead of the Ireland vs France Guinness Six Nations 2025 clash
Ireland vs France live stream: how to watch today's Six Nations game online, TV channels, broadcasters, team news