User Tools

Site Tools


en:mastodon

This is an old revision of the document!


FIXME FIXME ~~

ATTENTION (09.02.2024): THIS TUTORIAL IS NOT YET FINISHED ATTENTION (09.02.2024): THIS TUTORIAL IS NOT YET FINISHED ATTENTION (09.02.2024): THIS TUTORIAL IS NOT YET FINISHED ATTENTION (09.02.2024): THIS TUTORIAL IS NOT YET FINISHED ATTENTION (09.02.2024): THIS TUTORIAL IS NOT YET FINISHED ATTENTION (09.02.2024): THIS TUTORIAL IS NOT YET FINISHED

Howto Install Mastodon:

Debian:

  • This will be a rapid and dirty Tutorial to gain the maximum afford.
  • I assume you use a fresh, not used System.

Installing Pre-Requirements

  • apt -qy update
    apt install -qy curl gnupg2 ca-certificates lsb-release debian-archive-keyring sudo git build-essentials

Adding Sources

  • sudo curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor | sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null
    sudo curl -fsSL https://deb.nodesource.com/setup_current.x | sudo -E bash -
    sudo install -m 0755 -d /etc/apt/keyrings
    sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
    sudo chmod a+r /etc/apt/keyrings/docker.asc
    sudo echo \
      "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
      $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
      sudo tee /etc/apt/sources.list.d/docker.list > /dev/null 
  • for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do sudo apt-get remove $pkg; done 
    sudo apt -qy update && apt -qy dist-upgrade  

Adding Debian Backports (optional)

  • sudo nano /etc/apt/source.list.d/backports
  • deb http://deb.debian.org/debian bookworm-backports main contrib non-free non-free-firmware
    deb-src http://deb.debian.org/debian bookworm-backports main contrib non-free non-free-firmware

Setup Mastodon: User and Repository Cloning

  •  sudo adduser mastodon 
  •  sudo adduser mastodon docker 
  •  sudo usermod -g mastodon www-data 
  •  sudo usermod -g www-data mastodon 
  •  sudo chmod 755 /home/mastodon 
  •  su - mastodon 
  •  git clone https://github.com/tootsuite/mastodon.git /home/mastodon/live 
  •  cp .env.production.sample .env.production 
  •  sed -i 's/\bBuild: \./#Build: ./gi' /home/mastodon/live/docker-compose.yml 

Setup Mastodon: .env.production

  • Short Info: don't edit the file, it will be overwritten by the next command.
  • Follow up the configuration Guide. You don't need to compile your own Stuff. REALLY NOT. Save the Time :-)
  • Trust me its a pain in the Backside and waste your time… ;-D
    •  docker-compose run --rm web bundle exec rake mastodon:setup 
  • Pre-Compile all Assets.
    •  docker-compose run --rm web rake assets:precompile 

Setup Mastodon: NGINX

  • We need to create and add some informations for NGINX to use it
  • Hint: If you need to use a other Reverse-Proxy in front of it, its untested and my not work
    •  sudo mkdir /var/www/letsencrypt 
    •  sudo cp /home/mastodon/live/dist/nginx.conf /etc/nginx/sites-available/mastodon 
    •  sudo ln -s /etc/nginx/sites-available/mastodon /etc/nginx/sites-enabled/mastodon 

Setup Mastodon: systemd

  • We Link the service-files to auto-update them
    •  sudo ln -s /home/mastodon/live/dist/mastodon-sidekiq.service /etc/systemd/system/mastodon-sidekiq.service 
    •  sudo ln -s /home/mastodon/live/dist/mastodon-streaming.service /etc/systemd/system/mastodon-streaming.service 
    •  sudo ln -s /home/mastodon/live/dist/mastodon-web.service /etc/systemd/system/mastodon-web.service 
  • We reload the systemd daemon
    •  sudo systemctl daemon-reload 
    •  sudo systemctl enable --now mastodon.service 
  • We Check if it was successfull:
    •  watch docker compose -f /opt/mastodon/docker-compose.yml ps
References:
en/mastodon.1707500675.txt.gz · Last modified: by domele