Running a Decentralized Social Network Server Bluesky PDS on VPS or Dedicated Server
A detailed guide on self-hosting a Bluesky PDS personal data server on VPS or Dedicated Server, including setup, configuration, security, and operational checks. Suitable for...
Image credit: Firmbee · Pixabay Content License
Overview of Bluesky PDS Decentralized Social Network Server
Bluesky is a decentralized social network built on the Personal Data Server (PDS) architecture, allowing users to control their personal data. Instead of relying on a centralized platform, each user can host their own PDS, enabling ownership and management of content, connections, and interactions without censorship.
Self-hosting a PDS gives you full control over your data, ensuring privacy and user autonomy. This guide walks you through setting up a Bluesky PDS server on a VPS or Dedicated Server, suitable for technical users and DevOps professionals.
Requirements and Environment Preparation
To self-host a PDS, you need:
- A VPS or Dedicated Server with minimum specifications:
- 1 vCPU
- 2 GB RAM
- 20 GB SSD
- Operating System: Ubuntu 22.04 LTS or Debian 11
- Stable internet connection
- Static IP address (required for PDS)
- SSH access to the server
Consider these suitable services:
- NVMe Cloud VPS for Docker, Nginx & Databases
- High-Performance Dedicated Servers for Production Clusters
Installing and Configuring the PDS Server
Running a PDS requires core components: bluesky-pds, bluesky-redis, and bluesky-postgres. Below are the basic steps:
1. Install Required Tools
On the server, update the system and install necessary tools:
sudo apt update
sudo apt upgrade -y
sudo apt install -y git curl wget build-essential
2. Clone and Install Bluesky PDS
Clone the official Bluesky PDS repository:
git clone https://github.com/bluesky-social/pds.git
cd pds
Install dependencies (Node.js 18+ required):
npm install
npm run build
3. Configure Environment
Create an environment configuration file:
cp .env.example .env
Modify the .env file with the following settings:
HOST=your-domain.com(or static IP)PORT=8080DB_URL=postgres://user:password@localhost:5432/pdsREDIS_URL=redis://localhost:6379
4. Start the PDS
Run the PDS with:
npm run start
Ensure PostgreSQL and Redis are running before starting PDS.
Testing and Security Configuration
After PDS is running, verify stability and security:
1. Check Operational Status
Access the server URL to check health:
curl http://your-domain.com:8080/health
A 200 OK response confirms PDS is operational.
2. Configure Nginx as Reverse Proxy
To secure and expose the service externally, use Nginx:
sudo apt install nginx
sudo nano /etc/nginx/sites-available/pds
Add the following configuration:
server {
listen 80;
server_name your-domain.com;
location / {
proxy_pass http://localhost:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
Enable and restart Nginx:
sudo ln -s /etc/nginx/sites-available/pds /etc/nginx/sites-enabled/
sudo systemctl restart nginx
3. Enable HTTPS with Let's Encrypt
Install and obtain a free SSL certificate:
sudo apt install certbot
sudo certbot certonly --nginx -d your-domain.com
Troubleshooting Common Issues
During deployment, you may encounter these common errors:
- Cannot connect to PostgreSQL: Check if PostgreSQL is running with
sudo systemctl status postgresql. - Redis fails to start: Verify Redis configuration and ensure no port conflicts.
- SSL certificate errors: Confirm domain name in Nginx and Let's Encrypt certificate match.
References
Recommended NVMe Cloud VPS Plans to Deploy This Setup
Enterprise RAID 10 NVMe SSDs, CMC & FPT District 9 uplinks with Anycast Anti-DDoS and 99.99% SLA.
VPS-3E
10% VAT included
- CPU: 2 vCPU
- RAM: 4 GB
- SSD: 50 GB NVMe
