Skip to main content

nself service

nself service — ɳSelf documentation.

Enable, disable, and list optional ɳSelf services.

Synopsis

nself service <subcommand> [flags]

Description

nself service manages the optional services in your ɳSelf stack (enable/disable/list), the live lifecycle of any stack service (start/stop/restart/scale/update/upgrade), and scaffolding for custom services. The four core services (PostgreSQL, Hasura, Auth, Nginx) are always included. Everything else: Redis, MinIO, Mailpit, Functions, MeiliSearch, Monitoring, and Admin, is optional and controlled through enable/disable. MLflow is available as a free plugin (nself plugin install mlflow) rather than a built-in service.

Enabling or disabling a service writes to your .env file. After changing service state, run nself build to regenerate docker-compose.yml with the updated service set, then nself restart to apply the changes.

service add scaffolds a custom service into an available CS_N slot (1-10). service start/stop/restart/update/upgrade/scale act directly on a running docker compose service by name (any service already in the generated docker-compose.yml, not only optional ones).

Subcommands

Subcommand Description
enable <name> Enable an optional service
disable <name> Disable an optional service
list List all optional services with enabled/disabled status
ps Show status of all nSelf stack services (docker compose ps)
add <name> Scaffold a custom service (CS_N slot) into the current project
configure <target> Configure service settings (e.g. email provider presets)
start <name> Start a named nSelf service
stop <name> Stop a named nSelf service (container preserved)
restart <name> Restart a named nSelf service
update <name> Pull the latest image for a service and restart it
upgrade <name> <version> Pin a service to a specific image version
scale <name> <replicas> Set the replica count for a named service

Available Services

Service Env Var Aliases
redis REDIS_ENABLED none
minio MINIO_ENABLED storage
mailpit MAILPIT_ENABLED email
functions FUNCTIONS_ENABLED none
search SEARCH_ENABLED meilisearch
monitoring MONITORING_ENABLED none
admin nself none

Flags

Flag Default Description
--env current Target environment file
--json false Output as JSON array (for list)
--template go Service template for add: go, node, python, static, rust, other
--provider "" Email provider for configure email: postmark, sendgrid, resend, mailgun, ses, sparkpost, smtp-generic
--help, -h none Show help

Examples

# List all optional services
nself service list
nself service list --json

# Enable Redis
nself service enable redis

# Enable MinIO object storage (using alias)
nself service enable storage

# Enable monitoring stack
nself service enable monitoring

# Enable monitoring for production environment
nself service enable monitoring --env prod

# Disable Mailpit
nself service disable mailpit

# Disable MeiliSearch (using alias)
nself service disable meilisearch

# Show live status of every service
nself service ps

# Scaffold a new custom Go service
nself service add myapi --template python

# Configure an email provider preset
nself service configure email --provider postmark

# Restart, update, and scale a running service
nself service restart redis
nself service update hasura
nself service scale functions 3

# Pin a service to a specific image version
nself service upgrade postgres 16.3

# After changing services, rebuild and restart
nself build && nself restart