Skip to content

Commit 18b8cea

Browse files
Add local development helper doc
1 parent 249182e commit 18b8cea

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

Diff for: LOCAL_DEV.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
```

0 commit comments

Comments
 (0)