From 17b027da9b8cbaddbd47619e0ed0dd90e1dc4619 Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Wed, 25 Mar 2026 14:56:16 +0100 Subject: [PATCH] feat(teable): add Teable no-code database LXC script - NestJS backend serves both API and Next.js frontend on port 3000 - PostgreSQL 16 with Prisma ORM for database management - pnpm monorepo build with NODE_OPTIONS=8192MB heap - Symlink /app -> /opt/teable for upstream compatibility - 4 CPU / 10GB RAM / 25GB disk (heavy build process) --- ct/teable.sh | 82 ++++++++++++++++++++++++++++++++++++++ install/teable-install.sh | 84 +++++++++++++++++++++++++++++++++++++++ json/teable.json | 44 ++++++++++++++++++++ 3 files changed, 210 insertions(+) create mode 100644 ct/teable.sh create mode 100644 install/teable-install.sh create mode 100644 json/teable.json diff --git a/ct/teable.sh b/ct/teable.sh new file mode 100644 index 000000000..1c15bce89 --- /dev/null +++ b/ct/teable.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func) + +# Copyright (c) 2021-2026 community-scripts ORG +# Author: community-scripts +# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE +# Source: https://github.com/teableio/teable + +APP="Teable" +var_tags="${var_tags:-database;no-code;spreadsheet}" +var_cpu="${var_cpu:-4}" +var_ram="${var_ram:-10240}" +var_disk="${var_disk:-25}" +var_os="${var_os:-debian}" +var_version="${var_version:-13}" +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + + if [[ ! -d /opt/teable ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + if check_for_gh_release "teable" "teableio/teable"; then + msg_info "Stopping Service" + systemctl stop teable + msg_ok "Stopped Service" + + msg_info "Backing up Configuration" + cp /opt/teable/.env /opt/teable.env.bak + msg_ok "Backed up Configuration" + + CLEAN_INSTALL=1 fetch_and_deploy_gh_release "teable" "teableio/teable" "tarball" + + msg_info "Restoring Configuration" + mv /opt/teable.env.bak /opt/teable/.env + msg_ok "Restored Configuration" + + msg_info "Rebuilding Teable" + cd /opt/teable + TEABLE_VERSION=$(cat ~/.teable) + echo "NEXT_PUBLIC_BUILD_VERSION=\"${TEABLE_VERSION}\"" >>apps/nextjs-app/.env + export HUSKY=0 + export NODE_OPTIONS="--max-old-space-size=8192" + $STD pnpm install --frozen-lockfile + $STD pnpm -F @teable/db-main-prisma prisma-generate --schema ./prisma/postgres/schema.prisma + NODE_ENV=production NEXT_BUILD_ENV_TYPECHECK=false \ + $STD pnpm -r --filter '!playground' run build + msg_ok "Rebuilt Teable" + + msg_info "Running Database Migrations" + source /opt/teable/.env + $STD pnpm -F @teable/db-main-prisma prisma-migrate deploy --schema ./prisma/postgres/schema.prisma + msg_ok "Ran Database Migrations" + + msg_info "Starting Service" + systemctl start teable + msg_ok "Started Service" + msg_ok "Updated successfully!" + else + msg_ok "No update available." + fi + exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW} Access it using the following URL:${CL}" +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}" diff --git a/install/teable-install.sh b/install/teable-install.sh new file mode 100644 index 000000000..fc2f48121 --- /dev/null +++ b/install/teable-install.sh @@ -0,0 +1,84 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2026 community-scripts ORG +# Author: community-scripts +# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE +# Source: https://github.com/teableio/teable + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt install -y \ + build-essential \ + python3 \ + git +msg_ok "Installed Dependencies" + +NODE_VERSION="22" NODE_MODULE="pnpm" setup_nodejs +PG_VERSION="16" setup_postgresql +PG_DB_NAME="teable" PG_DB_USER="teable" setup_postgresql_db + +fetch_and_deploy_gh_release "teable" "teableio/teable" "tarball" + +msg_info "Setting up Teable" +cd /opt/teable +TEABLE_VERSION=$(cat ~/.teable) +echo "NEXT_PUBLIC_BUILD_VERSION=\"${TEABLE_VERSION}\"" >>apps/nextjs-app/.env +export HUSKY=0 +export NODE_OPTIONS="--max-old-space-size=8192" +$STD pnpm install --frozen-lockfile +$STD pnpm -F @teable/db-main-prisma prisma-generate --schema ./prisma/postgres/schema.prisma +msg_ok "Set up Teable" + +msg_info "Building Teable" +NODE_ENV=production NEXT_BUILD_ENV_TYPECHECK=false \ + $STD pnpm -r --filter '!playground' run build +msg_ok "Built Teable" + +msg_info "Running Database Migrations" +PRISMA_DATABASE_URL="postgresql://teable:${PG_DB_PASS}@localhost:5432/teable?schema=public" \ + $STD pnpm -F @teable/db-main-prisma prisma-migrate deploy --schema ./prisma/postgres/schema.prisma +msg_ok "Ran Database Migrations" + +msg_info "Configuring Teable" +SECRET_KEY=$(openssl rand -base64 32) +cat </opt/teable/.env +PRISMA_DATABASE_URL=postgresql://teable:${PG_DB_PASS}@localhost:5432/teable?schema=public&statement_cache_size=1 +PUBLIC_ORIGIN=http://${LOCAL_IP}:3000 +SECRET_KEY=${SECRET_KEY} +PORT=3000 +NODE_ENV=production +NEXT_TELEMETRY_DISABLED=1 +EOF +ln -sf /opt/teable /app +msg_ok "Configured Teable" + +msg_info "Creating Service" +cat </etc/systemd/system/teable.service +[Unit] +Description=Teable +After=network.target postgresql.service + +[Service] +Type=simple +WorkingDirectory=/opt/teable +EnvironmentFile=/opt/teable/.env +ExecStart=/usr/bin/node apps/nestjs-backend/dist/index.js +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now teable +msg_ok "Created Service" + +motd_ssh +customize +cleanup_lxc diff --git a/json/teable.json b/json/teable.json new file mode 100644 index 000000000..2f9efda7b --- /dev/null +++ b/json/teable.json @@ -0,0 +1,44 @@ +{ + "name": "Teable", + "slug": "teable", + "categories": [ + 8 + ], + "date_created": "2026-03-25", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 3000, + "documentation": "https://help.teable.io/", + "website": "https://teable.io/", + "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/teable.webp", + "config_path": "/opt/teable/.env", + "description": "Teable is a super-fast, open-source no-code database built on PostgreSQL with a spreadsheet-like interface for building applications.", + "install_methods": [ + { + "type": "default", + "script": "ct/teable.sh", + "resources": { + "cpu": 4, + "ram": 10240, + "hdd": 25, + "os": "Debian", + "version": "13" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [ + { + "text": "Minimum 10GB RAM recommended. The build process is very resource-intensive.", + "type": "warning" + }, + { + "text": "Configuration is stored in `/opt/teable/.env`.", + "type": "info" + } + ] +}