···17 - [What is AT Protocol?](#what-is-at-protocol)
18 - [Where is the code?](#where-is-the-code)
19 - [What is the current status of federation?](#what-is-the-current-status-of-federation)
20- - [Self-hosting PDS](#self-hosting-pds)
21- - [Preparation for self-hosting PDS](#preparation-for-self-hosting-pds)
22 - [Open your cloud firewall for HTTP and HTTPS](#open-your-cloud-firewall-for-http-and-https)
23 - [Configure DNS for your domain](#configure-dns-for-your-domain)
24 - [Check that DNS is working as expected](#check-that-dns-is-working-as-expected)
25- - [Installer on Ubuntu 20.04/22.04/24.04 and Debian 11/12](#installer-on-ubuntu-200422042404-and-debian-1112)
26 - [Verifying that your PDS is online and accessible](#verifying-that-your-pds-is-online-and-accessible)
27 - [Creating an account using pdsadmin](#creating-an-account-using-pdsadmin)
28 - [Creating an account using an invite code](#creating-an-account-using-an-invite-code)
···5657### What is the current status of federation?
5859-As of Spring 2024, the AT Protocol network is open to federation!
6061✅ Federated domain handles (e.g. `@nytimes.com`)
62···7071✅ Federated moderation (labeling)
7273-## Self-hosting PDS
7475Self-hosting a Bluesky PDS means running your own Personal Data Server that is capable of federating with the wider Bluesky social network.
7677-### Preparation for self-hosting PDS
7879-Launch a server on any cloud provider, [Digital Ocean](https://digitalocean.com/) and [Vultr](https://vultr.com/) are two popular choices.
8081Ensure that you can ssh to your server and have root access.
82···135136These should all return your server's public IP.
137138-### Installer on Ubuntu 20.04/22.04/24.04 and Debian 11/12
00139140-On your server via ssh, download the installer script using wget:
141142```bash
143-wget https://raw.githubusercontent.com/bluesky-social/pds/main/installer.sh
144```
145146-or download it using curl:
147148```bash
149-curl https://raw.githubusercontent.com/bluesky-social/pds/main/installer.sh >installer.sh
00000000000000000000000000000000000150```
151152-And then run the installer using bash:
153154-```bash
155-sudo bash installer.sh
000000156```
157158### Verifying that your PDS is online and accessible
159160> [!TIP]
161-> The most common problems with getting PDS content consumed in the live network are when folks substitute the provided Caddy configuration for nginx, apache, or similar reverse proxies. Getting TLS certificates, WebSockets, and virtual server names all correct can be tricky. We are not currently providing tech support for other configurations.
162163-You can check if your server is online and healthy by requesting the healthcheck endpoint.
164165-You can visit `https://example.com/xrpc/_health` in your browser. You should see a JSON response with a version, like:
166167```
168{"version":"0.2.2-beta.2"}
···174wsdump "wss://example.com/xrpc/com.atproto.sync.subscribeRepos?cursor=0"
175```
176177-Note that there will be no events output on the WebSocket until they are created in the PDS, so the above command may continue to run with no output if things are configured successfully.
178179### Creating an account using pdsadmin
180181-Using ssh on your server, use `pdsadmin` to create an account if you haven't already.
182183```bash
184sudo pdsadmin account create
···186187### Creating an account using an invite code
188189-Using ssh on your server, use `pdsadmin` to create an invite code.
190191```bash
192sudo pdsadmin create-invite-code
···210211To be able to verify users' email addresses and send other emails, you need to set up an SMTP server.
212213-One way to do this is to use an email service. [Resend](https://resend.com/) and [SendGrid](https://sendgrid.com/) are two popular choices.
214215-Create an account and API key on an email service, ensure your server allows access on the required ports, and set these variables in `/pds/pds.env` (example with Resend):
216217```
218PDS_EMAIL_SMTP_URL=smtps://resend:<your api key here>@smtp.resend.com:465/
···265266### Updating your PDS
267268-It is recommended that you keep your PDS up to date with new versions, otherwise things may break. You can use the `pdsadmin` tool to update your PDS.
269270```bash
271sudo pdsadmin update
···17 - [What is AT Protocol?](#what-is-at-protocol)
18 - [Where is the code?](#where-is-the-code)
19 - [What is the current status of federation?](#what-is-the-current-status-of-federation)
20+ - [Self-hosting a PDS](#self-hosting-a-pds)
21+ - [Deploying a PDS onto a VPS](#deploying-a-pds-onto-a-vps)
22 - [Open your cloud firewall for HTTP and HTTPS](#open-your-cloud-firewall-for-http-and-https)
23 - [Configure DNS for your domain](#configure-dns-for-your-domain)
24 - [Check that DNS is working as expected](#check-that-dns-is-working-as-expected)
25+ - [Installing on Ubuntu 20.04/22.04/24.04 and Debian 11/12/13](#installing-on-ubuntu-200422042404-and-debian-111213)
26 - [Verifying that your PDS is online and accessible](#verifying-that-your-pds-is-online-and-accessible)
27 - [Creating an account using pdsadmin](#creating-an-account-using-pdsadmin)
28 - [Creating an account using an invite code](#creating-an-account-using-an-invite-code)
···5657### What is the current status of federation?
5859+The AT Protocol network is open to federation!
6061✅ Federated domain handles (e.g. `@nytimes.com`)
62···7071✅ Federated moderation (labeling)
7273+## Self-hosting a PDS
7475Self-hosting a Bluesky PDS means running your own Personal Data Server that is capable of federating with the wider Bluesky social network.
7677+### Deploying a PDS onto a VPS
7879+This README provides instructions for deploying a PDS using our install script onto a Virtual Private Server. [Digital Ocean](https://digitalocean.com/) and [Vultr](https://vultr.com/) are two popular choices for VPS hosting.
8081Ensure that you can ssh to your server and have root access.
82···135136These should all return your server's public IP.
137138+### Installing on Ubuntu 20.04/22.04/24.04 and Debian 11/12/13
139+140+Note that this script assumes a relatively "fresh" VPS that is not also concurrently hosting a web server or anything else on port 80/443. If you intend to run a PDS alongside an existing webserver on the same VPS, you will not want to use this install script.
141142+On your server, download the install script using `curl`:
143144```bash
145+curl https://raw.githubusercontent.com/bluesky-social/pds/main/installer.sh > installer.sh
146```
147148+And then run the installer using `bash`. You will need `sudo` permissions to continue:
149150```bash
151+sudo bash installer.sh
152+```
153+154+The install script is interactive and will prompt for input during the install process. You will need to provide your public DNS address, an admin email address (which does not need to be from the same domain), and be prompted to create a PDS user account with its own email address and handle. If you plan to reuse an existing AT handle, you can skip user account creation, though if it is your first time deploying a PDS you may want to create an account using your domain like `account.your-domain.net` for testing purposes.
155+156+Upon completion of a successful installation, you'll receive output similar to the following:
157+158+```
159+========================================================================
160+PDS installation successful!
161+------------------------------------------------------------------------
162+163+Check service status : sudo systemctl status pds
164+Watch service logs : sudo docker logs -f pds
165+Backup service data : /pds
166+PDS Admin command : pdsadmin
167+168+Required Firewall Ports
169+------------------------------------------------------------------------
170+Service Direction Port Protocol Source
171+------- --------- ---- -------- ----------------------
172+HTTP TLS verification Inbound 80 TCP Any
173+HTTP Control Panel Inbound 443 TCP Any
174+175+Required DNS entries
176+------------------------------------------------------------------------
177+Name Type Value
178+------- --------- ---------------
179+your-domain.net A your-ip-address
180+*.your-domain.net A your-ip-address
181+182+Detected public IP of this server: your-ip-address
183+184+To see pdsadmin commands, run "pdsadmin help"
185+186+========================================================================
187```
188189+And, following account creation:
190191+```
192+Account created successfully!
193+-----------------------------
194+Handle : handle.your-domain.net
195+DID : did:plc:your-did
196+Password : your-password
197+-----------------------------
198+Save this password, it will not be displayed again.
199```
200201### Verifying that your PDS is online and accessible
202203> [!TIP]
204+> The most common problems with getting PDS content consumed in the live network usually result from users trying to port the provided Caddy configuration to Nginx, Apache, or other reverse proxies. Getting TLS certificates, WebSockets, and virtual server names provisioned can be challenging. We are not currently providing tech support for other configurations.
205206+After installation, your PDS should be live and accessible on the web. You can check if your server is online and healthy by making a request to `https://your-domain.net/xrpc/_health` (the healthcheck endpoint). You should see a JSON response with a version, like:
207208+Visit `https://your-domain.net/xrpc/_health` in your browser. You should see a JSON response with a version, like:
209210```
211{"version":"0.2.2-beta.2"}
···217wsdump "wss://example.com/xrpc/com.atproto.sync.subscribeRepos?cursor=0"
218```
219220+Note that there will be no events output on the WebSocket until they are created in the PDS, so the above command may continue to run with no output immediately post-installation.
221222### Creating an account using pdsadmin
223224+You'll now have access to some additional command line tools on this server. Use `pdsadmin` to create an account if you haven't already:
225226```bash
227sudo pdsadmin account create
···229230### Creating an account using an invite code
231232+If needed, use `pdsadmin` to create an invite code:
233234```bash
235sudo pdsadmin create-invite-code
···253254To be able to verify users' email addresses and send other emails, you need to set up an SMTP server.
255256+As an alternative to running your own SMTP server, you can use an email service. [Resend](https://resend.com/) and [SendGrid](https://sendgrid.com/) are two popular choices.
257258+Create an account and API key on an email service, ensure your server allows access on the required ports, and then you can add these configuration variables to `/pds/pds.env` on your server (example with Resend):
259260```
261PDS_EMAIL_SMTP_URL=smtps://resend:<your api key here>@smtp.resend.com:465/
···308309### Updating your PDS
310311+It is recommended that you keep your PDS up to date with new versions. You can use the `pdsadmin` tool to update your PDS.
312313```bash
314sudo pdsadmin update
+4-1
installer.sh
···105 elif [[ "${DISTRIB_CODENAME}" == "bookworm" ]]; then
106 SUPPORTED_OS="true"
107 echo "* Detected supported distribution Debian 12"
000108 fi
109 fi
110111 if [[ "${SUPPORTED_OS}" != "true" ]]; then
112- echo "Sorry, only Ubuntu 20.04, 22.04, 24.04, Debian 11 and Debian 12 are supported by this installer. Exiting..."
113 exit 1
114 fi
115
···105 elif [[ "${DISTRIB_CODENAME}" == "bookworm" ]]; then
106 SUPPORTED_OS="true"
107 echo "* Detected supported distribution Debian 12"
108+ elif [[ "${DISTRIB_CODENAME}" == "trixie" ]]; then
109+ SUPPORTED_OS="true"
110+ echo "* Detected supported distribution Debian 13"
111 fi
112 fi
113114 if [[ "${SUPPORTED_OS}" != "true" ]]; then
115+ echo "Sorry, only Ubuntu 20.04, 22.04, 24.04, and Debian 11, 12, and 13 are supported by this installer. Exiting..."
116 exit 1
117 fi
118