this post was submitted on 21 Nov 2026
252 points (96.3% liked)

Selfhosted

64243 readers
752 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

Detailed Rules Post

  1. Be civil.

  2. No spam.

  3. Posts are to be related to self-hosting.

  4. Don't duplicate the full text of your blog or readme if you're providing a link.

  5. Submission headline should match the article title.

  6. No trolling.

  7. Promotion posts require active participation, with an account that is at least 30 days old. F/LOSS without a paywall has exceptions, with requirements. See the rules link for details. Tags [CBH] or [AIP] are required, see the links in Rule 8 for details.

  8. AI-related discussions and AI-involved promotional posts have additional requirements for tagging, as noted in Rule 7 and the AI & Promotional Post Expanded Rules post, and find example disclosures here.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 3 years ago
MODERATORS
 

No, that's it. I am f#*&@-ing done. I went from gmail to tuta to proton. Now I hear something like FastMail. Some say privacy, some say security, but what they never say is corpos gonna corpo.

No, I am done using third party services. This may be a Sisyphus task, but I want to self host a mail server even if 60% of it goes to another person's spam.

I've heard about Dovecot and some other services. While searching YouTube, I came across a defunct channel that still has this old video that gives instructions to selfhost email: https://www.youtube.com/watch?v=9zP7qooM4pY

Cherry on top would be to have as many parts with the GPLv3 license as possible.

Any guidance or instructions would be greatly appreciated. I have a domain name and I am currently hosting a small webpage for fun. Nothing serious.

(page 2) 50 comments
sorted by: hot top controversial new old
[–] carloshr@feddit.cl 5 points 1 week ago

BTW, I don't know whether it was mentioned or not, but this book by Michael W Lucas, is a very good guide to whom want to accept the challenge of running their own mail server:

https://mwl.io/static/books/run-your-own-mail-server.html

[–] jagermo@feddit.org 4 points 2 weeks ago* (last edited 1 week ago) (1 children)

If you want to go into the nitty gritty, get How to run a mail server.

[–] DarkMetatron@feddit.org 4 points 1 week ago

Hosting your own mailserver can be fun but can, and very likely will be, come with a huge can of worms. I host my own mailserver for a handful of domains for roundabout 20 Years now (on a rented virtual server with a "datacenter ip address") and still run into issues from time to time. Most of those could have been prevent if I had not slept on things like DMARC, DKIM, DANE and such, it is very important to always be aware of new security mechanisms and to implement them.

I would recommend against trying to run a public mailserver on your local server with a residential ip address, because you can't set a ptr for those and ranges/networks from ISP are all on filter lists, so it is borderline impossible to get any mails delivered.

[–] tate@lemmy.sdf.org 4 points 2 weeks ago

I felt the same way about 6 years ago. I host my own on a Linode server (to get a static IP), and I've never regretted it. I get blocked as spam here and there, but it's not nearly the big deal everyone says. There is a lot of FUD around this for some reason.

[–] irotsoma@piefed.blahaj.zone 4 points 1 week ago

First get a VPS and an IP address and validate the IP address is either not on black lists, or more likely, start the process of removing it from blacklists. You can find blacklist checkers, just search "SMTP Blacklist Checker".

Then while that's in progress you can start setting things up. I really found Mailcow to be the easiest and most robust since I wanted OIDC integration. It's not the best integration and takes a little setup, but it works reliably these days to generate mailboxes and set passwords. You have to include the hashed passwords in your OIDC configuration to get the mailbox passwords set automatically. The web UI does integrate with the OIDC provider though. Mailcow comes with fail2ban and helps set up DKIM and other security settings on your DNS records for proper validation by the receiving SMTP servers and all of that. And has built in spam filtering and virus scanning, though I think virus scanning is not worth the resources it requires since it's pretty easy to just never open attachments unless you were expecting them. Hopefully most of us know that. So, while it's tedious, it's not too difficult if you follow the instructions.

The only issue that I still keep gmail around for is that some companies, especially financial or healthcare companies, will refuse to send email to domains they haven't white listed and mostly they only white list the big ones webmail sites like gmail or proton or outlook, etc. Not much you can do about that usually since they have a misguided belief that those domains are somehow more secure, even though they are actually selling your mail metadata and sometimes actual content or at least feeding it into AI models which can leak personal information "unintentionally".

Overall, though, it's well worth it since I can store as much as I want or at least it's cheaper storage space than webmail providers. And I prefer the maildir storage over database storage in newer systems since it's really easy to split and archive data to cheaper storage space. So mailcow works for my needs.

[–] Theoriginalthon@lemmy.world 4 points 1 week ago

Fuck yeah! Right first things first are you prepared to learn new stuff and know how to read documentation?

If you have never hosted email before I want you to go away and look at these topics before even starting. It will help you understand what's going on Postfix, dovecot, SMTP, DNS records, SPF,DKIM, dmarc, fail2ban, what an open relay is, let's encrypt, how to use lets encrypt for mail servers, email blacklists.

Once you get started setting up a server mxtoolbox.com is going to be your new friend.

Although I've never used it there is a mail server in a box https://github.com/mail-in-a-box/mailinabox which just installs and configures everything.

[–] chewypoops@lemmy.world 4 points 1 week ago (2 children)

This is one of those things that everyone wishes they could self host until they try to, and then they regret it and desperately need to switch back.

load more comments (2 replies)
[–] capc8m@lemmy.world 4 points 2 weeks ago

VPS + Maddy + Roundcube

