Easy Pleroma setup with Docker, mounting source code from host for easy modifications
docker-images | ||
.gitignore | ||
docker-compose.yml | ||
readme.md |
Pleroma Docker
Pleroma from-source installation in Docker with RUM indexing. Pleroma source code is mounted from host directory so you can easily modify it without rebuilding images.
Tip: Always install latest version of Docker! https://docs.docker.com/engine/install/
- Download repository and enter directory.
- Edit docker-compose.yml, set a secure db admin password, change ports if necessary
docker compose build
git clone https://git.pleroma.social/pleroma/pleroma.git -b stable
mkdir -p data/{static,uploads}; sudo chown -R 888:888 pleroma data/{static,uploads}
docker compose run --rm --no-deps pleroma mix deps.get
docker compose run --rm --no-deps pleroma mix pleroma.instance gen
- Use defaults for db
y
at RUM indices- Default
4000
for port - Listen on
0.0.0.0
! - Media uploads in
/uploads
- "Custom public files" in
/static
sudo mv pleroma/config/{generated_config.exs,prod.secret.exs}
sudo sed -i 's~hostname: "localhost"~socket_dir: "/run/postgresql/"~' pleroma/config/prod.secret.exs
docker compose up -d postgres
- Check if setup_db.sql ran successfully:
docker compose logs postgres
- Check if setup_db.sql ran successfully:
docker compose run --rm pleroma mix ecto.migrate
docker compose run --rm pleroma mix ecto.migrate --migrations-path priv/repo/optional_migrations/rum_indexing/
- If you wanted to store config in db:
docker compose run --rm pleroma mix pleroma.config migrate_to_db
docker compose up -d pleroma
- Check if running:
curl localhost:4000
- Check if running:
Now connect your reverse proxy. For Caddy (recommended):
pleroma.example {
reverse_proxy 127.0.0.1:4000
}
Plus separate media domain (recommended):
cdn.pleroma.example {
root * /srv/pleroma-docker/data/uploads
uri strip_prefix /media/ # if you kept this in the base url
file_server
}
Make sure caddy can read pleroma upload directory.
Once the website is working, create admin user: docker compose exec pleroma mix pleroma.user new admin admin@yourserver --admin
Optional
Create pleroma user on host system: sudo useradd -r -u 888 pleroma
Easier access to config: ln -s pleroma/config/prod.secret.exs