# ToolJet Internal Tools

> Open-source low-code platform for building internal tools.

- Category: Productivity & Collaboration
- Difficulty: intermediate
- Components: tooljet, postgresql, redis
- Tags: tooljet, internal-tools, low-code, dashboards, admin
- Source: https://docker.recipes/productivity/tooljet-internal

## Overview

ToolJet is an open-source low-code platform that enables developers and business users to rapidly build internal tools, admin panels, and custom applications without extensive coding. Launched as a self-hosted alternative to tools like Retool and Appsmith, ToolJet features a visual drag-and-drop interface builder with 45+ pre-built UI components, supports 40+ data source integrations including REST APIs, databases, and third-party services, and allows custom JavaScript for advanced functionality. This stack combines ToolJet with PostgreSQL as the metadata and application storage backend, while Redis handles caching, session management, and real-time features like collaborative editing and live data updates. PostgreSQL stores ToolJet's internal configuration, user permissions, application definitions, and query metadata, while Redis accelerates the platform by caching frequently accessed data sources, maintaining WebSocket connections for real-time collaboration, and storing temporary query results. This configuration is ideal for teams wanting to deploy a production-ready internal tools platform that can handle multiple concurrent users building and using custom applications, with the reliability of PostgreSQL for data persistence and the performance boost of Redis for interactive features.

## Features

- Visual application builder with 45+ UI components including tables, charts, forms, and custom widgets
- Multi-database query engine supporting PostgreSQL, MySQL, MongoDB, REST APIs, and 40+ data sources
- Real-time collaborative editing powered by Redis WebSocket connections and session synchronization
- Advanced PostgreSQL-backed permissions system with granular access control and multi-workspace support
- Redis-cached query results and data source connections for sub-second application loading times
- Custom JavaScript code execution with secure sandboxing for advanced business logic
- Built-in workflow automation with triggers, transformations, and external service integrations
- PostgreSQL JSONB storage for flexible application schemas and rapid UI component configuration changes

## Use cases

- Customer support dashboards connecting CRM data, support tickets, and user analytics from multiple APIs
- Internal admin panels for e-commerce platforms managing inventory, orders, and customer data across databases
- Data visualization tools for business intelligence combining PostgreSQL analytics with Redis-cached real-time metrics
- Employee onboarding workflows integrating HR systems, IT provisioning, and document management platforms
- Operations dashboards for DevOps teams monitoring application metrics, deployment status, and infrastructure data
- Content management interfaces for marketing teams handling campaigns, social media, and customer communications
- Financial reporting tools connecting accounting systems, payment processors, and business intelligence platforms

## Prerequisites

- Minimum 2GB RAM for ToolJet application server plus 1GB for PostgreSQL and 512MB for Redis
- Docker and Docker Compose installed with support for health checks and multi-service networking
- Port 80 available for ToolJet web interface, or alternative port configuration knowledge
- Understanding of environment variable management for database credentials and encryption keys
- Basic knowledge of PostgreSQL administration for backup, monitoring, and performance tuning
- Familiarity with Redis persistence concepts for cache durability and session storage requirements

## docker-compose.yml

```yaml
services:
  tooljet:
    image: tooljet/tooljet-ce:latest
    ports:
      - "80:80"
    environment:
      TOOLJET_HOST: http://localhost
      PG_HOST: postgres
      PG_DB: ${POSTGRES_DB}
      PG_USER: ${POSTGRES_USER}
      PG_PASS: ${POSTGRES_PASSWORD}
      LOCKBOX_MASTER_KEY: ${LOCKBOX_KEY}
      SECRET_KEY_BASE: ${SECRET_KEY}
      REDIS_HOST: redis
    depends_on:
      postgres:
        condition: service_healthy
      redis:
        condition: service_started
    networks:
      - tooljet-net
    restart: unless-stopped

  postgres:
    image: postgres:16-alpine
    environment:
      POSTGRES_USER: ${POSTGRES_USER}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
      POSTGRES_DB: ${POSTGRES_DB}
    volumes:
      - postgres_data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
      interval: 10s
      timeout: 5s
      retries: 5
    networks:
      - tooljet-net
    restart: unless-stopped

  redis:
    image: redis:7-alpine
    volumes:
      - redis_data:/data
    networks:
      - tooljet-net
    restart: unless-stopped

volumes:
  postgres_data:
  redis_data:

networks:
  tooljet-net:
    driver: bridge
```

## .env

```bash
# PostgreSQL
POSTGRES_USER=tooljet
POSTGRES_PASSWORD=secure_postgres_password
POSTGRES_DB=tooljet

# ToolJet
LOCKBOX_KEY=$(openssl rand -hex 32)
SECRET_KEY=$(openssl rand -hex 64)
```

## Usage notes

- ToolJet at http://localhost
- Drag-and-drop UI builder
- Connect to databases, APIs, and more
- Build admin panels and dashboards

## Troubleshooting

- ToolJet shows database connection errors: Verify POSTGRES_USER, POSTGRES_PASSWORD, and POSTGRES_DB environment variables match between services, and ensure PostgreSQL health check is passing
- Application loads slowly or timeouts occur: Check Redis container status and increase Redis memory allocation, verify REDIS_HOST environment variable points to redis service name
- ToolJet fails to start with 'Lockbox key invalid': Generate a new 32-character LOCKBOX_MASTER_KEY and SECRET_KEY_BASE using secure random generators, restart all services after updating
- PostgreSQL container exits with permission errors: Ensure postgres_data volume has correct ownership permissions, or remove volume and recreate with proper Docker user mapping
- Redis data loss after container restart: Add Redis persistence configuration by mounting redis.conf with save intervals, or accept ephemeral cache behavior for session-only data
- ToolJet web interface shows 502 Bad Gateway: Check if ToolJet container finished initialization by examining logs for 'Server running on port 80' message, database migrations may still be processing

