VPS Deployment

Deploy PC2 on a Virtual Private Server for 24/7 access from anywhere.

ProviderSpecsPriceNotes
Contabo4 vCPU, 8GB RAM€5.99/moBest value
Hetzner2 vCPU, 4GB RAM€4.51/moEU-based
DigitalOcean2 vCPU, 4GB RAM$24/moEasy setup
Vultr2 vCPU, 4GB RAM$24/moGlobal locations
Linode2 vCPU, 4GB RAM$24/moGood docs

Minimum Requirements: 1 vCPU, 2GB RAM, 20GB SSD, Ubuntu 22.04

Step-by-Step Setup

Create Your VPS

  1. Sign up with your chosen provider
  2. Create a new VPS with Ubuntu 22.04 LTS
  3. Choose at least 2GB RAM
  4. Note your server IP address

Connect via SSH

ssh root@YOUR_SERVER_IP

Install Node.js

# Add NodeSource repository
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
 
# Install Node.js
sudo apt-get install -y nodejs
 
# Verify installation
node --version  # Should show v20.x.x
npm --version   # Should show 10.x.x

Clone and Install PC2

# Clone repository
git clone https://github.com/Elacity/pc2.net
cd pc2.net
 
# Install dependencies
npm install
 
# Build (if needed)
cd pc2-node && npm run build && cd ..

Create Systemd Service

cat > /etc/systemd/system/pc2-node.service << 'EOF'
[Unit]
Description=PC2 Node - Personal Cloud Computer
After=network.target
 
[Service]
Type=simple
User=root
WorkingDirectory=/root/pc2.net/pc2-node
ExecStart=/usr/bin/node dist/index.js
Restart=on-failure
RestartSec=10
Environment=NODE_ENV=production
Environment=PORT=4200
 
[Install]
WantedBy=multi-user.target
EOF
 
# Enable and start
systemctl daemon-reload
systemctl enable pc2-node
systemctl start pc2-node
 
# Check status
systemctl status pc2-node

Configure Firewall

# Allow SSH and PC2
ufw allow 22
ufw allow 4200
ufw allow 80
ufw allow 443
ufw enable

Verify Installation

# Check health endpoint
curl http://localhost:4200/health

You should see:

{"status":"ok","database":"connected","ipfs":"available"}

Get HTTPS Access

The easiest way—no certificate setup required:

# Register with the Super Node gateway
curl -X POST https://69.164.241.210/api/gateway/register \
  -H "Content-Type: application/json" \
  -d '{
    "subdomain": "yourname",
    "nodeId": "your-node-id",
    "endpoint": "http://YOUR_SERVER_IP:4200"
  }'

Now access your node at: https://yourname.ela.city

The Super Node handles SSL automatically with a wildcard Let’s Encrypt certificate.

Option B: Custom Domain with Caddy

If you want your own domain:

# Install Caddy
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy
 
# Configure Caddy
cat > /etc/caddy/Caddyfile << 'EOF'
yourdomain.com {
    reverse_proxy localhost:4200
}
EOF
 
# Restart Caddy
systemctl restart caddy

Caddy automatically obtains and renews SSL certificates.

Monitoring

Check Logs

# View service logs
journalctl -u pc2-node -f
 
# View last 100 lines
journalctl -u pc2-node -n 100

Health Check

# Local check
curl http://localhost:4200/health
 
# Remote check (if firewall allows)
curl http://YOUR_SERVER_IP:4200/health

Restart Service

systemctl restart pc2-node

Updating Your Node

PC2 has built-in auto-update, but you can also update manually:

cd /root/pc2.net
 
# Pull latest code
git pull origin main
 
# Rebuild
cd pc2-node
npm install
npm run build
 
# Restart
systemctl restart pc2-node

Or use the one-click update in Settings → About.

Backup

Create Backup

# Stop service
systemctl stop pc2-node
 
# Backup data directory
tar -czf pc2-backup-$(date +%Y%m%d).tar.gz pc2-node/data
 
# Restart
systemctl start pc2-node

Restore

systemctl stop pc2-node
tar -xzf pc2-backup-YYYYMMDD.tar.gz
systemctl start pc2-node

Security Hardening

# Create non-root user
adduser pc2admin
usermod -aG sudo pc2admin
 
# Copy SSH key
mkdir -p /home/pc2admin/.ssh
cp ~/.ssh/authorized_keys /home/pc2admin/.ssh/
chown -R pc2admin:pc2admin /home/pc2admin/.ssh
 
# Disable root login
sed -i 's/PermitRootLogin yes/PermitRootLogin no/' /etc/ssh/sshd_config
systemctl restart sshd

Enable Automatic Updates

apt install unattended-upgrades
dpkg-reconfigure unattended-upgrades

→ Having issues? See Troubleshooting

© 2025 Elacity Labs. All rights reserved.