Quick Start Guide


Prerequisites

Before you begin, make sure you have:

  • A Linux, macOS, or Windows (with WSL) system
  • An internet connection for downloading dependencies

That's it! nself will automatically install Docker, Docker Compose, and any other required dependencies.


Step 1: Install nself

Run this single command to install the nself CLI:

curl -sSL https://install.nself.org | bash

The installer will:

  • Download the latest nself CLI
  • Install it to ~/.nself/bin
  • Add nself to your PATH
  • Verify the installation

Step 2: Create Your Project

Create a new directory for your project and initialize nself with the new streamlined workflow:

mkdir my-backend && cd my-backend
nself init  # Minimal setup by default in v0.3.9

This creates essential files with smart defaults. For complete setup, use nself init --full.


Step 3: Configure Your Backend

Open .env.local in your favorite editor and customize:

# Basic Configuration
PROJECT_NAME=my-backend
ENV=dev  # or 'prod' for production

# Database
POSTGRES_PASSWORD=your-secure-password
POSTGRES_DB=myapp

# Optional Services (set to true to enable)
REDIS_ENABLED=true
FUNCTIONS_ENABLED=true
NSELF_ADMIN_ENABLED=true  # v0.3.9 Admin UI

# Database Seeding
DB_ENV_SEEDS=true  # Use environment-specific seed directories

For development, the default values work great. For production, see our Production Deployment Guide.


Step 4: Enable Admin UI (Optional)

Enable the new web-based Admin UI for enhanced management:

nself admin enable
nself admin password mypassword

Step 5: Build and Start

Generate your Docker configuration and start all services:

nself build
nself start

Your backend is now running with 35+ CLI commands and comprehensive management tools! 🎉

🎯 New in v0.3.9: Admin UI & Streamlined Workflow

Web-based admin interface at localhost:3100, simplified initialization with minimal setup by default, enhanced reset system with timestamped backups, and 25+ service templates.


Step 6: Enable SSL Trust (Recommended) v0.3.5

For the best development experience, enable SSL certificate trust to eliminate browser security warnings:

nself trust

This command installs trusted SSL certificates for both *.localhost and *.local.nself.org domains, giving you green lock security in all browsers.

Step 7: Access Your Services

After running nself trust, you can access your services with HTTPS (recommended):

đź”’ HTTPS (Recommended)

  • Admin UI (v0.3.9): https://admin.localhost
  • Hasura Console: https://hasura.localhost/console
  • Dashboard: https://dashboard.localhost
  • Storage Console: https://storage.localhost
  • MailPit: https://mailpit.localhost

HTTP (Legacy)

  • Admin UI (v0.3.9): http://localhost:3100
  • Hasura Console: http://localhost:8080/console
  • Dashboard: http://localhost:3030
  • MinIO Console: http://localhost:9001
  • PostgreSQL: localhost:5432

Dual Domain Support (v0.3.5)

nself now supports both *.localhost and *.local.nself.org domains with automatic SSL:

  • Localhost domains: Fastest access, Chrome/Safari optimized
  • Network domains: Accessible from other devices on your network
  • Green lock guarantee: All certificates trusted by browsers after nself trust

What's Next?

Explore the Database Tools

nself v0.3.9 includes powerful database management with interactive menu system:

# Interactive database menu (v0.3.9)
nself db

# Quick database operations
nself db status
nself db run
nself db seed
nself backup create

Add Microservices

Enable additional services in your .env.local:

# NestJS microservices
NESTJS_SERVICES=api,webhooks

# Python services
PYTHON_SERVICES=ml-processor

# Go services
GOLANG_SERVICES=data-fetcher

# BullMQ workers
BULLMQ_WORKERS=email-worker,notification-worker

Then rebuild and restart:

nself build && nself restart

Deploy to Production

When ready for production:

# Generate production configuration
nself prod

# Review and customize .env.prod-template
# Copy to .env before deployment
# Deploy to your server

Common Commands

# Service Management (v0.3.9)
nself start     # Start all services (primary command)
nself stop      # Stop all services (primary command)
nself restart   # Restart all services
nself status    # Check service status
nself logs      # View logs

# Admin UI Management (v0.3.9)
nself admin enable    # Enable admin UI
nself admin open      # Open admin UI in browser
nself admin password  # Set admin password
nself admin status    # Check admin status

# Database Management (Interactive Menu)
nself db              # Interactive database operations menu
nself db run          # Generate migrations from schema.dbml
nself db seed         # Seed database
nself backup create   # Create backup

# Configuration
nself build     # Rebuild configuration
nself reset     # Reset with timestamped backups
nself update    # Update nself CLI

Troubleshooting

Services won't start

  • Check Docker is running: docker ps
  • View logs: nself logs
  • Ensure ports aren't in use: netstat -tulpn | grep LISTEN

Database connection issues

  • Verify PostgreSQL is running: docker ps | grep postgres
  • Check credentials in .env.local
  • Try resetting: nself reset (⚠️ deletes all data)

Can't access web interfaces

  • Check firewall settings
  • Ensure services are running: nself status
  • Try accessing via localhost instead of 127.0.0.1

Getting Help

Ready to dive deeper? Check out our Architecture Overview to understand how everything works together.