{
"$type": "site.standard.document",
"canonicalUrl": "https://justingarrison.com/blog/2024-12-02-run-a-bluesky-pds-from-home",
"coverImage": {
"$type": "blob",
"ref": {
"$link": "bafkreicqli3ycu5lgn7ub4bciabu6q6bdlxrw42ajclwqq7l2t3aw6vb2u"
},
"mimeType": "image/png",
"size": 119741
},
"description": "Take ownership—and responsibility—of your social data",
"path": "/blog/2024-12-02-run-a-bluesky-pds-from-home",
"publishedAt": "2024-12-02T00:00:00.000Z",
"site": "at://did:plc:p7uix7mresfq4nfzxp3klgfa/site.standard.publication/3mmdn7mg2qm2d",
"textContent": "Mastodon is a social media monolith, but Bluesky's architecture is microservices in the ways I like.\nWhile it's true components of Mastodon are separate, the instance is inseperable from user data.\nYou have to run a Mastodon server if you want to be a user on the network.\n\nThat fundamental idea is not the responsibility I want to have with social media.\nNot only is that more expensive and complex, it's more legally fraught, and expensive.\n\nBluesky's tiered approach to data, scraping, and applications separate the concerns much better for the amount of responsibility I want to have.\nThe Personal Data Server (PDS) is what I need to run to be a user on the network.\n\nThe PDS includes my data and my identity.\nIt doesn't include someone else's data (cached) and doesn't get directly connected to by other users in the network.\n\nHere's a very basic overview\n\n{{< youtube wfnvVWPYbWE >}}\n\nI've been running a PDS on a Raspberry Pi 5 at my house for a couple weeks now on an alt account to test the setup.\nI'll be migrating my main account once I make sure I understand how to restore the data in case of a catostrophic hardware failure.\n\nThis article is based on the video I created.\nYou can follow along with the video or read the steps below.\n\n{{< youtube 7-VJvf39xVE >}}\n\nThe video has more details about logs and what containers get run, but the basic steps to get started are here.\n\nSet up your server\n\nI use a Raspberry Pi because that's what I have available and I like the idea of single purpose appliances.\nYou could just as easily run this from a VM at your house or in a cloud provider.\n\nIt doesn't take very many resources (1 CPU core, 1GB RAM), especially if it's only a single user.\n\nSetup DNS\n\nYou'll want DNS working before you run the installer.\nPick a domain (or subdomain) for your PDS and set up A records to point to your public IP address.\n\nI would suggest using a subdomain like pds.example.com for the domain.\nUsers that are created at the PDS will be user.pds.example.com by default and then you can update their names to other domains or subdomains later.\n\nYou'll need an A record pointed to your IP address and a *. subdomain A record also pointed to your IP address (for the users).\n\nForward firewall ports\n\nYou'll need to forward ports 80 and 443 to your PDS server or set up a reverse proxy that will forward request for your domain to your PDS server.\n\nIf you don't know how to forward ports on your router to an internal host then you probably shouldn't host this from home.\nThis is something that's often very confusing for new people and very commonplace for people who have been doing this for a while.\n\nIf you're not comfortable with opening ports then I would suggest using a VM in a cloud provider and paying for an ipv4 address that won't change.\n\nInstall PDS containers\n\nYou need a Debian or Ubuntu based OS to run the installer script.\nIf you know how docker compose works it wouldn't be hard to manually run the example compose stack.\n\nIf you want to run the script which installs docker and sets up a systemd service then you can SSH into the server and run.\n\nThis will install the dependencies, create a /pds folder, start the containers, and create a systemd service called pds.\n\nSet up DDNS\n\nDynamic DNS is required if you're running this from home.\nIP addresses from ISPs change and you don't want your PDS going offline for a simple IP address renewal.\n\nI use inadyn for my setup because it supports a ton of providers and is free.\n\nIt's as easy as making an API key for my DNS provider, creating a config from their examples, and running the container.\n\nSet up email\n\nI would suggest you set up an SMTP server on the PDS just to verify your accounts.\n\nI have no idea if verification does anything for the network, but at minimum it stops you from having to skip the \"verify later\" button when you log in.\n\nYou can use a variety of services for SMTP.\nI like to use Gmail with an application password\n\nEdit the /pds/pds.env file and add the following lines.\n\nThen restart the containers with\n\nSet up monitoring\n\nThere are a bunch of monitoring services out there and you can pick your favorite.\nI used UptimeRobot because it was easy and they have an app that makes sure I get the alerts.\n\nAll I had to do was add https://pds.justingarrison.com/xrpc/_health to the health check and set my alerts.\n\n!UptimeRobot screenshot\n\nYou can see I don't even have two 9s of availability in the past week.\nThis is mostly due to a UPS failure while I was gone which took the PDS down for 7 hours.\n\nSet up metrics\n\nMonitoring up/down is good but monitoring what's going on is also important.\nI've been using netdata for single host metrics for a long time.\n\n!Netdata dashboard\n\nIt runs as a single container and has a web interface that you can use locally without needing to set up a bunch of storage or scraping infrastrucutre.\nOf course if the host is down that doesn't help so I also have been using netdata.cloud which gives free, limited metrics of the host.\n\nThis is at least a first stop check for resource exhaustion (eg CPU, disk), but I honestly haven't noticed anything in the couple weeks I've been running it.\n\nCreate your user\n\nThere's a pdsadmin command that comes with the install script that helps with some common tasks like creating users, resetting passwords, and requesting the network to crawl your PDS.\n\nAfter your user has been created you can use the normal bsky.app to log in.\nAt the log in prompt select \"custom\" for your hosting provider.\n\nPut in your PDS hostname and the username and password printed in your terminal when you created a user.\n\n!PDS login screenshot\n\nLog in\n\nNow that you have a PDS running you can validate your user with bsky-debug.\n\nMake sure you set up a profile for your new user.\nAdd a name and profile description otherwise your account won't be searchable in Bluesky.\n\nThat's it.\nEnjoy your data on your network.\nMake sure you do it responsibly.",
"title": "Run a Bluesky PDS From Home"
}