Advertisement
Justman10000

Setup Matrix with Element

May 11th, 2023 (edited)
691
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.63 KB | None | 0 0
  1. // Install Matrix (with pip)
  2. # Install Python and PIP (https://pastebin.com/7GJYFSQm)
  3. cd /home
  4. pip install virtualenv
  5. python -m virtualenv synapse
  6. cd synapse
  7. source bin/activate
  8. pip install -U matrix-synapse
  9.  
  10. # Now adjust and use this command (--config-path you should leave as is)
  11. python -m synapse.app.homeserver \
  12.     --server-name my.domain.name \
  13.     --config-path homeserver.yaml \
  14.     --generate-config \
  15.     --report-stats=yes # yes or no
  16.  
  17. synctl start
  18.  
  19. !If you want to use SMTP for your matrix, add and adjust this at the end of your config:
  20. smtp_host: 127.0.0.1
  21. smtp_port: 587
  22. smtp_user: smtp_user
  23. smtp_pass: smtp_pass
  24.  
  25. !If you use PostgreSQL
  26. database:
  27.   name: psycopg2
  28.   args:
  29.     user: <user>
  30.     password: <pass>
  31.     database: <db>
  32.     host: <host>
  33.     cp_min: 5
  34.     cp_max: 10
  35.  
  36. !!Go into PostgreSQL (for Setup and go into see: https://pastebin.com/hf61pyhi)... Then:
  37. CREATE USER <user> SUPERUSER CREATEDB CREATEROLE LOGIN REPLICATION BYPASSRLS PASSWORD <pass>
  38. CREATE DATABASE <db> ENCODING=UTF8 LOCALE=C
  39.  
  40.  
  41. # Now restart
  42. synctl restart
  43.  
  44. # Register new user
  45. register_new_matrix_user -c homeserver.yaml
  46.  
  47. # Then go to zu https://matrix-org.github.io/synapse/latest/reverse_proxy.html and follow the instructions
  48.  
  49. // Install Element
  50. mkdir /home/element
  51. cd /home/element
  52. git init
  53. git remote add origin https://github.com/vector-im/element-web.git
  54. git pull origin develop
  55. rm -r .* *.md *.rst
  56. rm -r yarn.lock
  57. chmod -R 777 .
  58.  
  59. # Install NodeJS first (https://pastebin.com/Rf1vVKsR)
  60. yarn
  61. yarn clean && yarn build:genfiles && yarn build:bundle
  62. yarn dist
  63.  
  64. cd dist
  65. gunzip *
  66. tar xvf *
  67. mv * /var/www/html
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement