The nile local command helps you manage a local development environment using Docker. This environment provides a PostgreSQL database pre-configured with Nile’s schema and features.

Overview

nile local [command] [options]

Available commands:

  • start - Start the local environment
  • stop - Stop the local environment
  • info - Display connection information

Prerequisites

Before using the local environment, ensure you have:

  1. Docker installed and running
  2. PostgreSQL client tools (psql) installed
  3. Sufficient permissions to run Docker commands
Prerequisites Check
# Check Docker installation
docker --version

# Check PostgreSQL tools
psql --version

Starting the Environment

The start command launches a Docker container with a pre-configured PostgreSQL database.

nile local start [options]

Options

FlagDescriptionDefault
--no-promptStart without prompting for psql connectionfalse

Examples

Start Examples
# Start with interactive prompt
nile local start

# Start without psql prompt
nile local start --no-prompt

Sample Output

Start Output
✓ Latest Nile testing container pulled successfully
✓ Database is ready
✓ Local development environment started successfully

Connection Information:
Host:     localhost
Port:     5432
Database: test
Username: 00000000-0000-0000-0000-000000000000
Password: password

Would you like to connect using psql? (y/N)

Stopping the Environment

The stop command gracefully stops and removes the Docker container.

nile local stop

Examples

Stop Examples
# Stop the environment
nile local stop

Sample Output

Stop Output
✓ Local environment stopped successfully

Viewing Connection Information

The info command displays connection details for the running environment.

nile local info

Examples

Info Examples
# Show connection information
nile local info

# Show with debug information
nile local info --debug

Sample Output

Info Output
Connection Information:
Host:     localhost
Port:     5432
Database: test
Username: 00000000-0000-0000-0000-000000000000
Password: password

Common Workflows

Starting Development Session

Development Setup
# 1. Start the environment
nile local start

# 2. Connect using psql (if prompted)
# Or use connection information with your preferred client

# 3. Start development

# 4. Stop when finished
nile local stop

Using with Database Tools

Database Tools
# Get connection information
nile local info

# Use with your preferred database tool
# Example: TablePlus, DBeaver, pgAdmin, etc.

Debugging Connection Issues

Debug Example
# Start with debug output
nile local start --debug

# Check connection information
nile local info --debug

Common Issues

Container Already Running

Container Running
# Start attempt with existing container
nile local start
Error: A Nile local environment is already running

# Solution: Stop existing container
nile local stop

PostgreSQL Client Missing

Missing PSQL
# When psql is not installed
Error: Failed to launch psql

# Solution: Install PostgreSQL client tools
# macOS:
brew install postgresql

# Ubuntu:
sudo apt-get install postgresql-client

Docker Not Running

Docker Not Running
# When Docker daemon is not running
Error: Docker failed to start

# Solution: Start Docker daemon
# macOS: Start Docker Desktop
# Linux: sudo systemctl start docker

Best Practices

  1. Clean Environment: Always stop the environment when not in use:

    nile local stop
    
  2. Connection Management: Save connection information for reuse:

    nile local info > connection.txt
    
  3. Debug Mode: Use debug flag when encountering issues:

    nile local start --debug
    
  • nile db - Manage cloud databases
  • nile tenants - Manage tenants
  • nile users - Manage users
  • nile config - Configure CLI settings

Environment Variables

The local environment uses these default values:

Environment
POSTGRES_USER=00000000-0000-0000-0000-000000000000
POSTGRES_PASSWORD=password
POSTGRES_DB=test
POSTGRES_PORT=5432

Security Notes

  1. The local environment is for development only
  2. Default credentials should never be used in production
  3. The environment is not encrypted by default
  4. Container is accessible only from localhost

Was this page helpful?