Of the many useful things I could do with my spare time instead I’m setting up a Lemmy instance because why not. The scope of this is definitely greater than any self-hosting I’ve ever attempted, so please feel free to tell me just how much trouble I’m in. I’m just giving the broad strokes to see if I’ve made any crucial errors (other than deciding to do this at all).
And if this is a completely wrong place for a post like this or I’m missing data I’m supposed to include I apologize, I probably need a sanity check, in more ways than one.
First limitation, I’ll be hosting it on an existing Linux Mint box acting as a file share mostly and occasional gaming PC/movie streaming box. Its hardware is overkill for this, I do not anticipate issues when it is in use. It receives regular updates and weekly reboots, instance will be set to automatically restart. NVMe with loads of space for local storage, RAID SSDs for data offload/backup.
Second limitation, I hate Cloudfare and Oracle. I do not want to use either of them.
Third limitation, money. Cheaper is better. I have a URL picked out and a registrar which will give me the cheapest long term option, in case I actually keep this thing going.
Last limitation, I’m already in over my head so I’ll be relying on a lot of googling and probably some chat bots to figure things out as I go through the actual deployment process. What could go wrong?
So, Lemmy hosted on Linux Mint box using Docker containers. ISP is a good one for this I’m told, no CGNAT, largely stable public IP but I’ll have a script running in case it does change. Confirmed ports 80/443 are open. Using Caddy for the HTTPS. Closed registration to start, if by some miracle I make it to actually wanting to allow additional users it will not be fully open, and I’ll use Brevo for the email SMTP. Security wise I know I’m making it harder for myself by exposing my IP, I’m going to have UFW running and Crowdsec to help keep incoming bad traffic out.
Down the line I’ll get Lemmy updates, backups, retention rules in place/automated, and make decisions on federation, etc. Thoughts?
I probably wouldn’t host it at home, there are so many personal devices containing personal information on the network that I don’t consider the risks involved worth it. I would get a VPS, even if they’ve increased in price lately. If you do set it up at home, you will have to harden the server and the network, and that requires a lot of time, knowledge and effort. Just keep this in mind!
You can easily sequester your personal stuff from your self hosted stuff. Most traffic going anywhere is encrypted as it should be. The main concern is lateral movement hence the network isolation.
I would NOT host a Lemmy instance at home unless you’re going to obfuscate your IP address. If you make it public, you’re inviting any whackjob that sees your username to find your physical location. Additionally, I wouldn’t host it on a PC that you actually intend to use for day to day stuff, just in case the instance gets hacked and someone manages to escape the container it’s in. If you wanted to do this, I would put it on its own box with Cloudflare in front of it, otherwise you’re inviting trouble where there doesn’t need to be any.
I keep seeing “escape the container” mentioned like it’s a very common occurance. Is it really? I’ve looked up escape CVE’s and they seem to be few and far apart, they’re usually tricky to pull off, and when one comes out it’s a big deal and they get fixed right away (obv).
Actually my issue isn’t “do escape CVE’s exist”, it’s more like, should I really waste my time planning for it? It’s like planning for file permissions not to work, or logins to be bypassed.
I get that shit happens and why defense in depth is a thing but how do you defend from something so fundamental? If you operate under the assumption that containerization can be by bypassed, and virtualization can be bypassed, where do you draw the line and what do you do, run each app on a standalone physical box?
The only thing I’d say is look into whatever tooling and scripts people have made for removing CSAM from your instance. I messed around with a Lemmy instance for a bit, but when I heard about how hard it was to deal with the pedos, I got a little scared about inadvertently hosting CSAM and decided to shut it down. Since then I think I remember hearing about some better automated tooling for that kind of thing though so hopefully you can set that up.
If it’s your own instance, with closed sign ups, shouldnt it only sync the content you subscribe too?
I keep considering the same thing, except only letting myself register so that I can have my own stupid instance name.
oh very interesting. i’ve been wanting to get into the details of how federation actually works, and i wanted to figure out why mastodon<->lemmy federation does often not seem to work. but i guess that’s a deep rabbit hole too!
You’re an idiot of you don’t use PieFed instead 😃
Yes. Do PieFed.
Also, don’t do cloudflare. If you must use something, make sure it’s self hosted.
Do it. You’ll learn something new. Maybe you’ll even contribute to the code.
My instance has been online for about a month, the supplied docker-compose.yaml was quite straightforward, had a little headache with Nginx but nothing overly complicated.
The long-con so to speak is federation, you have to subscribe to each community manually to begin federating with them, i have noticed timing issues with other instances such as Lemmy.world and have not been able to resolve them.
I’ll write a script you can use to seed with top communities. I already have most the work done.
Interesting. And yeah I’m aware of the federation issue, I was gonna use that to my advantage in terms of my plans to slow roll who to federate to to keep my bandwidth and storage allowances under control. I also know there is a script you can set up which will handle the initial contact to federate automatically.
I also know there is a script you can set up which will handle the initial contact to federate automatically.
I tried finding such a script but had no luck. I was able to export my subscription list from sh.itjust.works and imported it on my instance.
I had to unsubscribe and resubscribe to the communities I follow as I was experiencing the ‘Subscribe Pending’ issue but after a little while things seemed to start evening out and becoming a bit more stable.
Maybe. Do it anyway?
Just in general or because you’re setting up a Lemmy instance?
Well in general I know I’m an idiot, so for the moment I’ll just stick with Lemmy instance feedback cause that’s at least easier for me to address without expensive therapy.
allow additional users it will not be fully open
Just for trusted friends or randos? If randos, have you ever been a mod? Never set up a Lemmy instance, but I have been a mod of quite a few Reddit subs. It’s a headache I will never engage in again.
Not complete randos, but yeah it’ll likely be a very minimal group of people if at all. And I’m not looking forward to modding so I doubt I’ll go the route if having a lot of comms in my instance, but we’ll see what happens.
Alright man. Best of luck. Give it a go. You’ll never know how it will turn out unless you try.
Update with a link to your instance when you’ve done it so we can show some love and support
Yes you are mad, I know as I did that over 3 years ago. Went from at home => a cheep VPS => paid for Oracle VPS.
If you go down the lemmy route (vs piefed) then I would deply with Lemmy-Easy-Deploy by @ubergeek77. this makes setting Caddy and mail simple
Good to know, I’ll take a look at those. Thanks!
up untill now I’ve not had too much bot traffic, but I’m betting hammered atm. Make sure to have some good firewall rules for when it happens:

check this out!

those ~2000 blocks were in the hour after turning on the full proxy, still getting a fair few from china hitting the real IP address that they must have cached.
Grep’d the logs and had 250,000 requests from china in the last 20 hours asking for full threads via the api
Yes, you are, but aren’t we all?
Lemmy eventually plans on having an invite system, you could maybe use that when it comes out
https://github.com/LemmyNet/lemmy-ui/issues/4128
(You can also do this manually with the application questionnaire field and a spreadsheet)











