Back to articles
DevOps & Systems

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...

DPTCloud Engineering4 min read
Running a Decentralized Social Network Server Bluesky PDS on VPS or Dedicated Server

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:

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=8080
  • DB_URL=postgres://user:password@localhost:5432/pds
  • REDIS_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

DPTCloud Tier III Infrastructure

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.

View 22 VPS Plans
ECO · vn-02

VPS-2E

94.600 ₫ / mo

10% VAT included

  • CPU: 2 vCPU
  • RAM: 2 GB
  • SSD: 30 GB NVMe
ECO · vn-02Recommended

VPS-3E

170.500 ₫ / mo

10% VAT included

  • CPU: 2 vCPU
  • RAM: 4 GB
  • SSD: 50 GB NVMe
BASIC · vn-01Recommended

VPS-05

457.600 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe

Related Articles

View all
ZaloZalo SupportDiscord0384 753 478