···125125### Set up the PDS directory
126126127127```bash
128128-# Create the directory where all PDS data will be stored.
129128sudo mkdir /data
130130-131131-# Create the required caddy webserver directories.
132132-sudo mkdir --parents /data/caddy/{etc,data}
129129+sudo mkdir --parents /data/caddy/etc
130130+sudo mkdir --parents /data/caddy/data
133131```
134132135135-### Start the PDS containers
136136-137137-#### Download the Docker compose file
138138-139139-Download the `sqlite-compose.yaml` to run your PDS with a local SQLite database.
133133+### Create the Caddyfile
140134141135```bash
142142-curl https://raw.githubusercontent.com/bluesky-social/pds/main/sqlite-compose.yaml >compose.yaml
136136+cat <<CADDYFILE >/data/caddy/etc/caddy/Caddyfile
137137+{
138138+ email you@example.com
139139+}
140140+141141+*.example.com, example.com {
142142+ reverse_proxy http://localhost:3000
143143+}
144144+CADDYFILE
143145```
144146145145-Or, download the `postgres-compose.yaml` to run your PDS with a remote PostgreSQL database.
147147+### Create the PDS env configuration file
146148147149```bash
148148-curl https://raw.githubusercontent.com/bluesky-social/pds/main/postgres-compose.yaml >compose.yaml
150150+cat <<PDS_CONFIG >/data/pds.env
151151+PDS_HOSTNAME=example.com
152152+PDS_DB_SQLITE_LOCATION=/data/pds.sqlite
153153+PDS_JWT_SECRET=<VALUE>
154154+PDS_ADMIN_PASSWORD=<VALUE>
155155+PDS_REPO_SIGNING_KEY_K256_PRIVATE_KEY_HEX=<VALUE>
156156+PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX=<VALUE>
157157+PDS_BLOBSTORE_DISK_LOCATION=/data/blocks
158158+PDS_DID_PLC_URL=https://plc.bsky-sandbox.dev
159159+PDS_BSKY_APP_VIEW_ENDPOINT=https://api.bsky-sandbox.dev
160160+PDS_BSKY_APP_VIEW_DID=did:web:api.bsky-sandbox.dev
161161+PDS_CRAWLERS=https://bgs.bsky-sandbox.dev
162162+PDS_CONFIG
149163```
150164151151-152152-#### Generate keys
165165+## Generating K256 private keys
153166154167Your PDS will need two secp256k1 private keys provided as hex strings. You can securely generate these keys using `openssl` with the following command:
155168```bash
···158171159172This will output a 64-char hex string. Please generate two keys in preperation for the next step.
160173161161-#### Edit your compose.yaml file
162162-163163-You will need to customize various settings configured through the PDS environment variables. See the below table to find the variables you'll need to set.
174174+### Start the PDS containers
164175165165-| Environment Variable | Value | Should update? | Notes |
166166-| ----------------------------------------- | --------------------------------------------- | -------------- |------ |
167167-| PDS_HOSTNAME | example.com | ✅ | Public domain you intend to deploy your service at |
168168-| PDS_DB_SQLITE_LOCATION | pds.sqlite | ✅ | Or use `PDS_DB_POSTGRES_URL` depending on which database you intend to use |
169169-| PDS_JWT_SECRET | jwt-secret | ✅ | Use a secure high-entropy string |
170170-| PDS_ADMIN_PASSWORD | admin-pass | ✅ | Use a secure high-entropy string |
171171-| PDS_REPO_SIGNING_KEY_K256_PRIVATE_KEY_HEX | 3ee68... | ✅ | See above Generate Keys section - once set, do not change |
172172-| PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX | e049f... | ✅ | See above Generate Keys section - once set, do not change |
173173-| LOG_ENABLED | true | ❔ | Outputs structured logs to stdout |
174174-| PDS_BLOBSTORE_DISK_LOCATION | blobs | ❌ | Only update if you update the mounted volume for your docker image as well |
175175-| PDS_DID_PLC_URL | plc.bsky-sandbox.dev | ❌ | Do not adjust if you intend to federate with the Bluesky federation sandbox |
176176-| PDS_BSKY_APP_VIEW_ENDPOINT | api.bsky-sandbox.dev | ❌ | Do not adjust if you intend to federate with the Bluesky federation sandbox |
177177-| PDS_BSKY_APP_VIEW_DID | did:web:api.bsky-sandbox.dev | ❌ | Do not adjust if you intend to federate with the Bluesky federation sandbox |
178178-| PDS_CRAWLERS | bgs.bsky-sandbox.dev | ❌ | Do not adjust if you intend to federate with the Bluesky federation sandbox |
176176+#### Download the Docker compose file
179177180180-There are additional environment variables that can be tweaked depending on how you're running your service. For instance, storing blobs in AWS S3, keys in AWS KMS, or setting up an email service.
178178+Download the `compose.yaml` to run your PDS with the require "sidecar" containers.
181179182182-Feel free to explore those [Here](https://github.com/bluesky-social/atproto/blob/simplify-pds/packages/pds/src/config/env.ts). However, we will not be providing support for more advanced configurations.
180180+```bash
181181+curl https://raw.githubusercontent.com/bluesky-social/pds/main/sqlite-compose.yaml >compose.yaml
182182+```
183183184184185185#### Run docker compose
···2152151. Download the Bluesky app
2162161. Enter the URL of your PDS (e.g. `https://example.com/`)
2172171. Create an account
218218+219219+## PDS environment variables
220220+221221+You will need to customize various settings configured through the PDS environment variables. See the below table to find the variables you'll need to set.
222222+223223+| Environment Variable | Value | Should update? | Notes |
224224+| ----------------------------------------- | --------------------------------------------- | -------------- |------ |
225225+| PDS_HOSTNAME | example.com | ✅ | Public domain you intend to deploy your service at |
226226+| PDS_DB_SQLITE_LOCATION | pds.sqlite | ✅ | Or use `PDS_DB_POSTGRES_URL` depending on which database you intend to use |
227227+| PDS_JWT_SECRET | jwt-secret | ✅ | Use a secure high-entropy string that is 32 characters in length |
228228+| PDS_ADMIN_PASSWORD | admin-pass | ✅ | Use a secure high-entropy string that is 32 characters in length |
229229+| PDS_REPO_SIGNING_KEY_K256_PRIVATE_KEY_HEX | 3ee68... | ✅ | See above Generate Keys section - once set, do not change |
230230+| PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX | e049f... | ✅ | See above Generate Keys section - once set, do not change |
231231+| PDS_BLOBSTORE_DISK_LOCATION | blobs | ❌ | Only update if you update the mounted volume for your docker image as well |
232232+| PDS_DID_PLC_URL | https://plc.bsky-sandbox.dev | ❌ | Do not adjust if you intend to federate with the Bluesky federation sandbox |
233233+| PDS_BSKY_APP_VIEW_URL | https://api.bsky-sandbox.dev | ❌ | Do not adjust if you intend to federate with the Bluesky federation sandbox |
234234+| PDS_BSKY_APP_VIEW_DID | did:web:api.bsky-sandbox.dev | ❌ | Do not adjust if you intend to federate with the Bluesky federation sandbox |
235235+| PDS_CRAWLERS | https://bgs.bsky-sandbox.dev | ❌ | Do not adjust if you intend to federate with the Bluesky federation sandbox |
236236+237237+There are additional environment variables that can be tweaked depending on how you're running your service. For instance, storing blobs in AWS S3, keys in AWS KMS, or setting up an email service.
238238+239239+Feel free to explore those [Here](https://github.com/bluesky-social/atproto/blob/simplify-pds/packages/pds/src/config/env.ts). However, we will not be providing support for more advanced configurations.