docker.recipes

NocoDB No-Code Database

beginner

NocoDB turns any database into a smart spreadsheet with API generation.

Overview

NocoDB is an open-source no-code platform that transforms any database into a smart, collaborative spreadsheet interface while automatically generating REST and GraphQL APIs. Created as an Airtable alternative, NocoDB bridges the gap between traditional databases and user-friendly spreadsheet interfaces, making database management accessible to non-technical users while providing powerful APIs for developers. This Docker stack combines NocoDB with PostgreSQL 16 to create a production-ready no-code database environment. PostgreSQL serves as the robust backend storage engine, providing ACID compliance and enterprise-grade reliability, while NocoDB creates the intuitive spreadsheet interface on top. The combination leverages PostgreSQL's advanced features like JSON support and full-text search through NocoDB's visual interface, eliminating the need for complex SQL queries. This stack is ideal for teams wanting to democratize database access without sacrificing data integrity or performance. Business users can create and manage data through familiar spreadsheet-like interfaces, while developers can integrate with generated APIs. The PostgreSQL foundation ensures the system can scale from prototype to production, supporting complex relationships and queries that simpler no-code solutions cannot handle.

Key Features

  • Automatic REST and GraphQL API generation from database tables with real-time documentation
  • Spreadsheet-like interface with drag-and-drop column management and data validation
  • Multiple view types including grid, gallery, kanban, and calendar views for different data perspectives
  • Form builder for external data collection with customizable fields and validation rules
  • PostgreSQL's JSON/JSONB support through NocoDB's interface for flexible schema design
  • Role-based access control with granular permissions at table and column levels
  • Real-time collaboration features with change tracking and user activity logs
  • Webhook support for automated workflows and third-party integrations

Common Use Cases

  • 1Small businesses replacing Airtable or Google Sheets with a self-hosted solution
  • 2Development teams creating admin panels and CRUD interfaces without frontend coding
  • 3Non-profit organizations managing donor databases and volunteer coordination systems
  • 4Educational institutions tracking student data and course management
  • 5Startup MVPs requiring rapid database prototyping with instant API access
  • 6Project management teams needing custom workflows beyond traditional tools
  • 7Content management systems with user-friendly interfaces for non-technical editors

Prerequisites

  • Docker and Docker Compose installed on the host system
  • Minimum 1GB RAM available (PostgreSQL requirement plus NocoDB overhead)
  • Port 8080 available on the host for NocoDB web interface access
  • Environment variables configured: POSTGRES_USER, POSTGRES_PASSWORD, NC_AUTH_JWT_SECRET, NC_PUBLIC_URL
  • Basic understanding of database concepts for effective table design
  • SSL certificate and reverse proxy setup recommended for production deployments

For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

docker-compose.yml

docker-compose.yml
1services:
2 nocodb:
3 image: nocodb/nocodb:latest
4 container_name: nocodb
5 environment:
6 - NC_DB=pg://postgres:5432?u=${POSTGRES_USER}&p=${POSTGRES_PASSWORD}&d=nocodb
7 - NC_AUTH_JWT_SECRET=${NC_AUTH_JWT_SECRET}
8 - NC_PUBLIC_URL=${NC_PUBLIC_URL}
9 - NC_DISABLE_TELE=true
10 ports:
11 - "8080:8080"
12 volumes:
13 - nocodb_data:/usr/app/data
14 depends_on:
15 postgres:
16 condition: service_healthy
17 networks:
18 - nocodb-network
19
20 postgres:
21 image: postgres:16-alpine
22 container_name: nocodb-db
23 environment:
24 - POSTGRES_USER=${POSTGRES_USER}
25 - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
26 - POSTGRES_DB=nocodb
27 volumes:
28 - postgres_data:/var/lib/postgresql/data
29 healthcheck:
30 test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
31 interval: 10s
32 timeout: 5s
33 retries: 5
34 networks:
35 - nocodb-network
36
37volumes:
38 nocodb_data:
39 postgres_data:
40
41networks:
42 nocodb-network:
43 driver: bridge

.env Template

