This testing was done with Pleroma 2.4.1, in environment Rocky Linux 8
(Before starting, be sure docker and docker-compose are installed, as well as git, and NGINX.)
Fetch and prepare the source code:
git clone -b stable --depth=10 "https://git.pleroma.social/pleroma/pleroma.git" && cd pleromagit fetch --depth=20 "https://git.lain.church/squeegily/pleroma.git" "feature/docker-compose":"feature/docker-compose" && git -c "user.name=Anonymous" -c "user.email=nobody@localhost" merge --no-commit "feature/docker-compose"read -p "Enter your domain name: " pleroma_domain
Build it:
mkdir -vp uploads && sudo chown -vR 911:911 config uploads && sudo chmod -v g+s config uploadstime docker-compose build
(takes about 6 mins on my 2-core VPS)
While you're waiting for it to build, prepare the NGINX reverse proxy:
(Skip this if you otherwise know how you're preparing the frontend)
sed "s/example.tld/${pleroma_domain:?pleroma_domain}/g" < installation/pleroma.nginx | sudo tee /etc/nginx/sites-available/pleromasudo ln -vs ../sites-available/pleroma /etc/nginx/sites-enabled/
Configure a TLS cert:
(Obviously, also skip this if you know you’re doing it otherwise)
sudo dnf install -y epel-release && sudo dnf install certbotsudo certbot certonly --standalone -d ${pleroma_domain:?pleroma_domain}sudo service nginx start- If you're going to be retrying these instructions from scratch multiple times, and don't want to get ratelimited by Let's Encrypt:
sudo tar c -vpPJf le.txz /etc/letsencrypt- Save that file somewhere
sudo tar x -vpPJf le.txz
Set it up:
firewall-cmd --add-port=5432/tcp --zone=docker && firewall-cmd --add-port=5432/tcp --zone=docker --permanent- NB: this kinda… just… doesn't work (even on latest releases of docker and docker-compose). The easiest workaround is to just disable firewalld [#9284] (and then reboot)
docker-compose run --rm web /opt/pleroma/bin/pleroma_ctl instance gen --force --domain "${pleroma_domain:?pleroma_domain}" --db-configurable y --dbhost db --dbname pleroma --dbuser pleroma --listen-ip 127.0.0.1 --listen-port 4000 --uploads-dir /var/lib/pleroma/uploads --static-dir /var/lib/pleroma/static --output-psql /var/lib/pleroma/config/setup_db.psql --output /var/lib/pleroma/config/secret.exsdocker-compose up db -d --waitdocker-compose exec -T db psql -U postgres < config/setup_db.psqldocker-compose run --rm web /opt/pleroma/bin/pleroma_ctl migratedocker-compose up web -d --waitdocker-compose exec web /opt/pleroma/bin/pleroma_ctl user new "lain" "webmaster@${pleroma_domain:?pleroma_domain}" --admin -y