Build Your Own Mastodon Server on Debian (Step by Step Server Build Guide)

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ก.ค. 2024
  • There's way too much drama with Twitter nowadays, so the alternatives are looking more attractive than ever. Setting up your own Mastodon server is a fun project, and also a potential alternative to Twitter. In this video, Jay walks you through the entire process of setting up your own Mastodon server on a Debian-based VPS.
    Note: This video mentions a few regular sponsors (for example, Linode and CrowdSec) however no company has sponsored this video.
    LPI Linux Essentials Course Available
    Check out the new course on Udemy! ➜ learnlinux.link/lpi-course
    ➜ learnlinux.link/lpi-course
    Check out the Linux Shop
    In the official shop, you'll find Shirts, hats, stickers, bags and more!
    ➜ merch.learnlinux.tv
    5% discount on LPI exam vouchers
    After you finish Jay's new course, get 5% off an LPI exam voucher here:
    ➜ learnlinux.link/lpi-voucher
    Become a Patron
    Show your support for Learn Linux TV on Patreon and get access to exclusive perks!
    ➜ learnlinux.link/patron
    Become a Channel Member
    Show your support for Learn Linux TV here on TH-cam and get access to exclusive perks!
    ➜ learnlinux.link/member
    Mastering Ubuntu Server: 4th Edition
    Jay's latest book covers everything you need to know in order to master Ubuntu Server. It's available here:
    ➜ ubuntuserverbook.com
    Linux Gear and Kits
    Check out Jay's choice of hardware products, audio/video equipment, and more.
    ➜ learnlinux.link/amazon
    Grab an awesome Pi-powered KVM
    Support Learn Linux TV and grab yourself a TinyPilot KVM here:
    ➜ learnlinux.link/tinypilot
    Note: Royalties and/or commission is earned from each of the above links
    Time Codes
    00:00 - Intro
    01:40 - What do you need for this tutorial?
    06:13 - Building the cloud instance for Mastodon
    08:58 - Adding an "A record" in DNS to point to our Mastodon domain
    10:52 - Connecting to the server instance via ssh
    11:47 - General instance setup tweaks and recommended practices
    12:11 - Adding a non-root local user account
    12:51 - Enabling sudo access for our user account
    14:02 - Installing updates
    15:04 - Adding the domain name to the instance
    17:17 - Installing the required development packages for Mastodon
    20:08 - Creating the PostgreSQL database we'll be using for Mastodon
    23:27 - Creating a system user for Mastodon to run under
    24:02 - Downloading Mastodon from the git repository
    26:10 - Setting the ownership of the mastodon directory
    27:49 - Adding the mastodon directory to git's safe list
    29:48 - Installing the bundler gem, and adding additional settings
    31:09 - Running Mastodon's configuration script to adjust its settings
    36:06 - Installing Mastodon's service files
    38:28 - Setting up an NGINX reverse proxy for Mastodon
    42:10 - Adding a Let's Encrypt certificate to protect our Mastodon server
    46:39 - Setting up unattended upgrades
    48:53 - Installing CrowdSec to help protect our Mastodon instance
    Video Specific Links
    - Official blog post for this video ➜ www.learnlinux.tv/?p=2278
    The following were helpful articles for figuring out some of the missing commands I needed:
    - How to install Mastodon on Ubuntu 22.04/20.04 server ➜ www.linuxbabe.com/ubuntu/how-...
    - How to Install Mastodon Social Network on Ubuntu 22.04 ➜ www.howtoforge.com/how-to-ins...
    LEARN SOMETHING NEW
    - How to create a bootable flash drive for installing Linux ➜ linux.video/flash-usb
    - Understanding Linux permissions ➜ linux.video/perms
    - OpenSSH Guide ➜ linux.video/ssh
    - LVM Deep-dive ➜ linux.video/lvm
    - How to better secure OpenSSH ➜ linux.video/secure-ssh
    Official *Learn Linux TV on the Web*
    • Main site ➜ www.learnlinux.tv
    • Community ➜ community.learnlinux.tv
    Learn Linux TV provides technical content that will hopefully be helpful to you and teach you something new. However, this content is provided without any warranty (expressed or implied). Learn Linux TV is not responsible for any damages that may arise from any use of this content. The person viewing Learn Linux TV's content is expected to follow their best judgement and to make their best decisions while working with any related technology. Always make sure you have written permission before working with any infrastructure. Also, be sure that you're compliant with all company rules, change control procedures, and local laws.
    #debian #mastodon #twitter
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 104

  • @FederatedConsciousness
    @FederatedConsciousness ปีที่แล้ว +4

    I love that you're incorporating the meme image and the deadpan humor! Your videos are amazing and the touch of nerd humor is icing on an already delicious cake!

  • @GlowingTree
    @GlowingTree ปีที่แล้ว +1

    Thanks to your guidance, I successfully set up my own Mastodon instance! Your tutorial was by far the most helpful - detailed, clear, and easy to follow. I truly appreciate it! I also encountered some issues with node version conflicts but was able to resolve them smoothly with the help of ChatGPT-4.

  • @gastondalmedo9636
    @gastondalmedo9636 ปีที่แล้ว

    wow man finished setting all up and IT WORKS ! 😲
    Thx a ton

  • @joseph_donovan
    @joseph_donovan ปีที่แล้ว

    Made my ear lobes tingle with delight. Thank you!

  • @averagemamil4523
    @averagemamil4523 ปีที่แล้ว +2

    Brilliant & informative - thanks Jay 👏

  • @guidodipilla3084
    @guidodipilla3084 ปีที่แล้ว

    Very informative as always... Thanks Jay...

  • @chriskairalla1854
    @chriskairalla1854 ปีที่แล้ว +1

    This worked great, thanks for the straightforward instruction in the video and on the blog. Two things that I had to fix in order to get everything working: 1. I had to install imagemagick for image uploading, and 2. I had to downgrade NodeJS to 16.x. I accidentally installed the latest version which was 18.x and that caused some compilation issues. Once I downgraded to 16.x it worked great.

    • @bagwaa9948
      @bagwaa9948 ปีที่แล้ว +1

      thanks for this! I had figured out the node issue but the imagemagick issue was driving me nuts as I couldn't see any logs for these errors

  • @mohammedfarisi
    @mohammedfarisi ปีที่แล้ว

    Excellent content.
    Thank you.

  • @TheGeekYT
    @TheGeekYT ปีที่แล้ว

    Thanks for this extensive tutorial

  • @ArniesTech
    @ArniesTech ปีที่แล้ว +1

    Now THAT would be the perfect transition to your sponsor Linode 💪😁

    • @LearnLinuxTV
      @LearnLinuxTV  ปีที่แล้ว

      I thought about having them sponsor it since I was using them anyway, but I completely forgot about it.

  • @nobloat5702
    @nobloat5702 ปีที่แล้ว

    Wow thank you for this!

    • @LearnLinuxTV
      @LearnLinuxTV  ปีที่แล้ว +1

      My pleasure. Literally, this was super fun!

  • @montunoproductions2848
    @montunoproductions2848 ปีที่แล้ว

    Thanks!

  • @juhapenttila5733
    @juhapenttila5733 ปีที่แล้ว

    It is so easy,it seems , when you do it 😊,awesome!

    • @LearnLinuxTV
      @LearnLinuxTV  ปีที่แล้ว +2

      When this video came out, you're actually seeing like the 7th attempt or so.

  • @rodrimora
    @rodrimora ปีที่แล้ว +1

    How would you go about updating the mastodon version? would the unattended upgrades just take care of it?

  • @thekillerb77
    @thekillerb77 ปีที่แล้ว +2

    Nice video. Thank you! Would be cool to see how to set this up with docker.

    • @LearnLinuxTV
      @LearnLinuxTV  ปีที่แล้ว +3

      I'm thinking about looking into that too. Sometimes solutions like docker can be TOO easy, but it still might make for an alternative video possibly.

  • @sandermann
    @sandermann ปีที่แล้ว

    Supercool, thx, subscription...done

  • @seanlopez3968
    @seanlopez3968 ปีที่แล้ว +2

    Love the video as always. Just a heads up that Mastodon v4.0.2 requires a newer version of node than is provided by Debian 11 currently. Debian 11 currently uses node 12, while the official mastodon documentation is saying node 16. I can also confirm latest stable node, node 18, also does not work, so the sweet spot is definitely node 16.

    • @twincitiespcmd
      @twincitiespcmd ปีที่แล้ว +2

      What is the command for installing node 16?

  • @F1re4fect
    @F1re4fect ปีที่แล้ว

    My server is up and running, however I'm not getting Federated messages to show up? Any one else have this issue? Or did your external federated posts work immediately after setup?

  • @x91w
    @x91w ปีที่แล้ว +2

    Jay
    Thanks. For this.

    • @LearnLinuxTV
      @LearnLinuxTV  ปีที่แล้ว

      Yes, yes, yes. Super excited to do that actually. It's been on the list for a while (not specific to Mastodon) but other projects keep getting in the way. I am hoping to be caught up very soon, I would definitely like to knock those out. I think it's the most fun video I could ever work on.

  • @alexwhite3271
    @alexwhite3271 ปีที่แล้ว +1

    I ran into an issue with nodejs with the newest version of Mastodon. I updated to newest but that isn't supported either so had to downgrade it an earlier version.
    I was playing with a cloudron setup but was ready to setup an instance by itself.

  • @PhilReynoldsLondonGeek
    @PhilReynoldsLondonGeek 11 หลายเดือนก่อน

    You have hit on the very problem I'm having. I really need to get Mastodon working on Debian 12, but I think the OpenSSL issue applies - or there's certainly something too new for compatibility. I am trying to use a Debian 11 VM in the meantime, but it is not provig reliable.

  • @gaffa65
    @gaffa65 ปีที่แล้ว

    Takk!

  • @peterjansen4826
    @peterjansen4826 ปีที่แล้ว

    Topic suggestion: make your own VPN-server. Find a good server to hire, install Linux on it and use it as a VPN. I think that this might be a great project for many of us and we can share this VPN with friends and familymembers.

  • @Saampson85
    @Saampson85 ปีที่แล้ว

    Looking to increase the posting from 4, I am having a hard time tracking down that info. Is that something you came across while making this video?

  • @baltakatei
    @baltakatei 29 วันที่ผ่านมา

    It would be interesting to see bandwidth costs after the Mastodon has been up for a year.

  • @rayk32
    @rayk32 ปีที่แล้ว

    This would've been fun, but I followed the instructions multiple times and the Mastodon site does not come up in the browser. It's a blank page with the Mastodon "M" as the browser tab title. The problem with no full install package with all the compatible software included. I think there is a Docker Compose version.

  • @vanvothe4817
    @vanvothe4817 ปีที่แล้ว

    Which distro linux do you use on your laptop?

  • @JasonRundell
    @JasonRundell ปีที่แล้ว

    Also, a shared Linode Nanode 1 GB server is not large enough (in RAM I suspect) to compile the mastodon files (mastodon:setup) I didn't try Linode 2 GB, but Linode 4 GB dedicated worked.

  • @laideapril7416
    @laideapril7416 ปีที่แล้ว

    Thank you Jay!
    I followed everything to the latter and you made it look so easy!
    I need help at the SMTP server.
    And my question is, does it have to be mail from the domain I'm using?
    Or I can use an email from another domain.
    Thank you

    • @LearnLinuxTV
      @LearnLinuxTV  ปีที่แล้ว +1

      It doesn’t matter if the domain matches, unless the SMTP server itself has restrictions.

  • @twincitiespcmd
    @twincitiespcmd ปีที่แล้ว

    I am getting the following error during the email setup: E-mail could not be sent with this configuration, try again.
    535 5.7.8 Error: authentication failed: authentication failure. I host my own email server so I am pretty sure I have the right settings. Is there a upgrade or downgrade to the instructions that can help me out on this error?

  • @alanjrobertson
    @alanjrobertson ปีที่แล้ว

    Nice video, but wouldn't this also work really nicely with Docker given how many different services need setup? Nginx Proxy Manager also makes it incredibly easy to setup reverse proxies.

  • @S1lentJoy
    @S1lentJoy ปีที่แล้ว

    Jay, many security issues, you dont turn off "root" login? you should probably also only allow certs login

  • @AcidiFy574
    @AcidiFy574 ปีที่แล้ว

    Ever wanted to do a tutorial on basics of using VS-Codium ???

  • @chicagoa1432
    @chicagoa1432 5 หลายเดือนก่อน

    Great tutorial very easy to understand but unfortunately I tried to do the same step by step it looks like this method is not working anymore after Mastodon update that changed the ruby version and I have been getting error, could you make an updated tutorial I will be much appreciated 👍🏻👍🏻

  • @Dmkjr
    @Dmkjr ปีที่แล้ว

    Jay, I've done this several times, but I'm getting stuck on setting up NPM with Mastodon. I've tried both http and http ports for the reverse proxy, but it's not functioning. It just routes to the NGINX default config screen. Any ideas?

    • @MarkMenger
      @MarkMenger ปีที่แล้ว +1

      since the NGINX config part of the example uses hostname-based routing, you may encounter this issue if you're trying to access the service using your server's IP address rather than the name in the 'server_name' directive. a quick fix can be to add an appropriate entry in your local hosts file.

  • @jeffreyschlieve590
    @jeffreyschlieve590 ปีที่แล้ว

    I used Cloudron to install, worked pretty good, BUT no one was able to join it? any ideas what went wrong?

  • @JasonRundell
    @JasonRundell ปีที่แล้ว

    Node version 16 is required for compiling the mastodon files (mastodon:setup)

  • @laideapril7416
    @laideapril7416 ปีที่แล้ว

    Hi Jay,
    Thank you for this great video.
    Currently, Linode has Mastodon in its marketplace.
    I did direct installation from there when I visit my ip address I got the response you got (Nginx) at Time 39:00
    I used a sub domain, but visiting the site I still can't access mastodon.
    What would you suggest I do.

    • @NyneIX9
      @NyneIX9 ปีที่แล้ว +1

      Did you ever figure it out?

    • @laideapril7416
      @laideapril7416 ปีที่แล้ว

      @@NyneIX9 not exactly. I used Digital Ocean instead

  • @candidob8683
    @candidob8683 ปีที่แล้ว +1

    I actually thought twitter went bonkers years ago lol. Mastodon is just one option. There are others. Always great to have options.

    • @NyneIX9
      @NyneIX9 ปีที่แล้ว +1

      Hi! What are the other options, if you don't mind me asking?

  • @darthmaster6938
    @darthmaster6938 ปีที่แล้ว

    Where do we find additional security information to add to the server ?

    • @LearnLinuxTV
      @LearnLinuxTV  ปีที่แล้ว

      Basically just the other videos I have on the channel. There's a few that will cover this, so that should point you in the right direction.

  • @myegane49
    @myegane49 ปีที่แล้ว

    the only good video around that news so far.

  • @ZacharyFreed
    @ZacharyFreed ปีที่แล้ว

    I am Getting a HTTP ERROR 500 any advice?

  • @aditya-the918blog
    @aditya-the918blog ปีที่แล้ว

    Hi, I followed your tutorial but keep getting HTTP ERROR 500, I was able to see the NGINX configuration place holder but after the remaining steps I don't see my mastodon installation what would you advice me to do?
    My dns is propagated

    • @aditya-the918blog
      @aditya-the918blog ปีที่แล้ว

      seems to be an SSL issue, can you guide what can be done?

    • @christian.mathis
      @christian.mathis ปีที่แล้ว

      did you solve it? That happens to me too.

    • @aditya-the918blog
      @aditya-the918blog ปีที่แล้ว

      @@christian.mathis I completely chucked this video method and just followed the official documentation process, much easier and quicker result. From this video you can actually pick up a few things, like usermod, not installing in root folder(but i think official documentation does it in home, I dont know if they are the same folder structure) ya but faster and better

  • @faanross
    @faanross ปีที่แล้ว +12

    Apart from all the media meltdowns the experience on Twitter is completely unaffected - still the same toxic hellhole it's been for years now. Something tells me the issue is a little deeper than "new CEO bad man".

    • @rrittenhouse
      @rrittenhouse ปีที่แล้ว +2

      I and many others have had "this tweet is unavailable" that come and go with a refresh. While that's not enough to warrant leaving a platform, some people are using this as an exercise to see what this mastodon thing is. We don't know if Twitter is going away. I personally don't think it'll ever go completely away but it will change. Even if it's an under construction page 🤣

    • @AcidiFy574
      @AcidiFy574 ปีที่แล้ว +3

      Elon & Twitter is made for each other

    • @basdfgwe
      @basdfgwe ปีที่แล้ว

      There's a couple of issues, there are some technical issues( which is not huge but still annoying). There's now the Twitter blue, Twitter blue comments are taken priority over other Twitter comments by

    • @the-random1
      @the-random1 ปีที่แล้ว +1

      This aged poorly

    • @muzikmyke3008
      @muzikmyke3008 4 หลายเดือนก่อน

      @@the-random1 How? Twitter is just fine, if not better. Imagine not liking something all of a sudden because the media tells you not to. What a lil bxtch.

  • @BlaecHrim
    @BlaecHrim ปีที่แล้ว

    hostnamectl set-hostname works also

    • @LearnLinuxTV
      @LearnLinuxTV  ปีที่แล้ว

      It does, kinda. It's not thorough and that command only does half the job. On some distributions I've seen it not even alter the proper file at all. But another hesitation with showing that in videos is that it doesn't update /etc/hosts, so I figure if you have to use a text editor for that, you may as well for the other. Still a good mention on your end, thanks!

  • @darthmaster6938
    @darthmaster6938 ปีที่แล้ว

    Sorry I havent started watching the video yet but will watch it all. My question is can you run multiple Mastodon instances on 1 VM ? Ignore if answered in the video thanks.

    • @LearnLinuxTV
      @LearnLinuxTV  ปีที่แล้ว

      Actually, I don't know the answer to that. If you had two different domains and databases, and kept everything in separate places, and also the instance had enough resources for both - then I struggle to think of any reason you couldn't.

    • @anirbandutta1371
      @anirbandutta1371 ปีที่แล้ว

      You can always dockerize

  • @hotstovejer
    @hotstovejer ปีที่แล้ว +1

    I literally went down the federated services rabbit hole last night. Use that bandwidth!

  • @TestingAnything
    @TestingAnything ปีที่แล้ว

    Thanks for this - I followed the process and all looked good except for some reason the assets (in var/www/mastodon/system) didn't precompile. After a bit of uninstalling yarn and a couple of Ruby libraries to get versions that worked I got the assets in the directories. Then it looked great. I had to install imagemagick as it was missing. But now I can't upload media to toots - I get a "500 Error processing thumbnail for uploaded media". I've searched Google extensively and can't find a solution. I reinstalled imagemagick from source - but no luck. Is there a definitive software version list out there that I could compare with my set up? Maybe something got upgraded or downgraded and that's the problem? Or is there a directory missing from my setup? There's nothing in the logs (journalctl etc.)
    Been trying for days to resolve this. My head hurts from scratching. Any ideas anyone?

    • @TestingAnything
      @TestingAnything ปีที่แล้ว

      Well scratch all that. In desperation, I uninstalled it from source *and* apt. I had ImageMagick installed both ways apparently. Then I installed via apt. And bingo! It worked. So it looks like installing from source is a no-no or at least installing both ways?)

  • @infocus-media
    @infocus-media ปีที่แล้ว

    Man you have changed, I can't put my finger on it!!!, do you look younger, or older!, I am not sure!

  • @myegane49
    @myegane49 ปีที่แล้ว +2

    could we have similar tutorials on Peertube, XMPP, Matrix, Jitsi, Searx and Openvpn please?

    • @LearnLinuxTV
      @LearnLinuxTV  ปีที่แล้ว +2

      Short answer: Yes. Long answer: My content schedule is pretty much set in stone until the end of December, but after that I'm already planning on doing more setup videos. And a few of those you mentioned are on the list already. Great stuff coming!

  • @dollarbar1
    @dollarbar1 7 หลายเดือนก่อน

    Uh oh. Noob here. Having ruby version troubles. Heard they're notorious for noobs. Just went full circle with ruby version and rbenv not using local version installed specified in Gemfile.

    • @dollarbar1
      @dollarbar1 7 หลายเดือนก่อน +1

      After going full circle and becoming an amateur ruby user after 2 days, I just changed the config in the Gemfile. Call it good.

  • @whoismikeyuk
    @whoismikeyuk ปีที่แล้ว

    [joining server in...]

  • @kote315
    @kote315 ปีที่แล้ว +2

    I want Elon Musk to try to buy TH-cam, so that bloggers like you will release a video on installing PeerTube.
    In fact, I just don’t fully understand how to run several services at the same time, on one physical server, so that they don’t interfere with each other, there are no problems with certificates, and there is access both from the local network and from outside (there are nuances with DNS).

  • @stephenrochester6309
    @stephenrochester6309 ปีที่แล้ว

    This video is 7 days old. Following the instructions to the letter will NOT work. This is how fast technology moves in reality. Now I am trying to figure out if nginx needs something or I need to switch to a particular version of node… it’s late and I am tired!

  • @TroyBrisbin67
    @TroyBrisbin67 ปีที่แล้ว

    LOL. Mastodon. Sounds pretty extreme to me.

    • @LearnLinuxTV
      @LearnLinuxTV  ปีที่แล้ว +1

      They are, they were known to grow very large when they walked the Earth. Fossil evidence is teaching us some interesting things.

  • @jimbrea200
    @jimbrea200 10 หลายเดือนก่อน

    you are very good in your tutorials BUT YOU HAVE A SERIOUS PROBLEM SOME PEOPLE DO NOT LIKE TO USE MANY COMMANDS AND USE VIRTUAL WEBMIN OTHERS USE OTHERS ETC, be more modern in your tutorials please

  • @DerGedankenleser
    @DerGedankenleser ปีที่แล้ว

    Step by Step >>> "I leave this up to you" ... 200 million sperm and THIS DUDE WON????

  • @mycommodorecollection
    @mycommodorecollection ปีที่แล้ว +3

    Yea, can’t have that free speech going on. smh

  • @_den_
    @_den_ ปีที่แล้ว +3

    Twitter has been developing for almost 15 years, and you propose to change it to this unknown crap? Bon Voyage )

    • @hotstovejer
      @hotstovejer ปีที่แล้ว +5

      Everything was "unknown" at some point.

    • @Grant_S_M
      @Grant_S_M ปีที่แล้ว

      Twitter is fascist-owned now. Time to leave.

    • @jasonbaldini
      @jasonbaldini ปีที่แล้ว +1

      Twitter was commie and now it’s not.
      Elon by far is no right wing only idiots think that. He’s a typical billionaire leftie that just says what he thinks.
      I think the point isn’t slamming mastodon but instead “why now”?
      Why does Twitter suck now? Answer is that it doesn’t, evil people are held accountable no matter what side they’re on so I’m looking forward to using Twitter.
      Setting up some cool open source software is great too, for experience.

    • @Grant_S_M
      @Grant_S_M ปีที่แล้ว

      @@jasonbaldini Musk is a RW scumbag. He told people to vote for Rs and worships Putin. Use your head.

    • @Grant_S_M
      @Grant_S_M ปีที่แล้ว

      @@paddymurphy-oconnor8255 Twitter protects fascists and billionaire mobsters. Always has. Now it's 1000X worse because one of them owns it.

  • @FinderX
    @FinderX ปีที่แล้ว

    I create a user in the server learnlinux.socia, but today can't singup (login) with my user and pass... I don't know, maybe Jay is testing something...

  • @ntn888
    @ntn888 ปีที่แล้ว

    just a heads-up; oracle's OCI has free 4vcore/24Gig ram VMs instances which is free for this purpose. lookup "VM.Standard.A1.Flex"