Using Proton Mail as Email Server in Bluesky PDS

This week, Bluesky launched its early access federation for self-hosters. It lets you set up a Personal Data Server to host your data. Setting up a PDS is super easy. You need to follow the steps documented in their bluesky-social/pds repo.

The email server is the only thing that doesn't work out of the box. Since I already use Protonmail, I decided to use their STMP submission feature, which is available to Proton for business subscribers.

The steps to set up Proton Mail are pretty straightforward:

  1. Create an SMTP submission token in your Proton account's settings

  2. SSH into your Bluesky PDS instance

  3. Go to /pds and open the pds.env file with your editor of choice

  4. Add the following environment variables:

    • PDS_EMAIL_SMTP_URL=smtps://[USERNAME]:[SMTP_TOKEN]@smtp.protonmail.ch:465

    • PDS_EMAIL_FROM_ADDRESS=no-reply@[HOST]

      Where [USERNAME] is your SMTP username (the email address), [SMTP_TOKEN] is the token you generated in step 1, and [HOST] is either the usual email domain you use in Proton Mail, or the domain where you're running your PDS (which you should add as domain to Proton Mail anyways).

  5. Restart the PDS service by running systemctl restart pds

Once you've completed these five steps, your PDS instance should be ready to send emails. A quick way to test it is by creating a new account and ensuring you receive the email verification email in your inbox.