# NocoDB Airtable Alternative

> Open source Airtable alternative that turns databases into smart spreadsheets.

- Category: Productivity & Collaboration
- Difficulty: beginner
- Components: nocodb, postgresql, redis, minio
- Tags: nocodb, airtable, spreadsheet, database, no-code
- Source: https://docker.recipes/productivity/nocodb-airtable

## Overview

NocoDB transforms any database into a smart spreadsheet interface, providing a powerful open-source alternative to Airtable. Originally created in 2021, NocoDB addresses the gap between traditional database management and user-friendly spreadsheet interfaces, allowing non-technical users to interact with complex data while maintaining the power and reliability of SQL databases. It automatically generates REST APIs, supports multiple database backends, and provides collaborative features that make database management accessible to teams without extensive technical expertise.

This stack combines NocoDB with PostgreSQL for robust data storage, Redis for caching and session management, and MinIO for S3-compatible file storage. PostgreSQL provides ACID compliance and advanced querying capabilities that surpass simple flat-file databases, while Redis accelerates NocoDB's performance through intelligent caching of frequently accessed data and metadata. MinIO handles file attachments, images, and documents uploaded through NocoDB's interface, providing scalable object storage without vendor lock-in to cloud providers.

Teams transitioning from Airtable, startups building data-driven applications, and organizations requiring self-hosted database solutions will find this configuration particularly valuable. The combination eliminates subscription costs while providing enterprise-grade features like advanced data types, complex relationships, and unlimited records. Unlike cloud-based alternatives, this stack gives complete control over data location, security policies, and customization options while maintaining the intuitive spreadsheet-like interface that makes databases accessible to business users.

## Features

- Automatic REST API generation with authentication and rate limiting for any connected database
- Real-time collaborative editing with conflict resolution and user presence indicators
- Advanced data types including JSON fields, file attachments, and computed columns with formulas
- PostgreSQL-powered complex relationships with foreign keys, many-to-many joins, and referential integrity
- Redis-accelerated metadata caching for sub-second response times on large datasets
- MinIO-integrated file handling supporting direct uploads, image thumbnails, and version control
- Multi-database connectivity supporting MySQL, SQLite, and external PostgreSQL instances
- Granular permission system with role-based access control and field-level security

## Use cases

- Migrating from Airtable while maintaining existing workflows and user interfaces
- Building customer relationship management systems with file attachments and complex data relationships
- Creating internal business applications like inventory management, project tracking, or employee databases
- Developing data collection portals for surveys, applications, or feedback systems with public forms
- Establishing document management systems combining structured metadata with file storage
- Implementing content management for blogs, portfolios, or marketing campaigns with media assets
- Setting up development environments where teams need shared access to test data and configurations

## Prerequisites

- Minimum 2GB RAM for all services (NocoDB requires 512MB, PostgreSQL 1GB, Redis 256MB, MinIO 512MB)
- Available ports 8080 (NocoDB), 9000 (MinIO API), and 9001 (MinIO Console)
- Environment variables configured: POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB, JWT_SECRET, MINIO_ACCESS_KEY, MINIO_SECRET_KEY
- Basic understanding of database concepts like tables, relationships, and data types
- Docker Compose v2.0+ with support for health checks and service dependencies
- At least 10GB free disk space for PostgreSQL data, Redis persistence, and MinIO object storage

## docker-compose.yml

```yaml
services:
  nocodb:
    image: nocodb/nocodb:latest
    ports:
      - "8080:8080"
    environment:
      NC_DB: pg://postgres:5432?u=${POSTGRES_USER}&p=${POSTGRES_PASSWORD}&d=${POSTGRES_DB}
      NC_AUTH_JWT_SECRET: ${JWT_SECRET}
      NC_S3_ACCESS_KEY: ${MINIO_ACCESS_KEY}
      NC_S3_ACCESS_SECRET: ${MINIO_SECRET_KEY}
      NC_S3_BUCKET_NAME: nocodb
      NC_S3_ENDPOINT: http://minio:9000
    volumes:
      - nocodb_data:/usr/app/data
    depends_on:
      postgres:
        condition: service_healthy
      minio:
        condition: service_started
    networks:
      - nocodb-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:
      - nocodb-net
    restart: unless-stopped

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

  minio:
    image: minio/minio:latest
    ports:
      - "9000:9000"
      - "9001:9001"
    environment:
      MINIO_ROOT_USER: ${MINIO_ACCESS_KEY}
      MINIO_ROOT_PASSWORD: ${MINIO_SECRET_KEY}
    volumes:
      - minio_data:/data
    command: server /data --console-address ":9001"
    networks:
      - nocodb-net
    restart: unless-stopped

volumes:
  nocodb_data:
  postgres_data:
  redis_data:
  minio_data:

networks:
  nocodb-net:
    driver: bridge
```

## .env

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

# NocoDB
JWT_SECRET=$(openssl rand -hex 32)

# MinIO
MINIO_ACCESS_KEY=minioadmin
MINIO_SECRET_KEY=secure_minio_password
```

## Usage notes

- NocoDB at http://localhost:8080
- Connect to existing databases
- Create API endpoints automatically
- MinIO Console at http://localhost:9001

## Troubleshooting

- NocoDB shows 'Database connection failed': Verify PostgreSQL container is healthy and environment variables match between services
- File uploads return 'S3 connection error': Check MinIO container logs and ensure NC_S3_ENDPOINT uses correct internal hostname 'minio:9000'
- PostgreSQL container exits with 'initdb: error': Remove postgres_data volume and restart to reinitialize with correct credentials
- Redis connection timeouts in NocoDB logs: Add NC_REDIS_URL environment variable pointing to 'redis://redis:6379' if Redis integration is enabled
- MinIO Console inaccessible at localhost:9001: Ensure MINIO_ROOT_USER and MINIO_ROOT_PASSWORD are properly set and container has started completely
- NocoDB API responses are slow with large datasets: Increase Redis memory limit and verify PostgreSQL has adequate shared_buffers configuration

