this post was submitted on 03 Feb 2024
78 points (94.3% liked)

Linux

50521 readers
863 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

I am thinking about hosting my own Mastodon server from home on a Raspberry Pi (Pi4 8GB)?

  1. Are there good tutorials out there?
  2. What's the annual cost just to host yourself?

@linux @nixCraft @raspberrypi

all 39 comments
sorted by: hot top controversial new old
[–] mat@linux.community 9 points 1 year ago (1 children)

I ran my own Mastodon for a while. While it does work, it takes up a ton of storage (every image and video you see is cached by your own server). It also doesn't work great for viewing stuff like replies and older posts, since backfilling is still not a thing. I ended up just browsing on remote servers instead. A great blog post about this: https://jvns.ca/blog/2023/08/11/some-notes-on-mastodon/

[–] dan@upvote.au 5 points 1 year ago (1 children)

every image and video you see is cached by your own server

Even videos and images you never see get cached. I barely use Mastodon and my server still uses around 50GB space.

[–] kurumin@linux.community 1 points 1 year ago

Lemmy is A Lot better in this aspect

[–] rsolva@lemmy.world 9 points 1 year ago

If it's a personal server for yourself and maybe some friends and family, I would rather use GoToSocial, as it is much more lightweight and is less complex to set up and maintain.

[–] aeharding@lemmy.world 8 points 1 year ago

Don't do it with an SD card. It will corrupt and crash after a few months.

With an SSD, yeah it would totally work well. :)

[–] Zachariah@lemmy.world 6 points 1 year ago (2 children)

Check out https://masto.host/ for managed hosting.

You can migrate away from them if you ever want to.

If you self host instead, make sure your server is on its own vlan. Servers are a target for exploitation, and you don’t want the rest of your home devices exposed if your server is compromised.

Note: A Pi probably has the CPU power, but the caching from the server may be more space than an SD card will hold.

[–] linearchaos@lemmy.world 7 points 1 year ago

SD card is a hard no. Need to cram an NVMe hat on it or an external SSD or HDD. They need diskio and a fair bit of quickly recyclable space.

[–] 4am@lemm.ee 1 points 1 year ago (2 children)

A VLAN is not a security feature. Be sure that your firewalls and routers are configured properly and kept up to date.

[–] andrew@lemmy.stuart.fun 1 points 1 year ago (1 children)

Yeah, this is an important point tbh. Vlans alone don't add any security if your firewall doesn't do something to prevent it, as your router will happily forward packets to the next vlan. It should be on a DMZ vlan, meaning traffic is allowed in at the firewall but not to any other internal vlans.

[–] dan@upvote.au 1 points 1 year ago* (last edited 1 year ago)

as your router will happily forward packets to the next vlan.

If you allow it. Good routers should block forwarding by default, other than VLAN1 to WAN.

[–] Zachariah@lemmy.world 1 points 1 year ago

Yeah, I meant: isolated vlan

[–] GustavoM@lemmy.world 5 points 1 year ago (1 children)

Pretty sure that'd rip your microsd in half really quick.

[–] acockworkorange@mander.xyz 4 points 1 year ago
[–] knfrmity@lemmygrad.ml 3 points 1 year ago

I'd run it with Docker. The official documentation looks sufficient to get it up and running. I'd add a database backup to the stack as well, and save those backups to a separate machine.

A Pi 4 draws maybe 5W of electricity most of the time. 24/7 operation at 5W will be your cost (approx 44 kWh per year), not including cost of the Pi, your internet connection, and any time you spend on maintenance.

[–] YIj54yALOJxEsY20eU@lemm.ee 3 points 1 year ago

I'm not sure if its true for Mastodon as well, but I read that self hosting a Lemmy instance was actually more work for the other servers to federate unless you had many users on your instance. Just something to keep in mind.

[–] cow@lemmy.world 2 points 1 year ago* (last edited 1 year ago)

I would not suggest mastodon for such low powered hardware, its also overkill for a personal instance. Akkoma or GotoSocial would work much better on a Pi. The annual cost is pretty much just 3-15$/year for the domain name.

[–] liss_up@beehaw.org 2 points 1 year ago

Following along with interest.

[–] lemmyreader@lemmy.ml 1 points 1 year ago

Going for Yunohost on your Pi4 can make things easier, just follow the Yunohost documentation, and later you can ask help in the Yunohost forum if needed : https://yunohost.org/en/install/hardware:rpi34 Instead of Mastodon you can install sometimes more light weight and simple, like GoToSocial : https://apps.yunohost.org/catalog?category=social_media

[–] possiblylinux127@lemmy.zip -3 points 1 year ago (1 children)

A raspberry pi isn't fit for hosting public services. Your likely looking for a VPS.

[–] YIj54yALOJxEsY20eU@lemm.ee 5 points 1 year ago (1 children)

Maybe not high traffic services, if it's being self hosted the limiting factor is probably the upload bandwidth anyway. I'm not sure how resource intensive Mastodon is to host though.