Run Pleroma with a pre-bundled Debian image.
Go through Docker's instructions for installing on your machine. If you want to use a different
machine that has Docker, you can run export DOCKER_HOST=ssh://user@host
to have your service run
remotely.
Create a password (with openssl or however you like) for your database.
echo "POSTGRES_PASSWORD=$(openssl rand -base64 16)" >> .env
Note If you're more comfortable with Nginx, please open a pull request with instructions on setting that, so I can have instructions for that up as well as Cloudflare.
- Sign up for Cloudflare and configure the DNS for your site with them.
- Set up a free Zero Trust service.
- Create a tunnel under
Access > Tunnels
. When you're asked to route traffic, set the public subdomain and hostname to anything you like and set the service tohttp://pleroma
.
Put the TUNNEL_TOKEN
in the .env
file.
# in your .env file, make a line like this.
TUNNEL_TOKEN=YOUR_TOKEN_VALUE
Generate the configuration files. Start by logging into the container. If you don't have the Docker images, they'll be downloaded automatically for you.
docker compose run --rm --entrypoint /bin/bash pleroma
Once inside the image, generate the Pleroma's configuration. You'll want to use the same domain/subdomain from the tunnel on this step.
/opt/pleroma/bin/pleroma_ctl instance gen \
--output /mount/config/config.exs \
--output-psql /mount/config/setup_db.psql \
--dbhost "$POSTGRES_HOST" \
--dbname "$POSTGRES_DB" \
--dbuser "$POSTGRES_USER" \
--dbpass "$POSTGRES_PASSWORD" \
--rum N \
--uploads-dir /mount/uploads \
--static-dir /mount/static \
--listen-ip 0.0.0.0 \
--listen-port 4000 \
--read-uploads-description Y \
--strip-uploads-location Y \
--dedupe-uploads N \
--anonymize-uploads Y
Still in the image, you'll want to generate the database.
psql -f /mount/config/setup_db.psql "postgres://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST:5432"
Finally, you'll want to run pending migrations. When you upgrade the base Pleroma image, you'll want to re-run this command.
/opt/pleroma/bin/pleroma_ctl migrate
Add yourself as an admin.
./bin/pleroma_ctl user new <nickname> <email> --admin --password <password>
Now you can start the service and begin receiving traffic!
docker compose up -d