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.
you should be using containers though
I like using containers, but it doesn't make any difference to the above. Containers can be exploited as well.
Email is one of the few things I wouldn't personally self-host, because hosts like gmail may silently drop your emails with there being literally nothing you can do about it.
I don't know why people feel the need to say this every time somebody asks about selfhosting email.
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?
You absolutely could run both on the same machine. What matters most is the quality of the IP and how you configure the server
If you have the knowledge its fine, if not it wont be fun. mailcow ist the best overall package i have seen.
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
^^ 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!
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.
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 not 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
-- 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...
Self-Hosted Main
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.
For Example
- Service: Dropbox - Alternative: Nextcloud
- Service: Google Reader - Alternative: Tiny Tiny RSS
- Service: Blogger - Alternative: WordPress
We welcome posts that include suggestions for good self-hosted alternatives to popular online services, how they are better, or how they give back control of your data. Also include hints and tips for less technical readers.
Useful Lists
- Awesome-Selfhosted List of Software
- Awesome-Sysadmin List of Software