Production Deployment
Guide: Production Deployment
Section titled “Guide: Production Deployment”This guide covers deploying ɳSelf to a production VPS from scratch.
Server Requirements
Section titled “Server Requirements”| Resource | Minimum | Recommended |
|---|---|---|
| CPU | 2 vCPU | 4 vCPU |
| RAM | 4 GB | 8 GB |
| Disk | 40 GB SSD | 80 GB SSD |
| OS | Ubuntu 22.04 | Ubuntu 22.04 |
Tested providers: Hetzner CX23 (2 vCPU / 4 GB) meets the minimum for a standard stack.
Firewall Rules
Section titled “Firewall Rules”Open only the ports your server needs:
| Port | Direction | Purpose |
|---|---|---|
| 80 | Inbound | HTTP (redirects to HTTPS) |
| 443 | Inbound | HTTPS |
| 22 | Inbound | SSH admin access |
Close to external access: 5432 (Postgres), 8080 (Hasura), 4000 (Auth), and all other internal service ports. ɳSelf routes all external traffic through Nginx on 80/443.
Example with ufw:
ufw allow 22/tcpufw allow 80/tcpufw allow 443/tcpufw default deny incomingufw enableDNS Setup
Section titled “DNS Setup”Create an A record pointing your domain to the server IP:
A example.com → 1.2.3.4A *.example.com → 1.2.3.4 # wildcard for subdomainsWait for DNS propagation (up to 24 hours) before running TLS setup.
Installation
Section titled “Installation”# Install nSelf CLI/bin/bash -c "$(curl -fsSL https://install.nself.org)"
# Verifynself versionInitialise and Build
Section titled “Initialise and Build”# Create project with production environmentnself init myproject --env prod
# Review and edit .env.prod# Set: BASE_DOMAIN, HASURA_GRAPHQL_ADMIN_SECRET, JWT secrets, Postgres password
# Generate docker-compose and nginx confignself build
# Start all servicesnself startVerify Deployment
Section titled “Verify Deployment”# Check all services are healthynself health
# List service URLsnself urlsOngoing Maintenance
Section titled “Ongoing Maintenance”| Task | Command |
|---|---|
| Update CLI | nself update |
| Apply config changes | nself build && nself restart |
| View service status | nself status |
| Tail logs | nself logs |
| Check health | nself health |
See Also
Section titled “See Also”- SSL Setup: TLS certificate configuration
- Security Hardening: post-deployment security checklist
- Monitoring Setup: enable metrics and alerting
- Backup and Restore: set up automated backups
← Guides