[–] Brkdncr@lemmy.world 3 points 2 weeks ago

You don’t need a vps or static ip like others are stating. You can get a port reflector service.

Worth considering is a Secure Email Gateway service which would be where your inbound email is delivered too and check for spam before getting forwarded to your email server. It would also be where your outbound email leaves from.

Last time I looked it wasn’t exactly cheap to host email once you consider the need for a good SEG.

Not sure why you’re upset with email services, but once you start paying for their service a lot of the BS goes away.

[–] mitram@sopuli.xyz 3 points 2 weeks ago

Can't help you on how to host the mail server by yourself. But I'd like to point out that critical and complex infrastructure like a mail server is best managed by a team sharing the administrative load.

With that in mind, organizations like social.coop (which hosts Mastodon and manages it democratically) may be a good solution for you! You don't have to do it alone, but your voice matters and no decision is made without you. Digital infrastructure cooperatives are a very interesting solution!

Good luck either way!

[–] KairuByte@lemmy.dbzer0.com 3 points 2 weeks ago

If (when) you decide self hosting isn’t the solution, I suggest mxroute. Lifetime options for reasonable prices, though I got in a number of years ago for $99. Storage isn’t huge for lifetime, but it’s nice to not have to think about it.

[–] Alph4d0g@piefed.social 3 points 2 weeks ago

I agree with the VPS route if you have the appetite for it. I host my own email server on a VPS. And then you can also use it for whatever cool intentions you might have with that VPS. A tailscale exit node that isn't coming from your home IP is nice way to gain back some level of privacy. Just one example of many other uses. I haven't found self hosting to be high maintenance like others have suggested.

[–] canttakeitwithyou@lemmy.zip 3 points 1 week ago

I run my own email server. Of all the services, email is the most complicated and weird and fucked up. It's hardcore doing it yourself. I'm glad I do, but make sure you have the time and energy to get it all going.

Do serious research first. Make sure you have time. Make sure you have a good VPS or commercial ISP. Don't be half assed or it will fail.

[–] Decronym@lemmy.decronym.xyz 3 points 2 weeks ago* (last edited 1 day ago)

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:

Fewer Letters More Letters
DNS Domain Name Service/System
IMAP Internet Message Access Protocol for email
ISP Internet Service Provider
IoT Internet of Things for device controllers
LTS Long Term Support software version
NAT Network Address Translation
POP3 Post Office Protocol v3, for email; contrast IMAP
SMTP Simple Mail Transfer Protocol
TLS Transport Layer Security, supersedes SSL
VPN Virtual Private Network
VPS Virtual Private Server (opposed to shared hosting)

[Thread #176 for this comm, first seen 22nd Nov 2026, 00:10] [FAQ] [Full list] [Contact] [Source code]

[–] TheMightyCat@ani.social 2 points 1 week ago

I would recommend dovecot and postfix but i haven't tried any others as these just worked for me.

For hosting i chose a VPS instead of running it at home, i believe at home is a bit harder as you may need a PTR record from your isp, but im not sure.

For a VPS pick a provider that allows for port 25, I use hetnzer which allow it (atleast for me) after one month and paying your first invoice.

Then setup all the DNS records and send a few test mails to mail checker sites.

You don't need a perfect score, my IP is on one block list for some reason but that hasn't given me any trouble.

[–] boudica@lemmy.world 2 points 1 week ago (1 children)

Lots of good suggestions in the comments. To save time, you can use a one stop setup option like mailcow or server management software like webmin.

If you go the VPS route, it will be hard to find one that doesn't block port 25. A relay service gets you around that restriction. Many relays also hold your email if your mail server goes down.

Finally, test your setup with tools like mxtoolbox and follow the suggestions to set up SPF, DKIM, etc. When everything is correctly configured, it will take a few weeks for spam filters to stop auto blacklisting your new domain. After the initial config period, maintenance is mostly hands off. Don't forget to tweak your own spam filters.

load more comments (1 replies)
[–] communism@lemmy.ml 2 points 2 weeks ago* (last edited 2 weeks ago)

I self host email. It's really not that big a project. People way overblow it. I have never had a significant problem running on several years now.

Check out this tutorial.

[–] Carol2852@discuss.tchncs.de 2 points 2 weeks ago

I am hosting my own email server on a rented server for multiple years now. Just recently I stumbled upon this post https://jan.wildeboer.net/2022/08/Email-1-Postfix-2022/ which has good explanation and even tutorial style command examples.

I don’t know if it would work from a homeland, but as long as DKIM, DMARC and SPF works, I don’t see why not.

[–] stom@lemmy.world 2 points 1 week ago (5 children)

AWS Lightsail VPS, install Virtualmin. It'll configure dovecot and postfix for you. You can use roundcube webmail (they have an installer) or Thunderbird right out the box. Setup DKIM, SPF, and DMARC. Request your PTR/rDNS from AWS and you shouldn't get issues. I've run this for years and never had an issue with mail being blocked which wasn't my own server blocking others.

[–] Buck@jlai.lu 2 points 1 week ago* (last edited 1 week ago) (1 children)

~~This may be a very nice proposition, but I, personally, would never give admin rights to a rando from the internet on what is to become my mailbox soon after…~~

Oops, misread

[–] iglou@programming.dev 2 points 1 week ago (1 children)
[–] Buck@jlai.lu 3 points 1 week ago (2 children)

Haha, indeed I did, nevermind my comment.

load more comments (2 replies)
load more comments (4 replies)
load more comments
view more: ‹ prev next ›