ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Installing Mastodon 4.1.2 on Debian 11

    Scheduled Pinned Locked Moved IT Discussion
    mastodonlinuxinstalldebiandebian 11ruby
    17 Posts 6 Posters 1.6k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • scottalanmillerS
      scottalanmiller @RojoLoco
      last edited by

      @RojoLoco yup

      1 Reply Last reply Reply Quote 0
      • PhlipElderP
        PhlipElder @scottalanmiller
        last edited by

        @scottalanmiller said in Installing Mastodon 4.1.2 on Debian 11:

        Mostly this is taken from Mastodon's documentation but some of it is wrong. I tried their Docker configs, but couldn't find any that worked and it isn't clear if they have an official Docker image or just third party ones. They don't actually list Docker on their official site. So this is a traditional install.

        As root...

        apt update && apt install -y curl wget gnupg apt-transport-https lsb-release ca-certificates
        curl -sL https://deb.nodesource.com/setup_16.x | bash -
        curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee /usr/share/keyrings/yarnkey.gpg >/dev/null
        echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | tee /etc/apt/sources.list.d/yarn.list
        wget -O /usr/share/keyrings/postgresql.asc https://www.postgresql.org/media/keys/ACCC4CF8.asc
        echo "deb [signed-by=/usr/share/keyrings/postgresql.asc] http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/postgresql.list
        apt update && apt install -y imagemagick ffmpeg libpq-dev libxml2-dev libxslt1-dev file git-core \
          g++ libprotobuf-dev protobuf-compiler pkg-config nodejs gcc autoconf \
          bison build-essential libssl-dev libyaml-dev libreadline6-dev \
          zlib1g-dev libncurses5-dev libffi-dev libgdbm-dev \
          nginx redis-server redis-tools postgresql postgresql-contrib \
          certbot python3-certbot-nginx libidn11-dev libicu-dev libjemalloc-dev nodejs
        corepack enable && yarn set version classic
        adduser --disabled-login --gecos "" mastodon
        sudo -u postgres psql -c 'CREATE USER mastodon CREATEDB;'
        ufw allow http && ufw allow https
        

        As Mastodon

        su - mastodon
        git clone https://github.com/rbenv/rbenv.git ~/.rbenv && cd ~/.rbenv && src/configure && make -C src
        echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc && echo 'eval "$(rbenv init -)"' >> ~/.bashrc
        exec bash
        git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
        RUBY_CONFIGURE_OPTS=--with-jemalloc rbenv install 3.0.6
        rbenv global 3.0.6
        gem install bundler --no-document
        cd ~
        git clone https://github.com/mastodon/mastodon.git live && cd live
        git checkout $(git tag -l | grep -v 'rc[0-9]*$' | sort -V | tail -n 1)
        bundle config deployment 'true'
        bundle config without 'development test'
        bundle install -j$(getconf _NPROCESSORS_ONLN)
        yarn install --pure-lockfile
        RAILS_ENV=production bundle exec rake mastodon:setup
        npx update-browserslist-db@latest
        exit
        

        As root again...

        cp /home/mastodon/live/dist/nginx.conf /etc/nginx/sites-available/mastodon
        certbot --nginx -d  yourdomain.com
        ln -s /etc/nginx/sites-available/mastodon /etc/nginx/sites-enabled/mastodon
        vi /etc/nginx/sites-available/mastodon
        rm /etc/nginx/sites-enabled/default
        systemctl restart nginx
        cp /home/mastodon/live/dist/mastodon-*.service /etc/systemd/system/
        systemctl daemon-reload
        systemctl enable --now mastodon-web mastodon-sidekiq mastodon-streaming
        

        We install on Ubuntu and yeah, their documentation really sucks. There's lots of little tweaks that need to be done outside of what they have.

        I've not had the time to compile them into a How To as of yet as each successive install has needed to be tweaked so keeping a public facing How To is out of the question.

        scottalanmillerS 3 Replies Last reply Reply Quote 1
        • scottalanmillerS
          scottalanmiller @PhlipElder
          last edited by

          @PhlipElder said in Installing Mastodon 4.1.2 on Debian 11:

          We install on Ubuntu and yeah, their documentation really sucks. There's lots of little tweaks that need to be done outside of what they have.

          Current or LTS? I tried on current and there are some super recent breaking changes in the last few weeks that basically don't work on Ubuntu 23.04. I didn't try LTS because once doing that, I looked and Debian 11 felt like the better choice and it worked with a LOT fewer tweaks. At least Debian 11 is current, at the moment (but not for long, lol.)

          That Mastodon requires Ruby 3.0.6, what the heck. I couldn't get it to run on 3.0.4 with the latest Mastodon 4.1.2 and Ubuntu couldn't compile 3.0.6 successfully and it isn't available for it any other way and Mastodon isn't yet compatible with Ruby 3.1 or 3.2, which is even more ridiculous.

          ugh.

          PhlipElderP 1 Reply Last reply Reply Quote 0
          • scottalanmillerS
            scottalanmiller @PhlipElder
            last edited by

            @PhlipElder said in Installing Mastodon 4.1.2 on Debian 11:

            I've not had the time to compile them into a How To as of yet as each successive install has needed to be tweaked so keeping a public facing How To is out of the question.

            I think that the Mastodon team has had the same issue and just gave up, lol.

            PhlipElderP 1 Reply Last reply Reply Quote 0
            • scottalanmillerS
              scottalanmiller @PhlipElder
              last edited by

              @PhlipElder what are you using Mastodon for over there? Internal corporate use? Private group? Public server?

              This is a testing instance for us, but we hope to take it live soon and it is going to be public.

              PhlipElderP 1 Reply Last reply Reply Quote 1
              • PhlipElderP
                PhlipElder @scottalanmiller
                last edited by

                @scottalanmiller said in Installing Mastodon 4.1.2 on Debian 11:

                @PhlipElder said in Installing Mastodon 4.1.2 on Debian 11:

                We install on Ubuntu and yeah, their documentation really sucks. There's lots of little tweaks that need to be done outside of what they have.

                Current or LTS? I tried on current and there are some super recent breaking changes in the last few weeks that basically don't work on Ubuntu 23.04. I didn't try LTS because once doing that, I looked and Debian 11 felt like the better choice and it worked with a LOT fewer tweaks. At least Debian 11 is current, at the moment (but not for long, lol.)

                That Mastodon requires Ruby 3.0.6, what the heck. I couldn't get it to run on 3.0.4 with the latest Mastodon 4.1.2 and Ubuntu couldn't compile 3.0.6 successfully and it isn't available for it any other way and Mastodon isn't yet compatible with Ruby 3.1 or 3.2, which is even more ridiculous.

                ugh.

                We're on 20.04.x LTS and recently on 22.04.x LTS. Getting deployed on 22.04.x LTS required a bit of intervention via GitHub help request. But, we ended up figuring it out along with another poster on that GitHub thread.

                Mastodon is very particular about component versions. So, while we take the out of the box Ubuntu LTS version there's been times where we've tweaked the repository for a specific component version.

                scottalanmillerS 1 Reply Last reply Reply Quote 1
                • PhlipElderP
                  PhlipElder @scottalanmiller
                  last edited by

                  @scottalanmiller said in Installing Mastodon 4.1.2 on Debian 11:

                  @PhlipElder said in Installing Mastodon 4.1.2 on Debian 11:

                  I've not had the time to compile them into a How To as of yet as each successive install has needed to be tweaked so keeping a public facing How To is out of the question.

                  I think that the Mastodon team has had the same issue and just gave up, lol.

                  Yeah, their notes are based on Ubuntu 19.x LTS with some copy & paste to try and cover Ubuntu 20.x LTS. It took about half a dozen run throughs before we were confident we had a stable configuration. We host all of the instances in-house.

                  1 Reply Last reply Reply Quote 1
                  • scottalanmillerS
                    scottalanmiller @PhlipElder
                    last edited by

                    @PhlipElder said in Installing Mastodon 4.1.2 on Debian 11:

                    Mastodon is very particular about component versions. So, while we take the out of the box Ubuntu LTS version there's been times where we've tweaked the repository for a specific component version.

                    That's what I was suspecting. Debian felt like a few fewer "tweaking" components compared to Ubuntu with any semblance of being updated.

                    1 Reply Last reply Reply Quote 0
                    • PhlipElderP
                      PhlipElder @scottalanmiller
                      last edited by

                      @scottalanmiller said in Installing Mastodon 4.1.2 on Debian 11:

                      @PhlipElder what are you using Mastodon for over there? Internal corporate use? Private group? Public server?

                      This is a testing instance for us, but we hope to take it live soon and it is going to be public.

                      The instances we've set up are off the FediVerse for private corporate, political, or personal use.

                      There was some discussion of setting up for public consumption given the mass exodus after Musk bought Twitter but given the fickleness of tech peeps we didn't because everyone wants attention, so it was only a matter of time before they went back to the main public square that is Titter.

                      There are a few that have stuck it out with their own instance to build a personal community which is pretty neat, but there's no exposure that compares to Titter. None.

                      1 Reply Last reply Reply Quote 0
                      • 1
                        1337
                        last edited by 1337

                        This post is deleted!
                        1 Reply Last reply Reply Quote 0
                        • stacksofplatesS
                          stacksofplates @scottalanmiller
                          last edited by stacksofplates

                          @scottalanmiller said in Installing Mastodon 4.1.2 on Debian 11:

                          I tried their Docker configs, but couldn't find any that worked and it isn't clear if they have an official Docker image or just third party ones.

                          https://github.com/mastodon/chart

                          Their official image is here ghcr.io/mastodon/mastodon

                          scottalanmillerS 1 Reply Last reply Reply Quote 1
                          • scottalanmillerS
                            scottalanmiller @stacksofplates
                            last edited by

                            @stacksofplates said in Installing Mastodon 4.1.2 on Debian 11:

                            Their official image is here ghcr.io/mastodon/mastodon

                            Yeah, that one was flaky. But is it official? Why's it on a different account?

                            JaredBuschJ stacksofplatesS 3 Replies Last reply Reply Quote 0
                            • JaredBuschJ
                              JaredBusch @scottalanmiller
                              last edited by

                              @scottalanmiller said in Installing Mastodon 4.1.2 on Debian 11:

                              But is it official?
                              doens't get more official than on their github.
                              a3328e82-11dd-462d-b5ae-358707ac01bb-image.png

                              1 Reply Last reply Reply Quote 0
                              • JaredBuschJ
                                JaredBusch @scottalanmiller
                                last edited by JaredBusch

                                @scottalanmiller said in Installing Mastodon 4.1.2 on Debian 11:

                                Why's it on a different account?

                                Umm uh?

                                ghcr.io is github's packaging solution.
                                https://github.com/features/packages

                                1 Reply Last reply Reply Quote 1
                                • stacksofplatesS
                                  stacksofplates @scottalanmiller
                                  last edited by

                                  @scottalanmiller said in Installing Mastodon 4.1.2 on Debian 11:

                                  @stacksofplates said in Installing Mastodon 4.1.2 on Debian 11:

                                  Their official image is here ghcr.io/mastodon/mastodon

                                  Yeah, that one was flaky. But is it official? Why's it on a different account?

                                  Yes it's their official. Ghcr is the GitHub packages repo. It's similar to GCR, ECR, etc. Other OCI image repositories are more popular now since Docker has imposed limits on Docker Hub.

                                  1 Reply Last reply Reply Quote 0
                                  • 1 / 1
                                  • First post
                                    Last post