myhelp:mastodon
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| myhelp:mastodon [2024/03/20 09:46] – ulrich | myhelp:mastodon [2026/01/19 09:57] (current) – [Install Mastodon v4.5.4 on Rocky Linux 10] ulrich | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| I used the instructions from [[https:// | I used the instructions from [[https:// | ||
| - | ====== Install Mastodon on Rocky Linux 8 ====== | + | |
| + | ====== Install Mastodon | ||
| + | Enable repos: remi, rpmfusion, epel | ||
| + | < | ||
| + | dnf install --nogpgcheck https:// | ||
| + | / | ||
| + | dnf install --nogpgcheck https:// | ||
| + | yum install -y https:// | ||
| + | </ | ||
| + | |||
| + | Install additional RPMS as root: | ||
| + | nodejs, valkey (instead of redis), | ||
| + | < | ||
| + | yum install -y bison ca-certificates certbot.noarch ffmpeg.x86_64 file gdbm-devel git ImageMagick.x86_64 iotop jemalloc-devel.x86_64 jemalloc.x86_64 gcc gcc-c++ libffi-devel libicu-devel libidn-devel libxslt-devel.x86_64 libxslt.x86_64 libyaml-devel make ncurses-devel net-tools nodejs24.x86_64 npm postgresql-devel protobuf-c-compiler.x86_64 python3-certbot-nginx.noarch readline-devel.x86_64 readline.x86_64 valkey.x86_64 vips vips-devel | ||
| + | </ | ||
| + | |||
| + | Add user mastodon as root | ||
| + | < | ||
| + | mkdir / | ||
| + | useradd -d / | ||
| + | chown -R mastodon: | ||
| + | </ | ||
| + | |||
| + | Prepare the DB | ||
| + | < | ||
| + | postgres=# CREATE USER mastodon CREATEDB; | ||
| + | postgres=# \q | ||
| + | </ | ||
| + | |||
| + | Install ruby as user mastodon | ||
| + | < | ||
| + | git clone https:// | ||
| + | echo ' | ||
| + | echo 'eval " | ||
| + | source ~/.bashrc | ||
| + | git clone https:// | ||
| + | </ | ||
| + | |||
| + | Checkout mastodon code as user mastodon | ||
| + | < | ||
| + | git clone https:// | ||
| + | git checkout $(git tag -l | grep ' | ||
| + | </ | ||
| + | |||
| + | Install Ruby as user mastodon | ||
| + | < | ||
| + | RUBY_CONFIGURE_OPTS=--with-jemalloc rbenv install | ||
| + | </ | ||
| + | |||
| + | Install Ruby dependencies as user mastodon | ||
| + | < | ||
| + | bundle config deployment ' | ||
| + | bundle config without ' | ||
| + | bundle install | ||
| + | </ | ||
| + | |||
| + | Fix some nodejs stuff as root | ||
| + | < | ||
| + | npm install -g yarn | ||
| + | rm -f / | ||
| + | rm -f / | ||
| + | npm install -g corepack | ||
| + | </ | ||
| + | |||
| + | Install nodejs dependencies as user mastodon | ||
| + | < | ||
| + | corepack enable | ||
| + | corepack prepare yarn@4.12.0 --activate | ||
| + | yarn install | ||
| + | </ | ||
| + | ====== Install Mastodon on Rocky Linux 9 ====== | ||
| ===== Pre-requisites ===== | ===== Pre-requisites ===== | ||
| Enable EPEL is a good idea | Enable EPEL is a good idea | ||
| Line 12: | Line 82: | ||
| < | < | ||
| curl --silent --location https:// | curl --silent --location https:// | ||
| - | </ | ||
| - | |||
| - | After a fresh installation, | ||
| - | < | ||
| - | yum module enable ruby:3.0 -y | ||
| - | yum module enable nodejs:12 -y | ||
| - | yum module enable postgresql: | ||
| </ | </ | ||
| Line 26: | Line 89: | ||
| | | ||
| | | ||
| - | | + | |
| | | ||
| - | | + | |
| | | ||
| </ | </ | ||
| Line 38: | Line 101: | ||
| usermod -d / | usermod -d / | ||
| </ | </ | ||
| + | |||
| + | Start redis | ||
| + | < | ||
| ===== Preparing the DB ===== | ===== Preparing the DB ===== | ||
| Line 73: | Line 139: | ||
| RAILS_ENV=production bundle exec rake mastodon: | RAILS_ENV=production bundle exec rake mastodon: | ||
| </ | </ | ||
| + | |||
| ===== Setting up nginx ===== | ===== Setting up nginx ===== | ||
| Line 103: | Line 170: | ||
| < | < | ||
| sed -i ' | sed -i ' | ||
| - | sed -i ' | + | sed -i ' |
| </ | </ | ||
| Line 112: | Line 179: | ||
| </ | </ | ||
| - | ====== Update Mastodon to 4.0.* ====== | ||
| - | That is just a how-to which worked for me. Do a Backup in advance! | ||
| - | ===== Pre-requisites ===== | ||
| - | Backup everything! You do not want to stay up half of the night and fix something. | ||
| - | With the update to the version 4.0 you need a nodejs 14 and also edit some path in the system files. | + | Maybe something went wrong with the install of the bundler gem and the services are not starting. Check if the gem is installed or just install it. |
| - | Update nodejs: | + | |
| < | < | ||
| - | yum module reset nodejs | + | # su - mastodon |
| - | yum module enable nodejs:14 | + | cd live/ |
| - | yum -y update | + | RAILS_ENV=production |
| </ | </ | ||
| - | Edit the path for bundle: | ||
| - | < | ||
| - | sed -i ' | ||
| - | </ | ||
| - | That is necessary, because in my installation I changed it before. | ||
| - | ===== the REAL update ===== | ||
| - | Here I just followed the manual from [[https:// | ||
| - | This can take some minutes: | ||
| - | < | ||
| - | su - mastodon | ||
| - | cd live | ||
| - | git fetch && git checkout v4.0.0 | ||
| - | bundle install | ||
| - | yarn install | ||
| - | </ | ||
| - | |||
| - | Also this take some minutes | ||
| - | < | ||
| - | SKIP_POST_DEPLOYMENT_MIGRATIONS=true RAILS_ENV=production bundle exec rails db:migrate | ||
| - | RAILS_ENV=production bundle exec rails assets: | ||
| - | sudo systemctl restart mastodon-* | ||
| - | RAILS_ENV=production bundle exec rails db:migrate | ||
| - | sudo systemctl restart mastodon-* | ||
| - | </ | ||
| - | |||
| - | |||
| - | ===== Update to 4.0.2 ===== | ||
| - | < | ||
| - | su - mastodon | ||
| - | cd live | ||
| - | git fetch && git checkout v4.0.2 | ||
| - | bundle install | ||
| - | RAILS_ENV=production bundle exec rails assets: | ||
| - | sudo systemctl restart mastodon-* | ||
| - | </ | ||
| - | YEAH! Welcome to the new version. | ||
| ====== Tuning ====== | ====== Tuning ====== | ||
| Line 166: | Line 192: | ||
| sidekiq is handling multiple queues. Each of them can run as an own process. Per process you should use a max. of 25 threads. | sidekiq is handling multiple queues. Each of them can run as an own process. Per process you should use a max. of 25 threads. | ||
| - | I used the instructions from [[https:// | + | ====== OLD HOW TO ====== |
| - | + | ===== Install Mastodon on Rocky Linux 8 ===== | |
| - | ====== Install Mastodon on Rocky Linux 9 ====== | + | ==== Pre-requisites ==== |
| - | ===== Pre-requisites | + | |
| Enable EPEL is a good idea | Enable EPEL is a good idea | ||
| < | < | ||
| Line 179: | Line 204: | ||
| < | < | ||
| curl --silent --location https:// | curl --silent --location https:// | ||
| + | </ | ||
| + | |||
| + | After a fresh installation, | ||
| + | < | ||
| + | yum module enable ruby:3.0 -y | ||
| + | yum module enable nodejs:12 -y | ||
| + | yum module enable postgresql: | ||
| </ | </ | ||
| Line 186: | Line 218: | ||
| | | ||
| | | ||
| - | | + | |
| | | ||
| - | | + | |
| | | ||
| </ | </ | ||
| Line 199: | Line 231: | ||
| </ | </ | ||
| - | Start redis | + | ==== Preparing the DB ==== |
| - | < | + | |
| - | + | ||
| - | ===== Preparing the DB ===== | + | |
| < | < | ||
| systemctl start postgresql.service | systemctl start postgresql.service | ||
| Line 213: | Line 242: | ||
| </ | </ | ||
| - | ===== Setting up Mastodon | + | ==== Setting up Mastodon ==== |
| < | < | ||
| su - mastodon | su - mastodon | ||
| Line 237: | Line 266: | ||
| </ | </ | ||
| - | ===== Setting up nginx ===== | + | ==== Setting up nginx ==== |
| Copy the prepared nginx.conf into the nginxc config-dir. Change the hostname and the root-dir. | Copy the prepared nginx.conf into the nginxc config-dir. Change the hostname and the root-dir. | ||
| < | < | ||
| Line 257: | Line 286: | ||
| </ | </ | ||
| - | ===== Setting up systemd services | + | ==== Setting up systemd services ==== |
| copy the files | copy the files | ||
| < | < | ||
| Line 266: | Line 295: | ||
| < | < | ||
| sed -i ' | sed -i ' | ||
| - | sed -i ' | + | sed -i ' |
| </ | </ | ||
| Line 275: | Line 304: | ||
| </ | </ | ||
| - | ====== Update Mastodon to 4.0.* ====== | + | |
| + | ===== Update Mastodon to 4.0.* ===== | ||
| That is just a how-to which worked for me. Do a Backup in advance! | That is just a how-to which worked for me. Do a Backup in advance! | ||
| - | ===== Pre-requisites | + | ==== Pre-requisites ==== |
| Backup everything! You do not want to stay up half of the night and fix something. | Backup everything! You do not want to stay up half of the night and fix something. | ||
| Line 292: | Line 322: | ||
| </ | </ | ||
| That is necessary, because in my installation I changed it before. | That is necessary, because in my installation I changed it before. | ||
| - | ===== the REAL update | + | ==== the REAL update ==== |
| Here I just followed the manual from [[https:// | Here I just followed the manual from [[https:// | ||
| Line 314: | Line 344: | ||
| - | ===== Update to 4.0.2 ===== | + | ==== Update to 4.0.2 ==== |
| < | < | ||
| su - mastodon | su - mastodon | ||
| Line 325: | Line 355: | ||
| YEAH! Welcome to the new version. | YEAH! Welcome to the new version. | ||
| - | ====== Tuning | + | ===== Tuning ===== |
| - | ===== Start tuning sidekiq | + | ==== Start tuning sidekiq ==== |
| sidekiq is handling multiple queues. Each of them can run as an own process. Per process you should use a max. of 25 threads. | sidekiq is handling multiple queues. Each of them can run as an own process. Per process you should use a max. of 25 threads. | ||
| {{tag> | {{tag> | ||
myhelp/mastodon.1710928010.txt.gz · Last modified: by ulrich
