Skip to main content

Prerequisites

Before installing Energy CMMS, ensure you have the following prerequisites:
  • Python 3.11 or higher
  • PostgreSQL 12 or higher
  • Redis 7.x
  • Git
  • Docker and Docker Compose (for containerized deployment)
Energy CMMS requires a PostgreSQL database with the pgvector extension for AI-powered semantic search functionality.

Installation Methods

# Clone the repository
git clone <repository-url>
cd energia

# Create and activate virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install --upgrade pip
pip install -r requirements.txt

# Install Playwright browsers (for PDF processing)
playwright install --with-deps chromium

# Set up environment variables
cp .env.example .env
# Edit .env with your configuration

# Run database migrations
python manage.py migrate

# Create superuser
python manage.py createsuperuser

# Collect static files
python manage.py collectstatic --noinput

# Start development server
python manage.py runserver

Core Dependencies

Energy CMMS includes the following major dependencies:

Framework & Web Server

  • Django 5.1.5+: Core web framework
  • Gunicorn: WSGI HTTP server for production
  • WhiteNoise: Static file serving

Database & ORM

  • psycopg 3.2.3: PostgreSQL adapter
  • dj-database-url: Database URL parser
  • pgvector: Vector similarity search for AI features

Task Queue & Caching

  • Celery 5.4.0: Distributed task queue
  • Redis 5.2.1: Message broker and cache backend
  • django-celery-results: Task result storage
  • Channels: WebSocket support
  • channels-redis: Redis channel layer

Admin Interface

  • django-jazzmin 3.0.1: Modern admin theme
  • django-import-export 4.3.8: Data import/export functionality
  • django-mptt: Hierarchical data structures
  • django-colorfield: Color picker fields

File Processing & Storage

  • Pillow 11.2.1: Image processing
  • django-storages: Cloud storage backends
  • boto3: AWS S3/MinIO integration
  • Playwright: Automated PDF processing

Data Analysis & Visualization

  • pandas 2.3.0: Data manipulation
  • numpy 2.3.1: Numerical computing
  • matplotlib: Data visualization
  • openpyxl: Excel file handling

AI & Machine Learning

  • google-generativeai: Google Gemini AI integration
  • msal: Microsoft authentication (for Dynamics 365 integration)

Utilities

  • python-dotenv: Environment variable management
  • requests: HTTP library
  • qrcode: QR code generation
  • django-cors-headers: CORS handling

Post-Installation Steps

1

Verify Installation

Check that all services are running correctly:
# Check Django is running
curl http://localhost:8000/admin/

# Check Redis connection
redis-cli ping  # Should return: PONG

# Check Celery worker
celery -A energia inspect ping
2

Configure Storage

Energy CMMS uses MinIO (S3-compatible storage) for media files. Ensure your MinIO instance is running and accessible:
# Test MinIO connection
curl http://your-minio-host:9000/minio/health/live
3

Set Up AI Features (Optional)

To enable AI-powered semantic search and document processing:
  1. Obtain a Google Gemini API key from Google AI Studio
  2. Add to your .env file:
    GEMINI_API_KEY=your-api-key-here
    
Without a Gemini API key, semantic search functionality will not be available.
4

Configure n8n Integration (Optional)

For workflow automation and document processing:
  1. Set up n8n instance
  2. Configure webhooks in your .env:
    N8N_WEBHOOK_URL=http://n8n:5678/webhook/nuevo-documento
    N8N_CHAT_WEBHOOK_URL=http://n8n:5678/webhook/chat-documento
    N8N_EXTRACT_TEXTO_WEBHOOK_URL=http://n8n:5678/webhook/extract-text
    
5

Access the Application

Open your browser and navigate to:
  • Admin interface: http://localhost:8000/admin/
  • Main portal: http://localhost:8000/portal/

Docker Compose Services

The docker-compose.yml includes the following services:
ServiceDescriptionPortMemory
webDjango + Gunicorn (3 workers)8000~300-500MB
redisMessage broker & cache6379~50-100MB
celery_workerBackground task processor-~200-300MB
celery_beatPeriodic task scheduler-~100-150MB
Total resource usage: approximately 650-1050MB RAM

Troubleshooting

Installation Fails on Playwright

# Install system dependencies manually
sudo apt-get update
sudo apt-get install -y libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 \
  libcups2 libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 \
  libxrandr2 libgbm1 libpango-1.0-0 libcairo2 libasound2

# Then retry Playwright installation
playwright install chromium

Database Connection Error

If you see OperationalError: could not connect to server:
  1. Verify PostgreSQL is running:
    sudo systemctl status postgresql
    
  2. Check your DATABASE_URL format:
    postgresql://user:password@host:5432/database_name
    
  3. Ensure the database exists:
    createdb energia_db
    

Redis Connection Failed

If Celery cannot connect to Redis:
# Check Redis is running
systemctl status redis

# Test connection
redis-cli ping

# Verify CELERY_BROKER_URL in .env matches your Redis configuration

Import Errors

If you encounter module import errors:
# Ensure virtual environment is activated
source venv/bin/activate

# Reinstall dependencies
pip install -r requirements.txt --force-reinstall

Next Steps

Configuration

Configure environment variables and settings

First Steps

Learn how to use Energy CMMS

Build docs developers (and LLMs) love