about summary refs log tree commit diff
path: root/docs/Running-Mastodon
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-02-07 23:57:30 +0100
committerEugen Rochko <eugen@zeonfederated.com>2017-02-07 23:57:30 +0100
commitaa1213e0890efd93d9a2531e78bc70fc08154d7a (patch)
tree2537a60887c3e1ebb27a1619c41f0920cf45d77f /docs/Running-Mastodon
parent1d273e4430adf71aa138e924d2e74cb1bee3f501 (diff)
Add postgres setup instructions to docs
Diffstat (limited to 'docs/Running-Mastodon')
-rw-r--r--docs/Running-Mastodon/Production-guide.md13
1 files changed, 12 insertions, 1 deletions
diff --git a/docs/Running-Mastodon/Production-guide.md b/docs/Running-Mastodon/Production-guide.md
index ff4427dd2..a6c776f09 100644
--- a/docs/Running-Mastodon/Production-guide.md
+++ b/docs/Running-Mastodon/Production-guide.md
@@ -87,6 +87,17 @@ It is recommended to create a special user for mastodon on the server (you could
 
     sudo apt-get install postgresql postgresql-contrib
 
+Setup a user and database for Mastodon:
+
+    sudo su - postgres
+    psql
+
+In the prompt:
+
+    CREATE USER mastodon CREATEDB;
+    CREATE DATABASE mastodon_production OWNER mastodon;
+    \q
+
 ## Rbenv
 
 It is recommended to use rbenv (exclusively from the `mastodon` user) to install the desired Ruby version. Follow the guides to [install rbenv][1] and [rbenv-build][2] (I recommend checking the [prerequisites][3] for your system on the rbenv-build project and installing them beforehand, obviously outside the unprivileged `mastodon` user)
@@ -122,7 +133,7 @@ Fill in the important data, like host/port of the redis database, host/port/user
 
     rake secret
 
-To get a random string.
+To get a random string. If you are setting up on one single server (most likely), then REDIS_HOST is localhost and `DB_HOST` is `/var/run/postgresql`, `DB_USER` is `mastodon` and `DB_NAME` is `mastodon_production` while `DB_PASS` is empty because this setup will use the ident authentication method (system user "mastodon" maps to postgres user "mastodon").
 
 ## Setup