···2233Welcome to the repository for the official Bluesky PDS (Personal Data Server). This repository includes container images and documentation designed to assist technical people with self-hosting a Bluesky PDS.
4455+## Table of Contents
66+77+* [PDS](#pds)
88+ * [FAQ](#faq)
99+ * [What is Bluesky?](#what-is-bluesky)
1010+ * [What is AT Protocol?](#what-is-at-protocol)
1111+ * [Where is the code?](#where-is-the-code)
1212+ * [What is the current status of federation?](#what-is-the-current-status-of-federation)
1313+ * [What should I know about running a PDS in the developer sandbox?](#what-should-i-know-about-running-a-pds-in-the-developer-sandbox)
1414+ * [Self\-hosting PDS](#self-hosting-pds)
1515+ * [Preparation for self\-hosting PDS](#preparation-for-self-hosting-pds)
1616+ * [Open your cloud firewall for HTTP and HTTPS](#open-your-cloud-firewall-for-http-and-https)
1717+ * [Configure DNS for your domain](#configure-dns-for-your-domain)
1818+ * [Check that DNS is working as expected](#check-that-dns-is-working-as-expected)
1919+ * [Automatic install on Ubuntu 20\.04/22\.04 or Debian 11/12](#automatic-install-on-ubuntu-20042204-or-debian-1112)
2020+ * [Installing manually on Ubuntu 22\.04](#installing-manually-on-ubuntu-2204)
2121+ * [PDS environment variables](#pds-environment-variables)
2222+2323+524## FAQ
625726### What is Bluesky?
···9311294113These should all return your server's public IP.
951149696-## Automatic install on Ubuntu 20.04/22.04 or Debian 11/12
115115+### Automatic install on Ubuntu 20.04/22.04 or Debian 11/12
9711698117On your server via ssh, run the installer script:
99118···105124sudo bash installer.sh
106125```
107126108108-## Installing manually on Ubuntu 22.04
127127+### Installing manually on Ubuntu 22.04
109128110110-### Open ports on your Linux firewall
129129+#### Open ports on your Linux firewall
111130112131If your server is running a Linux firewall managed with `ufw`, you will need to open these ports:
113132···116135$ sudo ufw allow 443/tcp
117136```
118137119119-### Install Docker
138138+#### Install Docker
120139121140On your server, install Docker CE (Community Edition), using the the following instructions. For other operating systems you may reference the [official Docker install guides](https://docs.docker.com/engine/install/).
122141123142**Note:** All of the following commands should be run on your server via ssh.
124143125125-#### Uninstall old versions
144144+##### Uninstall old versions
126145127146```bash
128147sudo apt-get remove docker docker-engine docker.io containerd runc
129148```
130149131131-#### Set up the repository
150150+##### Set up the repository
132151133152```bash
134153sudo apt-get update
···151170 sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
152171```
153172154154-#### Install Docker Engine
173173+##### Install Docker Engine
155174156175```bash
157176sudo apt-get update
···161180sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
162181```
163182164164-#### Verify Docker Engine installation
183183+##### Verify Docker Engine installation
165184166185```bash
167186sudo docker run hello-world
168187```
169188170170-### Set up the PDS directory
189189+#### Set up the PDS directory
171190172191```bash
173192sudo mkdir /pds
···175194sudo mkdir --parents /pds/caddy/etc/caddy
176195```
177196178178-### Create the Caddyfile
197197+#### Create the Caddyfile
179198180199Be sure to replace `example.com` with your own domain.
181200···194213CADDYFILE
195214```
196215197197-### Create the PDS env configuration file
216216+#### Create the PDS env configuration file
198217199218You should fill in the first 5 values, but leave the rest untouched unless you have good reason to change it.
200219···227246PDS_CONFIG
228247```
229248230230-### Start the PDS containers
249249+#### Start the PDS containers
231250232232-#### Download the Docker compose file
251251+##### Download the Docker compose file
233252234253Download the `compose.yaml` to run your PDS, which includes the following containers:
235254···241260curl https://raw.githubusercontent.com/bluesky-social/pds/main/compose.yaml | sudo tee /pds/compose.yaml
242261```
243262244244-#### Create the systemd service
263263+##### Create the systemd service
245264246265```bash
247266 cat <<SYSTEMD_UNIT_FILE >/etc/systemd/system/pds.service
···263282SYSTEMD_UNIT_FILE
264283```
265284266266-#### Start the service
285285+##### Start the service
267286268287```bash
269288sudo systemctl daemon-reload
···285304sudo docker ps
286305```
287306288288-### Verify your PDS is online
307307+#### Verify your PDS is online
289308290309You can check if your server is online and healthy by requesting the healthcheck endpoint.
291310···294313{"version":"0.2.2-beta.2"}
295314```
296315297297-### Connecting to your server
316316+#### Connecting to your server
298317299318You can use the Bluesky app to connect to your server to create an account.
300319