Setting Up My PDS for Bluesky

ยท 909 words ยท 5 minute read

I have to be honest, I’m not fond of social media. I’ve dipped my toes in Mastodon a few times (including running my own instance) but it has never stuck. Neither am I particularly interested in Bluesky. But I do like to mess around with computers, so when I read that Bluesky were releasing their Personal Data Server (PDS) for self-hosted federation, I decided to see what all of the fuss was about.

It turns out that it is remarkably easy to set up and administer, so I thought I’d document my experience. First things first, to remember, though:

  • It is not Mastodon
  • It is easier to set up than Mastodon
  • It seems to use fewer resources than Mastodon
  • It does a lot less than Mastodon
  • It is not Mastodon

Equipment ๐Ÿ”—

I’m running this on a Firebat T8 Plus mini PC. It has an Intel N100 CPU, 16GB of RAM and a 512GB SSD. It is a tiny device which sips power and is surprisingly capable. It sits in the cupboard under the stairs, connected to my router by ethernet. Although very quiet, it does have a small fan which spins up occasionally. If I was running this in a bedroom I’d probably use a Wyse 5070 instead. I have a fibre-to-the-premises connection with TalkTalk, who don’t provide a static IP but also do permit servers for personal use.

Software ๐Ÿ”—

The machine is running a pre-release version of Ubuntu Server 24.04. Although a fairly vanilla install, I am running (several) other services on there.

DNS ๐Ÿ”—

I use Mythic Beasts as my DNS provider. You should too. They are the bee’s knees.

I set an A record for the subdomain bsky using my dynamic DNS updater snap and used the Mythic Beasts control panel to add a CNAME record for *.bsky which points to this. If TalkTalk change my IPv4 address, I should have no more than 5 minutes of downtime until the records update and propagate.

Discord ๐Ÿ”—

Disappointingly, it was necessary to log on to the AT Protocol PDS Admins Discord server to raise a ticket to register my PDS with the core. To be fair to the developers, though, the process was simple and the chat was friendly. They seem like a nice bunch.

Setting up a container ๐Ÿ”—

The recommended way to set up the PDS is with a setup script which can be run on Ubuntu 20.04/22.04 or Debian 11 or 12. The script sets up Docker and installs the server, with Caddy in front of it as a reverse proxy and to handle SSL. My Ubuntu version was too new for the script to support, plus I’m never keen on adding Docker or other repos to my base install. Therefore, I decided to run it in a container with LXD/LXC. On my host machine I ran:

lxd init

and accepted the defaults. I then ran:

lxc launch ubuntu:22.04 bluesky -c security.nesting=true
lxc config device add bluesky myport80 proxy listen=tcp:0.0.0.0:80 connect=tcp:127.0.0.1:80
lxc config device add bluesky myport443 proxy listen=tcp:0.0.0.0:443 connect=tcp:127.0.0.1:443

to set up a container named bluesky and to plumb in the ports for http and https to the container from the outside world. The security.nesting option allows Docker to run as a container-within-a-container.

Of course, I had to set up port forwarding in my router to open ports 80 and 443 to the internet and forward them to my N100 machine.

I made sure the container was updated by logging in and running apt:

lxc exec bluesky bash
apt update
apt full-upgrade
logout

and created a quick snapshot of the current state in case something went wrong:

lxc snapshot bluesky

All the preparation was in place.

Installing the PDS ๐Ÿ”—

I had already inspected the install script and nothing looked out of place. It would have been nice to have the option to install without caddy, so I could use my existing reverse proxy, but apart from that it was fine. I logged in to my container and installed:

lxc exec bluesky bash
wget https://raw.githubusercontent.com/bluesky-social/pds/main/installer.sh
bash installer.sh

I was asked a few simple questions. The install process only took a couple of minutes and I had the opportunity to create a user at the end of the process. I made sure to note down the generated strong password. Everything was now up and running.

Using the PDS ๐Ÿ”—

I downloaded the Bluesky app on my phone from the Play Store. At login, there was an option to use a custom PDS so I entered the details of my server and my new username and login. Everything worked smoothly and within a few seconds I was browsing through the whole Bluesky network. This was a very different experience to Mastodon, where it is necessary to make connections from a custom server to other nodes manually.

In actual fact, it is impossible to tell that I’m running my own PDS. Right now there are no advantages or disadvantages in doing so. However, I now have my own container of my own data which I can keep, backup, remove or migrate when I please. That is pretty powerful.

The PDS does not seem to consume very much RAM, CPU time or disk space. It appears to be very, very light on resources. It is too early to say whether that will remain the case (my previous Mastodon installs have grown exponentially as the tendrils of federation have spread) but right now I’m impressed. Well done, devs!

You can feedback on Bluesky.