Pleroma requires some adjustments from the defaults for running the instance locally. The following should help you to get started.
## Forking
To upstream code, you make an account on git.pleroma.social if you don't already have one and fork the project in the webinterface to your own namespace.
## Installing
-1. Install Pleroma as explained in the docs: https://docs-develop.pleroma.social/backend/installation/debian_based_en/ but with some exceptions:
+1. Install Pleroma as explained in [the docs](../installation/debian_based.md), with some exceptions:
* Use your own repository instead of pleroma's and add pleroma as a remote `git remote add pleroma 'https://git.pleroma.social/pleroma/pleroma'`
* You can skip systemd and nginx and all that stuff
* No need to create a dedicated pleroma user, it's easier to just use your own user (although you can if you want)
* For the DB you can still choose a dedicated user, the mix tasks set it up for you so it's no extra work for you
* For domain you can use `localhost`
* instead of creating a `prod.secret.exs`, create `dev.secret.exs`
* No need to prefix with `MIX_ENV=prod`. We're using dev and that's the default MIX_ENV.
2. Change the dev.secret.exs
* Change the scheme in `config :pleroma, Pleroma.Web.Endpoint` to http
* If you want to change other settings, you can do that too.
3. You can now start the server `mix phx.server`. Once it's build and started, you can access the instance on `http://<host>:<port>` (e.g.http://localhost:4000 ) and should be able to do everything locally you normaly can.
Example config to change the scheme to http. Change the port if you want to run on another port.
5. `sudo -Hu postgres psql -c "ALTER USER pleroma_local_test WITH CREATEDB;"`
3. Run the tests with `mix test` to see if they all pass. `mix test` will also create and migrate the database.
Content for the `test.secret.exs` file. Feel free to use another user, databasename or password, just make sure the database is dedicated for the testing environment.
```elixir
# Pleroma test configuration
# NOTE: This file should not be committed to a repo or otherwise made public
# without removing sensitive information.
import Config
config :pleroma, Pleroma.Repo,
username: "pleroma_local_test",
password: "mysuperduperpassword",
database: "pleroma_local_test",
hostname: "localhost"
```
## Updating
To update the develop branch
```sh
git checkout develop;
git pull pleroma develop;
mix deps.get;
mix ecto.migrate;
```
## Working on multiple branches
If you develop on a certain branch, it's possible you did migrations that aren't merged into another branch you're working on. If you have multiple things you're working on, it's probably best to set up multiple pleroma's with each their own database. If you finished with a branch and just want to switch back to develop to start a new branch from there, you can drop the database, switch back to develop and recreate the database