.env
1# NocoDB
2POSTGRES_USER=nocodb
3POSTGRES_PASSWORD=nocodb_password
4NC_AUTH_JWT_SECRET=your-jwt-secret
5NC_PUBLIC_URL=http://localhost:8080

Usage Notes

  1. 1UI at http://localhost:8080
  2. 2Create tables like spreadsheets
  3. 3Auto-generates REST & GraphQL APIs
  4. 4Supports views, forms, galleries
  5. 5Can connect to existing databases

Individual Services(2 services)

Copy individual services to mix and match with your existing compose files.

nocodb
nocodb:
  image: nocodb/nocodb:latest
  container_name: nocodb
  environment:
    - NC_DB=pg://postgres:5432?u=${POSTGRES_USER}&p=${POSTGRES_PASSWORD}&d=nocodb
    - NC_AUTH_JWT_SECRET=${NC_AUTH_JWT_SECRET}
    - NC_PUBLIC_URL=${NC_PUBLIC_URL}
    - NC_DISABLE_TELE=true
  ports:
    - "8080:8080"
  volumes:
    - nocodb_data:/usr/app/data
  depends_on:
    postgres:
      condition: service_healthy
  networks:
    - nocodb-network
postgres
postgres:
  image: postgres:16-alpine
  container_name: nocodb-db
  environment:
    - POSTGRES_USER=${POSTGRES_USER}
    - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
    - POSTGRES_DB=nocodb
  volumes:
    - postgres_data:/var/lib/postgresql/data
  healthcheck:
    test:
      - CMD-SHELL
      - pg_isready -U ${POSTGRES_USER}
    interval: 10s
    timeout: 5s
    retries: 5
  networks:
    - nocodb-network

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 nocodb:
5 image: nocodb/nocodb:latest
6 container_name: nocodb
7 environment:
8 - NC_DB=pg://postgres:5432?u=${POSTGRES_USER}&p=${POSTGRES_PASSWORD}&d=nocodb
9 - NC_AUTH_JWT_SECRET=${NC_AUTH_JWT_SECRET}
10 - NC_PUBLIC_URL=${NC_PUBLIC_URL}
11 - NC_DISABLE_TELE=true
12 ports:
13 - "8080:8080"
14 volumes:
15 - nocodb_data:/usr/app/data
16 depends_on:
17 postgres:
18 condition: service_healthy
19 networks:
20 - nocodb-network
21
22 postgres:
23 image: postgres:16-alpine
24 container_name: nocodb-db
25 environment:
26 - POSTGRES_USER=${POSTGRES_USER}
27 - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
28 - POSTGRES_DB=nocodb
29 volumes:
30 - postgres_data:/var/lib/postgresql/data
31 healthcheck:
32 test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
33 interval: 10s
34 timeout: 5s
35 retries: 5
36 networks:
37 - nocodb-network
38
39volumes:
40 nocodb_data:
41 postgres_data:
42
43networks:
44 nocodb-network:
45 driver: bridge
46EOF
47
48# 2. Create the .env file
49cat > .env << 'EOF'
50# NocoDB
51POSTGRES_USER=nocodb
52POSTGRES_PASSWORD=nocodb_password
53NC_AUTH_JWT_SECRET=your-jwt-secret
54NC_PUBLIC_URL=http://localhost:8080
55EOF
56
57# 3. Start the services
58docker compose up -d
59
60# 4. View logs
61docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/nocodb-database-platform/run | bash

Troubleshooting

  • NocoDB fails to connect to database: Verify PostgreSQL container is healthy and environment variables match between services
  • Permission denied errors in NocoDB: Check that nocodb_data volume has correct ownership and write permissions
  • API requests return 401 unauthorized: Regenerate NC_AUTH_JWT_SECRET and restart nocodb container
  • PostgreSQL container exits with 'database system was interrupted': Remove postgres_data volume and restart to reinitialize database
  • NocoDB interface loads but shows connection errors: Ensure NC_DB connection string format matches PostgreSQL credentials exactly
  • Slow performance with large datasets: Increase PostgreSQL shared_buffers and work_mem through environment variables or custom postgresql.conf

Community Notes

Loading...
Loading notes...

Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license

Ad Space