Admin UI

The Admin UI is a comprehensive web-based dashboard introduced in nself v0.3.9. It provides real-time monitoring, service management, and database operations through an intuitive interface at localhost:3100.

Quick Start

Enable the Admin UI with a single command:

# Enable the admin UI
nself admin enable

# Set a custom password
nself admin password mypassword

# Open in browser
nself admin open

Features

Real-time Service Monitoring

Monitor the health and status of all your services in real-time:

  • Service health indicators with color-coded status
  • Resource usage (CPU, memory, network)
  • Container uptime and restart counts
  • Port and URL information for each service

Docker Container Management

Manage your Docker containers directly from the web interface:

  • Start, stop, and restart individual containers
  • View detailed container logs with real-time streaming
  • Execute commands inside running containers
  • Container resource limits and usage statistics

Database Query Interface

Execute SQL queries and manage your PostgreSQL database:

  • SQL query editor with syntax highlighting
  • Table browser with data preview
  • Schema visualization and foreign key relationships
  • Export query results to CSV or JSON

Log Viewer

Centralized logging with advanced filtering and search:

  • Real-time log streaming from all services
  • Filter by service, log level, or custom patterns
  • Full-text search across historical logs
  • Export and download log files

Backup Management

Create, restore, and manage database backups:

  • Create instant database backups
  • Schedule automated backup jobs
  • Download backups for local storage
  • Restore from any backup point-in-time

Configuration Editor

Edit environment variables and configuration files:

  • Visual editor for .env files
  • Validation and syntax checking
  • Apply configuration changes with automatic restart
  • Configuration diff and rollback capabilities

Admin Commands

The nself admin command provides complete control over the Admin UI:

# Enable the admin UI
nself admin enable

# Disable the admin UI
nself admin disable

# Check admin UI status
nself admin status

# Set or change password
nself admin password [PASSWORD]

# Reset admin to defaults
nself admin reset

# View admin container logs
nself admin logs

# Open admin UI in browser
nself admin open

Authentication

The Admin UI is protected by password authentication to ensure security:

  • Default URL: http://localhost:3100
  • Default Username: admin
  • Password: Set with nself admin password

If no password is set, the Admin UI generates a temporary password displayed during the nself admin enable command.

Security Considerations

The Admin UI is designed for local development and should be secured properly for production use:

  • Change the default password immediately
  • Consider disabling in production environments
  • Use reverse proxy with SSL for remote access
  • Monitor access logs for unauthorized attempts

Configuration

The Admin UI can be configured through environment variables:

# Enable/disable admin UI
NSELF_ADMIN_ENABLED=true

# Custom admin UI port (default: 3100)
NSELF_ADMIN_PORT=3100

# Admin username (default: admin)
NSELF_ADMIN_USER=admin

# Admin password (set via nself admin password)
NSELF_ADMIN_PASSWORD=your-secure-password

Troubleshooting

Admin UI won't start

If the Admin UI fails to start, check the following:

  • Ensure port 3100 is available (not used by another service)
  • Verify Docker is running and has sufficient resources
  • Check admin container logs: nself admin logs
  • Reset admin configuration: nself admin reset

Cannot access Admin UI

If you can't access the Admin UI in your browser:

  • Verify the service is running: nself admin status
  • Check if port 3100 is accessible: curl http://localhost:3100
  • Try opening with: nself admin open
  • Check firewall settings if accessing remotely

Password Issues

If you've forgotten your password or need to reset access:

  • Reset password: nself admin password newpassword
  • Reset entire admin configuration: nself admin reset
  • Disable and re-enable: nself admin disable && nself admin enable

Related Commands

The Admin UI integrates with other nself commands:

  • nself status - View service health (also available in Admin UI)
  • nself logs - Stream logs (also available in Admin UI)
  • nself db - Database operations (also available in Admin UI)
  • nself backup - Backup management (also available in Admin UI)

The Admin UI provides a graphical interface to many CLI operations, making it easier to manage your nself infrastructure, especially for team members who prefer web interfaces over command-line tools.