# NocoDB

> Turn any database into a smart spreadsheet.

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

## Overview

NocoDB is an open-source platform that transforms any database into a smart spreadsheet interface, providing an Airtable-like experience without vendor lock-in. Built with modern web technologies, NocoDB supports multiple database backends including PostgreSQL, MySQL, SQLite, and SQL Server, making it a versatile solution for teams who want spreadsheet simplicity with database power. The platform generates REST APIs automatically, offers real-time collaboration features, and provides advanced functionality like form views, gallery views, and kanban boards.

This Docker stack combines NocoDB with PostgreSQL to create a complete, self-hosted database management solution. PostgreSQL serves as the robust backend database engine, while NocoDB provides the intuitive web interface and API layer. This combination eliminates the need for complex database administration tools while maintaining full SQL capabilities underneath the user-friendly interface.

This setup is ideal for development teams, small businesses, and organizations seeking data sovereignty without sacrificing usability. Unlike cloud-based alternatives, this stack runs entirely on your infrastructure, giving you complete control over your data while providing the collaborative features modern teams expect. The PostgreSQL backend ensures enterprise-grade reliability and performance, while NocoDB's interface makes database interactions accessible to non-technical team members.

## Features

- Visual database schema designer with drag-and-drop table creation and relationship management
- Multiple view types including grid, gallery, form, and kanban views for different data visualization needs
- Automatic REST API generation with authentication and role-based access control
- Real-time collaboration with user permissions, comments, and activity tracking
- PostgreSQL backend providing ACID compliance, full-text search, and advanced indexing capabilities
- Form builder for external data collection with customizable fields and validation rules
- Database import functionality supporting CSV, Excel, and direct database connections
- Webhook integrations and automation triggers for connecting with external services

## Use cases

- Customer relationship management (CRM) systems for small to medium businesses
- Project management and task tracking with team collaboration features
- Content management for blogs, documentation, and marketing materials
- Inventory management and product catalog administration
- Event planning and attendee management with form-based registration
- Data collection and survey management with public form interfaces
- Personal knowledge bases and information organization systems

## Prerequisites

- Docker and Docker Compose installed on the host system
- Minimum 2GB RAM available for PostgreSQL and NocoDB containers
- Port 8080 available for NocoDB web interface access
- Basic understanding of environment variables for database password configuration
- Sufficient disk space for PostgreSQL data volume (recommend 10GB minimum)
- Network connectivity for initial container image downloads

## docker-compose.yml

```yaml
services:
  nocodb:
    image: nocodb/nocodb:latest
    container_name: nocodb
    restart: unless-stopped
    environment:
      NC_DB: "pg://postgres:5432?u=nocodb&p=${DB_PASSWORD}&d=nocodb"
    ports:
      - "8080:8080"
    depends_on:
      - postgres
    networks:
      - nocodb

  postgres:
    image: postgres:15-alpine
    container_name: nocodb-postgres
    restart: unless-stopped
    environment:
      POSTGRES_USER: nocodb
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_DB: nocodb
    volumes:
      - postgres_data:/var/lib/postgresql/data
    networks:
      - nocodb

volumes:
  postgres_data:

networks:
  nocodb:
    driver: bridge
```

## .env

```bash
DB_PASSWORD=changeme
```

## Usage notes

- Access at http://localhost:8080
- Airtable alternative
- Works with existing databases

## Troubleshooting

- Database connection failed errors: Verify the DB_PASSWORD environment variable matches between NocoDB and PostgreSQL containers
- NocoDB container fails to start: Check if PostgreSQL container is fully initialized by examining logs with docker logs nocodb-postgres
- Permission denied on PostgreSQL data volume: Ensure the host directory has proper permissions or remove the volume to use Docker-managed storage
- Cannot access NocoDB interface: Verify port 8080 is not blocked by firewall and no other services are using this port
- Slow query performance: Monitor PostgreSQL memory usage and consider increasing shared_buffers in PostgreSQL configuration
- NocoDB shows blank page: Clear browser cache and check browser console for JavaScript errors, ensure containers can communicate on the nocodb network

