File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ # Local development
2+
3+ Steps to install and configure Postgres on Mac for developing against locally
4+
5+ 1 . Install homebrew
6+ 2 . Install postgres
7+ ``` sh
8+ brew install postgresql
9+ ```
10+ 3 . Create a database
11+ ``` sh
12+ createdb test
13+ ```
14+ 4 . Create SSL certificates
15+ ``` sh
16+ cd /opt/homebrew/var/postgresql@14
17+ openssl genrsa -aes128 2048 > server.key
18+ openssl rsa -in server.key -out server.key
19+ chmod 400 server.key
20+ openssl req -new -key server.key -days 365 -out server.crt -x509
21+ cp server.crt root.crt
22+ ```
23+ 5 . Update config in ` /opt/homebrew/var/postgresql@14/postgresql.conf `
24+
25+ ``` conf
26+ listen_addresses = '*'
27+
28+ password_encryption = md5
29+
30+ ssl = on
31+ ssl_ca_file = 'root.crt'
32+ ssl_cert_file = 'server.crt'
33+ ssl_crl_file = ''
34+ ssl_crl_dir = ''
35+ ssl_key_file = 'server.key'
36+ ssl_ciphers = 'HIGH:MEDIUM:+3DES:!aNULL' # allowed SSL ciphers
37+ ssl_prefer_server_ciphers = on
38+ ```
39+
40+ 6 . Start Postgres server
41+ ``` sh
42+ /opt/homebrew/opt/postgresql@14/bin/postgres -D /opt/homebrew/var/postgresql@14
43+ ```
You can’t perform that action at this time.
0 commit comments