Thinking of setting up a mail server, do I need a 2nd VPS? [affordable suggestions welcome!] reddit / selfhosted ---------------------------------------------------------------------- AudioBabble · 2023-11-25 23:44 Hey all, I have a VPS with Hostinger that serves a few websites, very basic stuff, simple blogs or static pages, very low traffic. At the moment I have 'custom domain' emails set up with Protonmail and also Tutanota. Ther are mainly for client communication one-to-one, I very rarely if ever do mass mail-outs. I'm looking into the possibility of setting up a mail server instead, but it seems it's generally not a good idea to run mail server and web server on the same VPS. \[-- if anybody thinks there may be exceptions to this, do let me know, because I would still be interested if it's not an entirely bad idea?\] So I'm wondering about a dedicated VPS to run my mail server, but really don't want to pay much. In order for it to be cost effective (as opposed to just paying for a mail service with multiple custom domains), i'd want a VPS with 3GB ram and 20-30GB storage that **doesn't** block port 25, for less than $6 per month. Is this likely? Anyone know of any contenders? ---------------------------------------------------------------------- anotherucfstudent · 2023-11-26 00:17 I use hetzner cloud in Finland for this. Fits all your criteria, including the price. ---------------------------------------------------------------------- adamshand · 2023-11-26 01:06 There's no technical problem with running a mail server on the same server as websites. The only concern is simply that web applications are much more likely to have bugs and get hacked than your mail server. If a web app does get hacked, all of your mail is potentially compromised. If you don't care about that, I'd say ... go for it. ---------------------------------------------------------------------- micseydel · 2023-11-26 01:14 Email is one of the few things I wouldn't personally self-host, [because hosts like gmail may silently drop your emails](https://cfenollosa.com/blog/after-self-hosting-my-email-for- twenty-three-years-i-have-thrown-in-the-towel-the-oligopoly-has- won.html) with there being literally nothing you can do about it. ---------------------------------------------------------------------- lesigh · 2023-11-26 02:14 You absolutely could run both on the same machine. What matters most is the quality of the IP and how you configure the server ---------------------------------------------------------------------- rnimmer · 2023-11-26 05:56 you should be using containers though ---------------------------------------------------------------------- adamshand · 2023-11-26 07:38 I like using containers, but it doesn't make any difference to the above. Containers can be exploited as well. ---------------------------------------------------------------------- adamshand · 2023-11-26 07:39 I don't know why people feel the need to say this every time somebody asks about selfhosting email. ---------------------------------------------------------------------- blind_guardian23 · 2023-11-26 11:11 If you have the knowledge its fine, if not it wont be fun. mailcow ist the best overall package i have seen. ---------------------------------------------------------------------- AudioBabble · 2023-11-26 13:29 Thanks -- mailcow looks good. What I'm struggling to find good info on is how to get a web server (based on apache2) and mailcow (based on ngix/docker) running happily alongside. I'm no expert but I do understand the web server side of things. I had a go with iRedMail via this tutorial: [https://www.linuxbabe.com/mail-server/email-server- debian-11-iredmail](https://www.linuxbabe.com/mail-server/email- server-debian-11-iredmail) \^\^ but that hijacked my whole server so it became **just** a mail server and stopped serving web. It's a shame because the tutorial was pretty comprehensive and just the sort of thing I need! ---------------------------------------------------------------------- micseydel · 2023-11-26 13:55 Because hosts like gmail will silently drop your emails and there's nothing you can do about it. I linked to a source. Can someone help me understand the downvotes? Why would I *not* warn people about this? Am I mistaken? ---------------------------------------------------------------------- blind_guardian23 · 2023-11-26 14:18 Official doc is here: https://docs.mailcow.email/post_installation/reverse-proxy/r_p-nginx/ (ngnix is a more common choice for reverse Proxy). would recommend using only one service per vps (unless you're really on budget), activate Backup/snapshots. ---------------------------------------------------------------------- mirisbowring · 2023-11-26 19:57 In case your mails end up in spam or get rejected by other mail servers just because one of the other IPs of your hoster spammed, i can recommend to use a smtp service like from AWS (or others) to route the outgoing mails through for better reputation. ---------------------------------------------------------------------- adamshand · 2023-11-26 20:08 Just because it's "hard" doesn't mean it's not worth doing. And this is r/selfhosted, we're here to help each other selfhost in a sensible way. Even when it's hard or risky. And really, self-hosting email isn't that hard. Deliverability to the big sites can be frustrating, but there are absolutely things you can do about it. But mostly my response is because comments like yours are often the main responses people get when they ask anything about email hosting. We're teaching people that they shouldn't try to selfhost email, and personally I think that's "bad". What I'd like to see is everyone here self-hosting email for their friends and family. The only reason the big companies can get away with being dicks about deliverability is because so few of us bother any more. Let's change that. ---------------------------------------------------------------------- micseydel · 2023-11-26 20:21 Did you read the link I shared? What would you add that that person should do to get things working? I'm not here to advocate against hard things, but I can see myself literally abandoning self-hosting if I spent a bunch of time on something and found out that my email server is banned forever because Google has found it more profitable to ban hosts with zero feedback or recourse than do the right thing. I'd love to see the email cartel broken but, unless you're right that Google will fix this issue *for every self-hoster*, I think people **at the very least** should be notified that their efforts are likely to be a waste. This isn't true for *most* self-hosting and to answer your question, that's why I brought it up. ---------------------------------------------------------------------- adamshand · 2023-11-27 01:50 I've read it in the past. It's a bummer of a story. :-( What I can say is that I ran an email server at my last job to deliver email for one of our software products (password resets, reports etc) and it worked fine. There were a small number of emails which went directly to customer's spam folder (and that's been a problem ever since automated spam filters appeared) but overall it worked just fine. There are a number of people on this subreddit who've reported success running mail servers for years, some for decades. Just because one guy gave up doesn't mean it's impossible. And, you're right. It's fair enough to warn people that this is hard. What I try and do is encourage people to try *and* let them know that deliverability can be a challenge. You can "solve" that problem by using a commercial SMTP relay and still get most of the benefits of selfhosting mail. My frustration is that so many people are saying you can't or shouldn't selfhost mail any more that people aren't even trying. I quit selfhosting my families email around 2007, I got seduced by Google's free offer of Google Apps. But I regret it, and I've been thinking that it's time I did this again just to prove a point. And Stalwart looks rad. ---------------------------------------------------------------------- AudioBabble · 2023-11-30 19:47 Well folks, it certainly seems like hosting both email and mail server on the same VPS is possible. The trouble I'm having is that, because I'm terribly well clued in about mail server admin, I really need a step-by-step tutorial to make setting it up a realistic possibility, but... thusfar I've been unable to really find such a thing. What I have found are plenty of guides for setting up a standalone mailserver, and so I'm looking at the daunting task of modifying what they tell me to do, while still managing to serve my websites. At the moment, my biggest hurdle is I keep coming up against: sudo hostnamectl set-hostname [mail.your- domain.com](https://mail.your-domain.com) \-- correct me if I'm wrong, but this is going to change my hostname so that I no longer have a hostname for web? Seems I need an FQDM for hosting a mail server, but at the same time I also need an FQDM for serving websites. How do I do both? I'm running Apache2 if that helps... ---------------------------------------------------------------------- micseydel · 2023-12-02 16:27 >And, you're right. It's fair enough to warn people that this is hard. What I try and do is encourage people to try and let them know that deliverability can be a challenge. You can "solve" that problem by using a commercial SMTP relay and still get most of the benefits of selfhosting mail. > >My frustration is that so many people are saying you can't or shouldn't selfhost mail any more that people aren't even trying. You make a good point that my discouraging people from trying contributes to the problem being worse. Going forward I think I'll say something like, "FYI I think self- hosting is generally very rewarding but email is risky; I would feel very rewarded if it worked but personally it's not something I've risked my time with. You'd be doing a public service if you get it working though!" Thank you so much for being patient with me and sharing your thoughts! ---------------------------------------------------------------------- adamshand · 2023-12-03 03:23 ❤️