تخطَّ إلى المحتوى

Production Deployment

هذا المحتوى غير متوفر بلغتك بعد.

This guide covers deploying ɳSelf to a production VPS from scratch.

ResourceMinimumRecommended
CPU2 vCPU4 vCPU
RAM4 GB8 GB
Disk40 GB SSD80 GB SSD
OSUbuntu 22.04Ubuntu 22.04

Tested providers: Hetzner CX23 (2 vCPU / 4 GB) meets the minimum for a standard stack.

Open only the ports your server needs:

PortDirectionPurpose
80InboundHTTP (redirects to HTTPS)
443InboundHTTPS
22InboundSSH 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:

Terminal window
ufw allow 22/tcp
ufw allow 80/tcp
ufw allow 443/tcp
ufw default deny incoming
ufw enable

Create an A record pointing your domain to the server IP:

A example.com → 1.2.3.4
A *.example.com → 1.2.3.4 # wildcard for subdomains

Wait for DNS propagation (up to 24 hours) before running TLS setup.

Terminal window
# Install nSelf CLI
/bin/bash -c "$(curl -fsSL https://install.nself.org)"
# Verify
nself version
Terminal window
# Create project with production environment
nself 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 config
nself build
# Start all services
nself start
Terminal window
# Check all services are healthy
nself health
# List service URLs
nself urls
TaskCommand
Update CLInself update
Apply config changesnself build && nself restart
View service statusnself status
Tail logsnself logs
Check healthnself health

Guides