The official Mastodon installation guides are all made for Debian-based distros, so here’s a handy production-ready install for CentOS/RHEL (based on nginx):
- Enable the NUX repo, so that we can install ffmpeg:
- sudo rpm –import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
- sudo rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm
- Use yum to install these packages: ImageMagick libpqxx-devel libxml2-devel libxslt-devel nodejs ffmpeg file git curl postgresql postgresql-contrib postgresql-server redis gcc gcc-c++ bzip2 openssl-devel readline-devel
- sudo npm install -g yarn
- Create a user to run the app:
- sudo useradd -d /home/mastodon -m -s /bin/bash -U mastodon
- Configure Postgres to start at boot and start the service:
- sudo systemctl enable postgresql
- sudo postgresql-setup initdb
- sudo systemctl start postgresql
- Create a PGSQL database user:
- sudo su – postgres; psql
- CREATE USER mastodon CREATEDB;
- \q
- Follow the guides to install rbenv and rbenv-build for the mastodon user
- Once rbenv is ready, run `rbenv install 2.3.1` as the mastodon user
- Install mastodon (sudo as mastodon user):
- cd ~
git clone https://github.com/tootsuite/mastodon.git live
cd live
gem install bundler
bundle install –deployment –without development test
yarn install
- cd ~
- Follow the rest of the guide for configuration at Mastodon’s repo, starting from the “Configuration” step
- Disable the user mastodon from logging in:
- sudo chsh -s /sbin/nologin mastodon
Tags: centos, mastodon, social media
This entry was posted
on Wednesday, April 5th, 2017 at 11:23 pm and is filed under General.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.
Leave a reply