this post was submitted on 07 Oct 2024
90 points (98.9% liked)

Asklemmy

43943 readers
669 users here now

A loosely moderated place to ask open-ended questions

Search asklemmy 🔍

If your post meets the following criteria, it's welcome here!

  1. Open-ended question
  2. Not offensive: at this point, we do not have the bandwidth to moderate overtly political discussions. Assume best intent and be excellent to each other.
  3. Not regarding using or support for Lemmy: context, see the list of support communities and tools for finding communities below
  4. Not ad nauseam inducing: please make sure it is a question that would be new to most members
  5. An actual topic of discussion

Looking for support?

Looking for a community?

~Icon~ ~by~ ~@Double_A@discuss.tchncs.de~

founded 5 years ago
MODERATORS
 

Let's say I decided that instead of blogging, I wanted to host my own Lemmy instance that contained a maximum of one (1) user– me, but allowing other users to subscribe.

To show what I'm talking about, look at how kaidomac uses Reddit as his own personal microblog, which people subscribe to.

What is the cheapest way to do this?

My mental model of Lemmy is that if I were to do this, the instance would still be caching information from other instances. This would– at least in my mine– add up in costs.

I'm a software engineer, so feel free to use technical jargon.

top 39 comments
sorted by: hot top controversial new old
[–] Dirk@lemmy.ml 57 points 1 month ago (4 children)

Selfhosting is basically free. You already have an unmetered Internet connection, and sourcing some hardware to run Lemmy would also be super easy.

The “problem” is that setting Lemmy up is quite annoying and complex and involves multiple docker containers and volumes and networks. There are various installation scripts but it is still a complete mess.

It would also result in a metric shit-ton of traffic and data storage.

[–] iAmTheTot@sh.itjust.works 32 points 1 month ago (2 children)

I'm not sure how much you're willing to write off as "basically free", but electricity does add up for running your own server.

[–] ch00f@lemmy.world 16 points 1 month ago (3 children)

http://www.wolframalpha.com/input/?i=200w%2A1%20year%20%2A%240.14%2FkWh

$245/year assuming constant 200W load which is pretty reasonable for a small web server.

The trick is to have the server do other things like print, Plex, Piwigo, Samba, Shinobi, Frigate, Matrix, etc

[–] Fuck_u_spez_@sh.itjust.works 10 points 1 month ago (1 children)

