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

  • rsolva@lemmy.world
    link
    fedilink
    arrow-up
    9
    ·
    9 months 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.

  • mat@linux.community
    link
    fedilink
    English
    arrow-up
    9
    ·
    9 months ago

    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
      link
      fedilink
      arrow-up
      5
      ·
      9 months ago

      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.

  • aeharding@lemmy.world
    link
    fedilink
    English
    arrow-up
    8
    ·
    9 months 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
    link
    fedilink
    arrow-up
    6
    ·
    9 months ago

    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
      link
      fedilink
      English
      arrow-up
      7
      ·
      9 months 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
      link
      fedilink
      arrow-up
      3
      arrow-down
      2
      ·
      9 months ago

      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
        link
        fedilink
        English
        arrow-up
        1
        ·
        9 months ago

        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
          link
          fedilink
          arrow-up
          1
          ·
          edit-2
          9 months 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.

    • the_third@feddit.de
      link
      fedilink
      arrow-up
      6
      ·
      9 months ago

      Don’t know why people insist to run a RPi from a micro SD. Stick a proper SSD into an USB enclosure and be done with it.

      • utopiah@lemmy.ml
        link
        fedilink
        arrow-up
        6
        ·
        9 months ago

        Because it’s cheaper (barely but still), smaller (fits right into the Pi and its case) and more convenient (no adapter). When one just got a Pi that might even be sold with a microSD then they’ll use that.

        I’m not arguing it’s the right thing for data intense usage but the “why” IMHO is pretty obvious.

        • bartolomeo@suppo.fi
          link
          fedilink
          arrow-up
          4
          ·
          9 months ago

          Come on, it’s a raspberry pi not an iphone. Those things are for tinkerers who live by “if it ain’t broke, fix it till it is”.

          • utopiah@lemmy.ml
            link
            fedilink
            arrow-up
            1
            ·
            edit-2
            9 months ago

            It’s for tinkerers yes but the RPi is popular because they try to facilitate the tinkering process. That means a lot of people will buy it in order to learn. That’s precisely why they sell the RPi400 and RPi with introductory books.

            It’s not the same audience that’ll by a RPi5 without a case or compute modules.

      • dan@upvote.au
        link
        fedilink
        arrow-up
        3
        ·
        edit-2
        9 months ago

        If you’re using a SATA SSD then you don’t even need an enclosure, just a cable like this StarTech USB 3.1 one: https://a.co/d/0fBSMs7

        The SSD is already in an enclosure (the case of the SSD), so placing it inside another enclosure is redundant…

        NVMe SSDs aren’t worth getting for the Pi 4 because it doesn’t have a PCIe bus, so you’ll only be getting USB speeds anyways. A SATA SSD is fine for that. Still aorund 4x faster than using an SD card.

  • makeasnek@lemmy.ml
    link
    fedilink
    English
    arrow-up
    5
    arrow-down
    1
    ·
    edit-2
    9 months ago

    Have you looked into nostr? It offers most of the same features of Mastodon except that:

    • Your identity is not tied to your instance. If your instance closes up shop, you keep all your followers, followees, DMs, etc
    • You can send encrypted DMs, so your instance admin can’t read them
    • Cool tipping functionality so you can tip people if you like their posts. Or don’t use it. It’s optional.
    • Most nostr clients have some built-in filtering functionality to block out things that are NSFW, crypto-related, etc. Different relays have different moderation policies, much like mastodon instances.

    You can run your own relay of course.

    • dan@upvote.au
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      9 months ago

      Your identity is not tied to your instance. If your instance closes up shop, you keep all your followers, followees, DMs, etc

      This is one of the major advantages Bluesky’s protocol (AT Protocol) has over ActivityPub. ActivityPub doesn’t have anything built-in to support this. On Bluesky, you can use your own domain name as your username, and freely move from one server to another while keeping the same username (once they open up federation). It’s configured through a DNS TXT record.

      • makeasnek@lemmy.ml
        link
        fedilink
        English
        arrow-up
        1
        ·
        edit-2
        9 months ago

        Still doesn’t beat nostr imo.

        Bluesky:

        • Identity not tied to instance
        • You have to buy and administer a domain name, which is technically complex and costs $10.
        • DNS is also subject to censorship by firewalls

        Nostr:

        • Identity is not tied to an instance
        • Your private keys (identity) are generated by your app. No purchase or administration required
        • Censorship is much more difficult
      • makeasnek@lemmy.ml
        link
        fedilink
        English
        arrow-up
        4
        ·
        edit-2
        9 months ago

        No, but some functionality could be bolted onto it for that purpose. But it is a federated network, just within it’s own protocol. Fediverse (Mastodon, Lemmy, Kbin, etc) run on an underlying protocol: ActivityPub, so they can all federate with each other within ActivityPub.

        Nostr runs on an underlying protocol also confusingly called nostr. Nostr’s main “interface” is a twitter clone, but the underlying protocol supports things like video streaming sites etc and some interfaces have been built for that purpose.

  • knfrmity@lemmygrad.ml
    link
    fedilink
    arrow-up
    3
    ·
    9 months 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
    link
    fedilink
    arrow-up
    3
    ·
    9 months 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
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    9 months 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.