VPS Deployment
Deploy PC2 on a Virtual Private Server for 24/7 access from anywhere.
Recommended Providers
| Provider | Specs | Price | Notes |
|---|---|---|---|
| Contabo | 4 vCPU, 8GB RAM | €5.99/mo | Best value |
| Hetzner | 2 vCPU, 4GB RAM | €4.51/mo | EU-based |
| DigitalOcean | 2 vCPU, 4GB RAM | $24/mo | Easy setup |
| Vultr | 2 vCPU, 4GB RAM | $24/mo | Global locations |
| Linode | 2 vCPU, 4GB RAM | $24/mo | Good docs |
Minimum Requirements: 1 vCPU, 2GB RAM, 20GB SSD, Ubuntu 22.04
Step-by-Step Setup
Create Your VPS
- Sign up with your chosen provider
- Create a new VPS with Ubuntu 22.04 LTS
- Choose at least 2GB RAM
- Note your server IP address
Connect via SSH
ssh root@YOUR_SERVER_IPInstall 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.xClone 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-nodeConfigure Firewall
# Allow SSH and PC2
ufw allow 22
ufw allow 4200
ufw allow 80
ufw allow 443
ufw enableVerify Installation
# Check health endpoint
curl http://localhost:4200/healthYou should see:
{"status":"ok","database":"connected","ipfs":"available"}Get HTTPS Access
Option A: Free *.ela.city Subdomain (Recommended)
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 caddyCaddy 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 100Health Check
# Local check
curl http://localhost:4200/health
# Remote check (if firewall allows)
curl http://YOUR_SERVER_IP:4200/healthRestart Service
systemctl restart pc2-nodeUpdating 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-nodeOr 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-nodeRestore
systemctl stop pc2-node
tar -xzf pc2-backup-YYYYMMDD.tar.gz
systemctl start pc2-nodeSecurity Hardening
Disable Root SSH (Recommended)
# 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 sshdEnable Automatic Updates
apt install unattended-upgrades
dpkg-reconfigure unattended-upgrades→ Having issues? See Troubleshooting