My Plex/*arr Intel NUC server uses like 50-75W under heavy load and maybe 5W at idle, and I can't imagine it's not powerful enough to run a small Lemmy instance, so even this figure seems a little high to me.

[–] myersguy@lemmy.simpl.website 4 points 1 month ago (1 children)

Same, but even lower (Beelink N95). My whole stack of two NAS units, mini PC, switch, router, and modem average a load of 50 watts.

[–] Estebiu@lemmy.dbzer0.com 1 points 1 month ago (1 children)

Uhh... maybe putting a 9700k in my server wasnt as good of an idea as i thought it to be... it eats 74watts in idle... uhhh...

[–] myersguy@lemmy.simpl.website 2 points 1 month ago (1 children)

Yeahhhh...

Obviously it can all depend on your requirements, but this N95 system has been pretty eye opening on how much people are over-speccing their builds for home server use. It has 8Gb of memory in it, but I seldom see it use more than 2. The box is doing DNS, Jellyfin, torrenting, VPN, private git, etc.

[–] Estebiu@lemmy.dbzer0.com 1 points 1 month ago

I should.. probably get one of these n100 mobo that you can find on aliexpress...

[–] Dirk@lemmy.ml 6 points 1 month ago

… for a small web server.

It’s not just a small web server. It’s a dedicated server with full root access and 24/7 direct hardware access without any extra costs.

[–] toastal@lemmy.ml 2 points 1 month ago

If you were worried about saving energy, you would be running an XMPP server over Matrix. Matrix has similarly expensive requirements as Lemmy but Prosody or ejabberd can hum in the background.

[–] stealth_cookies@lemmy.ca 2 points 1 month ago

It depends on how powerful of a machine you need. My server only costs about $9.25/mo to run and it is way overpowered for the services I run on it.

[–] flashgnash@lemm.ee 9 points 1 month ago (2 children)

The problem for me is I believe you need to open your network firewall for Lemmy and other federated services to work right?

Not really a fan of opening up more attack surface on my home network

[–] Dirk@lemmy.ml 5 points 1 month ago (1 children)

The problem for me is I believe you need to open your network firewall for Lemmy and other federated services to work right?

Yes, of course. Or search for an external reverse proxy. Cloudflare offers something like this. (You set a Cloudflare server IP as target for your domain and then tell Cloudflare your IP and all traffic is routed over the Cloudflare ecosystem so your actual IP is not publicly used.)

I just opened port 443 and forwarded it to my Docker host and have NPM running there, handling all the forwarding to the individual containers, based on the request, but due to my day job I know what I’m doing :)

[–] flashgnash@lemm.ee 1 points 1 month ago (1 children)

I would still always be worried it'd been silently bot netted or something if it's accessible, even through cloudflare

I guess cloudflare does a lot to stop attacks from bots though right?

[–] Dirk@lemmy.ml 1 points 1 month ago (1 children)

I never tried it personally but I assume you're pretty save.

Here’s how it works:

The Tunnel daemon creates an encrypted tunnel between your origin web server and Cloudflare’s nearest data center, all without opening any public inbound ports.

After locking down all origin server ports and protocols using your firewall, any requests on HTTP/S ports are dropped, including volumetric DDoS attacks. Data breach attempts — such as snooping of data in transit or brute force login attacks — are blocked entirely.

https://www.cloudflare.com/products/tunnel/

[–] flashgnash@lemm.ee 1 points 1 month ago (1 children)

Does sound pretty reassuring assuming all that works for non http traffic too

[–] Dirk@lemmy.ml 1 points 1 month ago

I just checked their FAQ. They have information about SSH, SMB, RDP, connecting private networks (VPN), etc. available. I did not dig deeper regarding specific ports, though.

You could always use a reverse proxy on your side just accepting port 443 connections (https) and forwarding to a specific docker container using a specific port without the outside world even knowing.

[–] nichtburningturtle@feddit.org 5 points 1 month ago (1 children)

It also works through reverse proxies.

[–] flashgnash@lemm.ee 6 points 1 month ago

Is that not essentially the same issue as opening your firewall though? You're still taking requests from outside your network into your network without any authentication until they actually hit the server

[–] myersguy@lemmy.simpl.website 4 points 1 month ago (1 children)

It would also result in a metric shit-ton of traffic and data storage.

Really depends how many instances they want to federate with. I run a single user instance for all of my personal Lemmy use. Looks like it is using 20Gb of bandwidth per week, and the VM it runs on only has 32Gb of storage (and it runs other services, too)

[–] intensely_human@lemm.ee 3 points 1 month ago (1 children)

Did you follow these instructions?:

https://join-lemmy.org/docs/administration/install_docker.html

If so, did you find they “just worked” or was there troubleshooting involved?

I’m interested in self-hosting but very busy lately with little time to spare for tech troubleshooting

[–] myersguy@lemmy.simpl.website 5 points 1 month ago (1 children)

I used the Lemmy Ansible method to deploy. At the time that I first installed it, it was the recommended method vs a docker compose. It is a little bit of setup, but is pretty simple to get going. Just follow the instructions and it should just work.

[–] intensely_human@lemm.ee 1 points 1 month ago (1 children)

If you don’t mind my asking, what’s your level of IT expertise?

Have you administered servers, used ansible, etc?

[–] myersguy@lemmy.simpl.website 4 points 1 month ago

I'm a software dev with quite a lot of experience in server admin. I'm also a full time Linux user, and run a lot of services both at home and on a rented VPS. I had oddly enough never used Ansible before, but the instructions on that GitHub page should make it pretty simple.

[–] Toribor@corndog.social 2 points 1 month ago

Lemmy is definitely the most pain in the ass service that I self host. Most annoyingly when something goes wrong I can't just go on Lemmy until I feel like fixing it.

[–] PhilipTheBucket@ponder.cat 12 points 1 month ago (1 children)

It's very cheap. Hostinger's cheapest tier ($17/mo) can easily handle a single-user Lemmy instance. You'll have to once in a blue moon worry about the image storage growing without limit, but it's a solvable problem.

[–] Moc@lemmy.world 6 points 1 month ago (3 children)

Thanks, that's pretty good. Would Lemmy work with the base-tier (512mb RAM $4 USD) droplet?

https://www.digitalocean.com/pricing/droplets

[–] db0@lemmy.dbzer0.com 8 points 1 month ago* (last edited 1 month ago)

For that kind of money you get so much much more at a budget host like contabo.

[–] PhilipTheBucket@ponder.cat 5 points 1 month ago

I think you would need more RAM than that. Between Rust and Node, I probably wouldn't try to make do with less than 2 GB at a bare minimum, and 4 might be better.

I run mine on digital ocean and it's great. Mine is slightly more powerful, but you can always start small and upgrade. It's much harder to downgrade

[–] xthexder@l.sw0.com 10 points 1 month ago

I already had a server running docker, so throwing a few more containers in was trivial. There's a docker-compose.yml published in the lemmy repo.

Since my server was already running and had free space, it was literally free, but if you're starting from scratch there's more to consider.

I've been self-hosting for over a year now, and the storage does add up. The postgres DB is 11GB, and pictrs service is getting bigger at 29GB. Between all the different services, it can eat up a decent bit of CPU. My (admittedly 10 year old CPU) sits at a load average of 1.9, so you'll probably want 3 or 4 cores minimum. And based on my stats, 4GB of ram should be just enough to keep everything loaded.

[–] BlueEther@no.lastname.nz 7 points 1 month ago

I run https://no.lastname.nz on equivalent to oracle's free service (I do have a subscription so I can run a backup etc) and before that it was on a vps at quantomcore https://secure.quantumcore.com.au

[–] Moc@lemmy.world 3 points 1 month ago (4 children)

Alternative question– I use Zola and Github Pages to host my website. Does ActivityPub have support for blogging? Like let's say people on Lemmy or Mastodon could subscribe to my blog through ActivityPub?

From what I can tell Zola does not have anything like this (tried searching GH issues), but I just want to know if it's technically feasible. I can write Rust, so I could have a crack at it myself if it's not too cost/effort prohibitive.

[–] PhilipTheBucket@ponder.cat 5 points 1 month ago

Lemmy claims to be able to support any Bootstrap 5 theme as a drop-in Lemmy theme, and it's surprisingly close to being true. If you go to ponder.cat right now, you'll see one, based on Sandstone, that I've been fooling around with, because the provided Lemmy themes are mostly awful to me.

You could run one backend instance, have a main frontend to it on lemmy.whatever.com, and have a second frontend on whatever.com, with the theme set to a minimally modified version of Clean Blog or something, stripping out all the UI stuff and leaving only a blog. That would give you an RSS feed, a blog, a community that Lemmy people could follow, and a Fediverse actor that Mastodon people could follow, all in one place with all the comments unified. If you want to set the theme up that way, I can give you pointers, since I've just now been working on this for my instance.

[–] Dirk@lemmy.ml 2 points 1 month ago

Does ActivityPub have support for blogging?

From what I researched some time ago: There are/were some federated blogging systems out there but they’re all stuck in the pre-Docker era installation-wise and technology-wise (i.e. just outdated).

But in the end it makes no sense in my opinion. Blogs nowadays are just publishing and less networking/interaction.

A simple file loader and markdown parser could be enough. I set up my page based on Apache directory listing, a custom Action to parse markdown files, and some fancy CSS. There is figuratively nothing that runs my page, except a web server and a markdown parser.

[–] schnurrito@discuss.tchncs.de 1 points 1 month ago

ActivityPub, as the name implies, is just a protocol for publishing one's activities. Those activities can be blog posts too (just like they can be Lemmy comments, which is what I'm doing now).

Lemmy only allows subscribing to communities, not arbitrary accounts, but on Mastodon, people can subscribe to anything.