Hey all I have no idea what I’m doing here trying to set up a Lemmy instance. I’ve made simple servers before but nothing like the setup needed for this especially surrounding email verification.
I’m like 10 tutorials deep and on day 3 of trying to figure out what is going on with Postfix. There are so many words and acronyms being thrown around I don’t even know what I’m looking at anymore let alone knowing what the right questions to ask would be.
Very likely I’m going to nuke my droplet this weekend to make sure I have a fresh start with no half-baked solutions competing with each other. Would someone be willing to set up a time with me this weekend on Discord or something and baby step me through how to get this thing up and running?
Are you doing this as an exercise or are you doing this because you just want your own instance?
If the latter, why not use a managed hosting provider so that you don’t have to worry about any of that?
Historically I make my own things because I like knowing how stuff works (or at least kinda knowing how it works). I’m a programmer but generally I’m on the like C++/C# game programming side of things and learning server stuff is very difficult for me. Always out to learn more though
Update: My instance now only displays a blank page, I think I really messed it up somewhere and will definitely be starting from a blank install this weekend lol.
Where are you at? What is your problem specifically?
I’m in US, Washington state. I haven’t been able to get my server to send verification emails and it ended up creating ghost users. I thiiiink I got those all cleared out using some SQL commands. I’ve been seeing a number of posts and various guides on how to get my server to send emails. The instance says it sends one but then nothing is ever received in my inbox. I’ve been trying to figure out Postfix to do outgoing emails. It has been installed/uninstalled many times, including a handful of various other tools that different tutorials have had me install and configure.
Thing is I don’t even know if I’m configuring anything correctly. Like the MX record in digitalocean, I’m still unclear about how hostname and FQDN get used in the various Postfix and MX settings. The problem I’m running into is every time I turn around I find increasingly arcane things to try and check like a recent post in the support community here talked aobut DKIM, SPF, DMARC, RcRDNS, what in the world does all that mean and how do they potentially fit into what I’ve already tried…
Yeah I gave up after neither docker nor ansible nor old fashioned worked, though docker didn’t surprise me because it never fucking works for anything, and if someone responds DoCkEr AlWaYs WoRkS fOr Me then they’re lying
Docker works for lots of simple things. But deploying Lemmy isn’t simple at all. It looks like it was never meant to be deployed with Docker. It’s a giant mess and can’t be integrated properly in an already set up and running Docker environment.
You need to manually create all images and container files by yourself or deploy Lemmy into an own VM running Docker where it can abuse Docker and clutter all over the place as much as it wants.
I’d recommend using something like Amazon SES or sendgrid for email, a 3rd party solution so you don’t have to worry about it.
Are you trying to set up your own email server? That’s more trouble than it is worth just for SMTP on your Lemmy instance. I’m using zoho for smtp for example.
Dude I’m in the same boat, tried to install Lemmy quick and dirty on my Linux server … finally I’m bringing a non used server into life with a clean install (Mint 21 + PostgreSQL + Docker) Still have problems :-/ :-D
Hopefully it’s just configuration stuff, but like you have 3 config files with redundant information and no idea if host should be localhost(using nginx) localhost:80 or my.website.com or http://my.website.com or localhost:port_for_nginx, and (rant on, sorry) that’s something that is in several places, or so it seems …
With some try and error it seems things start to run, but I still have no database created (I made one named lemmy, with a user named lemmy, tried without DB lemmy etc) is lemmy supposed to create the DB or just the tables or …
What about a sub for just installing and get instances up and running?
Even just copies of the conf files (with passwords removed) could help I think (I didn’t know if the {{ … }} you shouldn’t keep the {{ }} for example) I bet that could be quite useful for a lot of newbie lemmy server operators.
My server is on a shaky and slow but stable line at the moment (Server => slow WiFi => Internet 2.5Gb) but cables are on the way. A Moebius (Gir, the comics guy) themed instance is in the works!
Well hopefully…
Cheers and long live Lemmy and the Fediverse!
Valmond
You shouldn’t need the Postfix container at all unless you want to manually set that up and know what you’re doing. You configure your SMTP settings in the
config.hjson
file as outlined in the example defaults.hjson file. I’m using a third-party SMTP provider to avoid any deliverability issues with sending emails directly from my server’s IP address. Just ensure you configured your DNS correctly (DKIM, etc.), punch in the info, and it should work.Just use an external SMTP provider. You will have a bad time with sending emails otherwise.
Do you mean something like Brevo? And if so is there a good guide for how to link that kind of thing up with Lemmy?
I’ve been scratching my head over the postfix-relay as you have, until I realized my ISP(running the server at home) blocks port 25.
So I got the SMTP provider approach to work, through Brevo. I’ll detail my steps here. I also tried to setup using gmail but I got an authentication error so I quickly gave up on that.
Sign up to Brevo
Register at Brevo with your totally legit existing company name, then choose the free plan. This allows 300 free emails sent/day.
On the dash page, click in the top right -> “SMTP & API”. Here’s your login information for the lemmy.hjson config. Use the SMTP key value as your
smtp_password
Edit your lemmy.hjson
lemmy.hjson
email: { # Hostname and port of the smtp server smtp_server: "smtp-relay.brevo.com:587" # Address to send emails from, eg noreply@your-instance.com smtp_from_address: "noreply@example.tld" smtp_login: "<brevo login email>" smtp_password: "<smtp key>" # Whether or not smtp connections should use tls. Can be none, tls, or starttls tls_type: "starttls" }
With this approach you also don’t need postfix-relay in your docker-compose.
With this setup, you should be able to get the verification/password reset emails to be sent. However the recipient will receive a phishing warning or perhaps the email won’t even get through, because your DKIM signature doesn’t match your domain.
DKIM signature
To get a proper DKIM signature, you also need to edit your DNS records.
From the Brevo dashboard click the topright menu again -> “Senders & IP”.
Go to “Senders” and edit the “From email” field to your own domain example.tld
Then go back and go to “Domains” -> “Add a domain”. Add in your example.tld and probably choose “Other” for provider. In the next page you get records to add to your DNS provider. If you don’t know how this works there’s a tutorial linked on that page.
Click authenticate, and you should now see green checkmarks if done correctly :).
Keep in mind you won’t receive emails if someone replies to these, since there’s no IMAP setup.
Do tell if there’s anything wrong with these instructions, I only wrote it from memory.
I think I have this figured out. I’m going to wait until tomorrow when I have a friend online who can double check for me that everything is good, but your comment and other people telling me to use Gmail I think got me to where I need to be. Granted I had to redo my instance and server entirely because I mangled my first one so bad it wouldn’t even load the page… But I think I’ve got it figured out now. Thank you so much for this explanation and example config file
This is exactly the kind of one step at a time tutorial I need thank you! I’ll try this soon and let you know how things turn out on my end
If you’re standing something up for yourself, and it doesn’t have to be anything fancy, any email provider that provides SMTP *will work.
This even includes gmail: https://support.google.com/mail/answer/7126229?hl=en
But, another thing to remember is that many hosting providers block the default ports by default. Many will open the port with a customer service ticket but others will only do it at a certain “tier” of service.
You mentioned a droplet so I googled digital ocean and smtp, and this thread popped up: https://www.digitalocean.com/community/questions/sending-email-with-do-app-is-it-possible
I, personally, use linode as my provider and I had to open a ticket with support in order to unblock the right ports to send email.
As an aside:
Standing up an email server itself is a good exercise because it’s an absolute PITA. Mainly due to trust and ensuring all your DNS records are right and stuff.
Overall, it’s a nifty exercise to understand but I, personally, don’t really feel like it’s worth the pain.
Edit: forgot to finish a sentence
You can use lots of email providers, even gmail, and authenticate with their SMTP server to send messages. Sending unsolicited email directly to another mail server will 100% cause it to become spam. There are 30 years of anti-spam ‘webs-of-trust’ and now validating technologies that, if you don’t setup, will guarantee your emails do not get delivered.
Any email provider will do. I think you can even enable it for gmail accounts. You can just put in the connection details in the lemmy.hjson.
You don’t have to learn postfix to send emails with Lemmy. Just put in the host name and credentials to your email server in the Lemmy settings.
As an example, I use fastmail so I used the settings they say on this page:
https://www.fastmail.help/hc/en-us/articles/1500000279921-IMAP-POP-and-SMTP
For you, you may use something else (maybw Google, and then you have to Google on how to set up smtp with Google).
Here are my configs to use for a docker setup if it helps https://git.minnix.dev/minnix/lemmy_configs
What is an external web server proxy, and by ‘host postfix for email’ does that mean using Postfix installed/configured on my server?
Why are you trying to set up an instance? What’s your use-case?
They want to start an instance for star wars fans because they like captain picard. :)
Two main reasons: I think having granular instances is better for the fediverse instead of relying on a couple super instances to handle everything, and also I just want to because figuring out how to do stuff like this is neat even if sometimes stressful.