This guide will assume you are on Debian Stretch. This guide should also work with Ubuntu 16.04 and 18.04. It also assumes that you have administrative rights, either as root or a user with sudo permissions. If you want to run this guide with root, ignore the sudo at the beginning of the lines, unless it calls a user like sudo -u pleroma; in this case, use su <username> -s $SHELL -c 'command' instead.
postgresql (9.6+, Ubuntu 16.04 comes with 9.5, you can get a newer version from here)
postgresql-contrib (9.6+, same situtation as above)
Note: To execute a single command as the Pleroma system user, use sudo -u pleroma command. You can also switch to a shell by using sudo -u pleroma $SHELL. If you don’t have and want sudo on your system, you can use su as root user (UID 0) for a single command by using su pleroma -s $SHELL -c 'command' and su pleroma -l -s $SHELL for starting a shell.
Git clone the PleromaBE repository and make the Pleroma user the owner of the directory:
Install the dependencies for Pleroma and answer with yes if it asks you to install Hex:
sudo-u pleroma mix deps.get
Generate the configuration: sudo -u pleroma mix pleroma.instance gen
Answer with yes if it asks you to install rebar3.
This may take some time, because parts of pleroma get compiled first.
After that it will ask you a few questions about your instance and generates a configuration file in config/generated_config.exs.
Check the configuration and if all looks right, rename it, so Pleroma will load it (prod.secret.exs for productive instance, dev.secret.exs for development instances):
The previous command creates also the file config/setup_db.psql, with which you can create the database:
sudo-u postgres psql -f config/setup_db.psql
Now run the database migration:
sudo-u pleroma MIX_ENV=prod mix ecto.migrate
Now you can start Pleroma already
sudo-u pleroma MIX_ENV=prod mix phx.server
If you want to open your newly installed instance to the world, you should run nginx or some other webserver/proxy in front of Pleroma and you should consider to create a systemd service file for Pleroma.
Install nginx, if not already done:
sudo apt install nginx
Setup your SSL cert, using your method of choice or certbot. If using certbot, first install it: