6 How to use Etherpad Lite with PostgreSQL
Louis Royer edited this page 2019-09-13 15:28:16 +02:00
  1. Connect to PostgreSQL by opening a command prompt and typing the following: psql
  2. Once logged in, issue the following command to create a new user:
    CREATE USER etherpad;̀
  3. Configure a password for the created user. Replace <password> with your own value:
    ALTER USER etherpad WITH PASSWORD '<password>';
  4. Create a new database which belongs to the new user:
    CREATE DATABASE etherpad OWNER etherpad;
  5. Leave the psql client CTRL + D
  6. Edit settings.json in your Etherpad Lite root folder and change the database settings (if you have a non-default port configured for PostgreSQL you will have to add the "port" setting). It is strongly encouraged to set the option "charset" to "utf8mb4". Depending on your PostgreSQL configuration, you will have to set the "host" key to "localhost".
  7. Run etherpad lite

Example PostgreSQL Socket Config.

"dbType" : "postgres",
"dbSettings" : {
    "user"    : "etherpad",
    "host"    : "localhost",
    "password": "password",
    "database": "etherpad",
    "charset" : "utf8mb4"
}

Example for Debian

  1. Install Postgres:
    apt install postgresql
  2. Setup postgres access:
    Note: Username needs to be same name as your user that will/is running nodejs.
    sudo -u postgres sh -c 'createuser -d etherpad && createdb -O etherpad etherpad'
  3. Add this to your etherpad-lite/settings.json
"dbType" : "postgres",
"dbSettings" : {
    "user"    : "etherpad",
    "host"    : "/var/run/postgresql",
    "password": "",
    "database": "etherpad",
    "charset" : "utf8mb4"
}
  1. Run etherpad lite