Appsmith Dashboard over Postgres and Ollama
On a local AI server of the NVIDIA GB10 class we build a morning dashboard for a manager: four live figures and two lists from the database, and a short briefing written by a local model. It all runs in Docker, the model never leaves the machine, and the dashboard sees only what we allow it to see.
llama3.1:70b model (about 43 GB, while an Appsmith query waits only 10 seconds by default), the old /api/generate format with a prompt and amounts in "lev" (it is now /api/chat with messages, and amounts are in EUR), the mandatory n8n run at 7:00 (it is simpler to start the briefing from a button; n8n stays optional), the cameras through another service (here they are a devices table), Telegram, and the claim that the Text widget renders Markdown (we did not verify it). We added: the appsmith/appsmith-ce image at version v2.4.3 (an ARM64 build exists), the Apache 2.0 licence of the Community Edition, Postgres 18 and Ollama 0.35.0 pinned in .env, Ollama as an internal service with no published port, a separate database role with only the rights it needs, secrets generated on the spot, fictional data, a JS Object with setInterval, a 60-second query timeout, backups of the database and of Appsmith, and an SSH tunnel. All data in the lesson is fictional.
127.0.0.1:8080 instead of port 80 (the documentation shows 80 and 443), the SQL file with the demo data, the exact names of settings in the Appsmith interface, and model speed. We could not read the GitHub releases page, so version v2.4.3 rests on the Docker Hub tag.01What you'll learn
- What Appsmith does and why it suits an internal dashboard without writing a web page.
- How to run Appsmith, Postgres and Ollama in one Docker Compose project.
- How to give the dashboard its own database role with minimal rights.
- How to connect the database and build four figures, a table and a chart with SQL queries.
- How to call a local model through the Ollama REST API and store the briefing in the database.
- How to make the figures "live" and how to back up the data.
02Before you start
- A machine of the NVIDIA GB10 class (for example ASUS Ascent GX10 or DGX Spark) with DGX OS (Ubuntu 24.04 for Arm64), set up through first boot.
- Access to the machine's terminal — directly or over SSH.
- Docker and the NVIDIA Container Toolkit — preinstalled on DGX Spark (per NVIDIA's documentation). If Docker asks for
sudo, put it in front of the commands. - Internet access to download images and models. Appsmith's documentation asks for outbound access to
cs.appsmith.com. - Memory: the ready-made Appsmith image carries MongoDB, Redis and PostgreSQL inside itself and, per its documentation, wants at least 8 GB on the host. On GB10 the memory is shared with the GPU, so leave room for the model.
- A little SQL — just
SELECTandINSERT.
| What | Value (checked on 01.10.2026) |
|---|---|
| Appsmith Community Edition | image appsmith/appsmith-ce, latest version v2.4.3 (Docker Hub, 30.09.2026), a linux/arm64 build exists |
| Licence | Apache License 2.0 (the LICENSE file in the Appsmith repository) |
| Postgres | image postgres:18, a linux/arm64 build exists |
| Ollama | image ollama/ollama:0.35.0, a linux/arm64 build exists |
appsmith-ee image (the Commercial edition with a free plan) and says that for Community you replace appsmith-ee with appsmith-ce. Here we use the Community Edition because its code is licensed under Apache 2.0. ⚠️ We did not compare what exactly you get in the Commercial free plan — see the documentation if that matters to you.03Steps
-
What will sit where
In the end you will have three containers in one project. Why containers? Each program comes with everything it needs, does not get in the way of the others, and is removed with one command.
Service What it is for Access Appsmith The dashboard — screens, queries, charts only 127.0.0.1:8080on the machinePostgres The dashboard's data (fictional) internal, no published port Ollama The local model that writes the briefing internal, no published port Services find each other by the name in the compose file: the database is
postgres, the model isollama. Inside a container,localhostis the container itself. -
Check the machine
bash · on the machineuname -m docker --version docker compose versionYou expect
aarch64and Compose v2. If you have gone through the n8n lesson, Docker is already checked — the dashboard stack is a separate project and can run next to it. ⚠️ We have not tried the two stacks at the same time on one machine. -
Folder and secrets file
Passwords are not written in the compose file. We keep them in
.env— Compose reads it by itself. We generate them on the spot. Two different passwords: the database owner's and the role the dashboard will log in with.bash · ~/dashboard-gx10/.envmkdir -p ~/dashboard-gx10 && cd ~/dashboard-gx10 cat > .env <<EOF APPSMITH_VERSION=v2.4.3 OLLAMA_VERSION=0.35.0 POSTGRES_USER=dash_owner POSTGRES_PASSWORD=$(openssl rand -hex 24) POSTGRES_DB=dashboard DASH_PASSWORD=$(openssl rand -hex 24) TZ=Europe/Sofia EOF chmod 600 .env✅Versions are pinnedDo not writelatest: the next time the container is created the version may change silently. Appsmith's documentation also recommends a pinned tag. The numbers are current as of 01.10.2026 — see "Updating" below. -
The compose.yaml file
The rules are the same as in the n8n lesson: pinned versions, data in named volumes, the only published port is Appsmith's and only to
127.0.0.1, and Appsmith waits for Postgres to be "healthy". The./stacksfolder is where Appsmith keeps its data — that is how its documentation shows it.yaml · ~/dashboard-gx10/compose.yamlname: dashboard-gx10 services: postgres: image: postgres:18 restart: unless-stopped environment: POSTGRES_USER: ${POSTGRES_USER} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} POSTGRES_DB: ${POSTGRES_DB} DASH_PASSWORD: ${DASH_PASSWORD} PGDATA: /var/lib/postgresql/data volumes: - db_data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -h localhost -U ${POSTGRES_USER} -d ${POSTGRES_DB}"] interval: 5s timeout: 5s retries: 10 ollama: image: ollama/ollama:${OLLAMA_VERSION} restart: unless-stopped volumes: - ollama_models:/root/.ollama deploy: resources: reservations: devices: - driver: nvidia count: all capabilities: [gpu] appsmith: image: appsmith/appsmith-ce:${APPSMITH_VERSION} restart: unless-stopped depends_on: postgres: condition: service_healthy ports: - "127.0.0.1:8080:80" volumes: - ./stacks:/appsmith-stacks volumes: db_data: ollama_models:💡Why exactly like thisPGDATA — Postgres 18 changed the default data location; without this line the database starts empty. Ollama withoutports— the model is reachable only by the other containers in the project, not by the network. 127.0.0.1:8080:80 — Appsmith listens on port 80 inside the container; outside, we show it only on the machine itself. Postgres with its own database — the dashboard has its own, not someone else's database with important data.bashdocker compose config --quiet && echo "compose: OK" -
Start the stack
bashdocker compose up -d docker compose ps docker compose logs -f appsmith --tail=30The first time, the images are downloaded. According to Appsmith's documentation, startup can take up to 5 minutes — watch the logs until they stop changing (leave with
Ctrl+C).postgresshould behealthy. -
Demo data and a role with few rights
We create four tables with fictional data and a role,
dash_app. Why a separate role? If someone steals the dashboard's password or a query goes wrong, they must not be able to delete or change the tables. The role reads everything and writes only tobriefings. Its password comes from a variable, not from the file.bash · ~/dashboard-gx10/init.sqlcat > init.sql <<'EOF' CREATE ROLE dash_app LOGIN PASSWORD :'pw'; CREATE TABLE tickets ( id serial PRIMARY KEY, title text NOT NULL, status text NOT NULL CHECK (status IN ('open','closed')), created_at timestamptz NOT NULL DEFAULT now() ); CREATE TABLE invoices ( id serial PRIMARY KEY, client text NOT NULL, amount_eur numeric(10,2) NOT NULL, status text NOT NULL CHECK (status IN ('pending','paid')), due_date date NOT NULL, paid_at timestamptz ); CREATE TABLE devices ( id serial PRIMARY KEY, name text NOT NULL, online boolean NOT NULL ); CREATE TABLE briefings ( id serial PRIMARY KEY, created_at timestamptz NOT NULL DEFAULT now(), model text NOT NULL, body text NOT NULL ); INSERT INTO tickets (title, status, created_at) VALUES ('Warehouse printer does not print', 'open', now() - interval '3 hours'), ('New employee — mailbox access', 'open', now() - interval '20 hours'), ('Slow network in the office', 'open', now() - interval '2 days'), ('Toner replacement', 'closed', now() - interval '4 days'); INSERT INTO invoices (client, amount_eur, status, due_date, paid_at) VALUES ('Client Alpha', 420.00, 'pending', current_date - 12, NULL), ('Client Beta', 150.50, 'pending', current_date - 3, NULL), ('Client Gamma', 980.00, 'pending', current_date + 9, NULL), ('Client Delta', 310.00, 'paid', current_date - 5, now() - interval '1 hour'), ('Client Epsilon', 75.00, 'paid', current_date - 2, now() - interval '1 day'), ('Client Zeta', 205.00, 'paid', current_date - 8, now() - interval '3 days'); INSERT INTO devices (name, online) VALUES ('Entrance sensor', true), ('Warehouse sensor', true), ('Yard sensor', false), ('Office sensor', true); GRANT SELECT ON tickets, invoices, devices, briefings TO dash_app; GRANT INSERT ON briefings TO dash_app; GRANT USAGE ON SEQUENCE briefings_id_seq TO dash_app; EOF docker compose exec -T postgres sh -c 'psql -U "$POSTGRES_USER" -d "$POSTGRES_DB" -v ON_ERROR_STOP=1 -v pw="$DASH_PASSWORD"' < init.sqlYou expect
CREATE ROLE,CREATE TABLE,INSERTandGRANTlines, with no errors. The password is passed topsqlas a variable calledpw, which is why it is not in the file. ⚠️ We have not run this file on a live system. -
Open Appsmith from your own computer
Appsmith listens only on the machine itself. From your computer you reach it through an SSH tunnel — a protected corridor that opens nothing to the network.
bash · on your computerssh -L 8080:localhost:8080 <user>@<server-address>Leave the connection open and go to
http://localhost:8080. On the first visit Appsmith asks you to create an administrator account. It then offers a free plan or a licence key — for this lesson you do not need a key. If you work directly on the machine, open the same address there.🌐What Appsmith sends outAccording to Appsmith's telemetry page, its server sends a "keep-alive" signal every 2 hours regardless of the telemetry setting, and data from self-hosted installations is anonymised. Data returned by your databases is not collected. Read the page and decide for yourself what to switch off. -
Connect the database
In Appsmith: Create new → Application, then Data → Datasources → PostgreSQL (menu names may have changed — ⚠️ see the documentation). Fill in:
Field Value Host address postgres— the service name, notlocalhostPort 5432Database name dashboardUsername dash_appPassword the value of DASH_PASSWORDfrom.envConnection mode Read/Write (we store the briefing; the role itself limits the rights) SSL mode Disable (traffic stays on Docker's internal network) Press Test, then Save. To see the password:
grep DASH_PASSWORD .env.⚠️Never put in the database ownerThedash_ownerpassword is not for the dashboard. If the dashboard gets a "permission denied" error, grant the needed right todash_appinstead of swapping it for the owner. -
The dashboard's queries
On each page of the application add a query (Queries → New query on the database) and give it the name shown on the left. Leave the "Run behavior" setting (under the gear icon of the query) on On page load — that loads the data when the page opens. Amounts are in EUR.
sql · Appsmith queries-- qAlerts: active alerts (last 24 h) SELECT count(*) AS active_alerts FROM tickets WHERE status = 'open' AND created_at > now() - interval '24 hours'; -- qUnpaid: overdue unpaid invoices SELECT count(*) AS unpaid, COALESCE(sum(amount_eur), 0) AS total_owed FROM invoices WHERE status = 'pending' AND due_date < current_date; -- qUnpaidList: the list for the table SELECT client, amount_eur, due_date FROM invoices WHERE status = 'pending' AND due_date < current_date ORDER BY due_date LIMIT 20; -- qDevices: devices online SELECT count(*) FILTER (WHERE online) AS online, count(*) AS total FROM devices; -- qToday: revenue today (EUR) SELECT COALESCE(sum(amount_eur), 0) AS today_revenue FROM invoices WHERE status = 'paid' AND paid_at::date = current_date; -- qWeek: revenue by day, last 7 days (for the chart) SELECT paid_at::date AS day, sum(amount_eur) AS revenue FROM invoices WHERE status = 'paid' AND paid_at >= current_date - 6 GROUP BY 1 ORDER BY 1; -- lastBriefing: the latest briefing SELECT created_at, body FROM briefings ORDER BY id DESC LIMIT 1;With the demo data you expect: 2 active alerts, 2 overdue invoices totalling 570.50 EUR, 3 devices online out of 4, and 310.00 EUR revenue today. The numbers depend on the hour at which you loaded the data — if something does not show, run the query with Run and look at the response.
-
Lay out the screen
Grab the widgets from the left panel and drop them on the canvas. Each connects to a query through a binding in curly braces
{{ }}.Section Data Refresh Widget Active alerts qAlerts30 s Stats Box → {{qAlerts.data[0].active_alerts}}Unpaid invoices qUnpaid60 s Stats Box → {{qUnpaid.data[0].total_owed}}EUROverdue — list qUnpaidList60 s Table → {{qUnpaidList.data}}Devices online qDevices30 s Stats Box → {{qDevices.data[0].online}} / {{qDevices.data[0].total}}Revenue today qToday60 s Stats Box → {{qToday.data[0].today_revenue}}EURRevenue, 7 days qWeek60 s Chart → {{qWeek.data}}Morning briefing lastBriefingon a button Text → {{lastBriefing.data[0].body}}The intervals in the table are the ones from the
startRefreshfunction in step 12 — if you change one, change the other.If a Stats Box needs an amount with two decimals:
{{Number(qToday.data[0].today_revenue).toFixed(2)}}. Postgresnumericvalues arrive as strings, so it is good to convert them withNumber(). -
The model: pull it and connect it through the REST API
Models are downloaded inside the Ollama container and stay in the
ollama_modelsvolume.bashdocker compose exec ollama ollama pull llama3.1 docker compose exec ollama ollama listAccording to ollama.com,
llama3.1(8B) is about 4.9 GB. Memory is shared with the CPU — do not run several large models at once. ⚠️ We have not measured answer speed on your machine.In Appsmith: Datasources → REST API, URL
http://ollama:11434, save. Then a new query on it, namedollamaChat:Setting Value Method and path POST · /api/chatHeader Content-Type: application/jsonBody JSON, see below Run behavior Manual (otherwise the model runs every time the page opens) Query timeout 60000 ms (the default is 10000; the documentation gives 60000 as the maximum). On a self-hosted instance the server-level limit can be raised above 60 seconds with the APPSMITH_SERVER_TIMEOUTvariable (in seconds) in Appsmith'senvironment— needed for a bigger model. ⚠️ We have not tried it.json · body of the ollamaChat query{ "model": "llama3.1", "stream": false, "keep_alive": "10m", "options": { "temperature": 0.2 }, "messages": [ { "role": "system", "content": "You are an assistant to the manager. Write in English, 3 to 5 short sentences, using only the numbers given. Do not invent facts." }, { "role": "user", "content": {{ Briefing.buildPrompt() }} } ] }💡Whystream: falseBy default Ollama returns the answer in pieces (a stream of JSON lines), while Appsmith expects a single response. Withfalseyou get the whole message at once and the text is inmessage.content. That is why we use/api/chatwith messages and roles (systemanduser) rather than/api/generatewith a singleprompt.⚠️The address is the service's, not the network'shttp://ollama:11434works because Appsmith and Ollama are in one compose project. Do not writelocalhost(that is Appsmith's own container) and do not open Ollama to0.0.0.0— that makes the model reachable from the whole network. -
A JS Object: a briefing from a button, and live figures
A new JS Object (JS Objects → New) named
Briefing. It gathers the figures into a short text, calls the model, stores the result and refreshes the text on screen. ThesaveBriefingquery is an ordinary SQL query (Run behavior: Manual) on the same database:sql · saveBriefingINSERT INTO briefings (model, body) VALUES ('llama3.1', {{ this.params.text }});javascript · the Briefing JS Objectexport default { buildPrompt() { const a = qAlerts.data[0]; const u = qUnpaid.data[0]; const d = qDevices.data[0]; const t = qToday.data[0]; return "Data for the day:\n" + "- Active alerts: " + a.active_alerts + "\n" + "- Overdue invoices: " + u.unpaid + " totalling " + u.total_owed + " EUR\n" + "- Devices online: " + d.online + " of " + d.total + "\n" + "- Revenue today: " + t.today_revenue + " EUR\n" + "Write a short morning report and suggest one priority."; }, async generate() { await ollamaChat.run(); const text = ollamaChat.data.message.content; await saveBriefing.run({ text: text }); await lastBriefing.run(); showAlert("Briefing saved", "success"); }, startRefresh() { setInterval(() => { qAlerts.run(); qDevices.run(); }, 30000, "fast"); setInterval(() => { qUnpaid.run(); qUnpaidList.run(); qToday.run(); qWeek.run(); }, 60000, "slow"); }, stopRefresh() { clearInterval("fast"); clearInterval("slow"); } }Attach: a "New briefing" button → onClick → Execute a JS function → Briefing.generate. For the live figures: Page → On page load → Briefing.startRefresh (or a button, if you want to control it).
setIntervalis an Appsmith function with the signaturesetInterval(function, milliseconds, id); theidis used to stop it withclearInterval.✅Refresh the queries, not the modelThe interval calls only the SQL queries — they are cheap. The model is called only from the button: every call takes up the GPU and the shared memory.✅A human reads and decidesThe briefing is a recommendation, not a decision. If the dashboard ever starts sending messages or changing data, put a human approval in front — the model makes mistakes and makes things up. -
Security — the minimum
.envhas permissions 600, is not in Git, and is sent to nobody.- Only
127.0.0.1:8080is published; Postgres and Ollama have no published ports. - The dashboard logs in as
dash_app(reads, and writes only tobriefings), never as the owner. - Do not put
0.0.0.0in front of Ollama, and do not open Appsmith to the internet without HTTPS and protection (Set up custom domain and SSL — see the documentation). - The Appsmith administrator's password is long and unique.
-
Backups, updating and monitoring
bash · from ~/dashboard-gx10mkdir -p backups docker compose exec -T postgres sh -c 'pg_dump -U "$POSTGRES_USER" "$POSTGRES_DB"' > backups/dashboard-db-$(date +%Y%m%d).sql docker compose exec appsmith appsmithctl backupThe first command copies the data. The second (
appsmithctl backup) copies the Appsmith application itself — the screens, queries and settings. According to the documentation: run in a terminal, it asks for a password with which it encrypts the backup (keep it — without it the backup cannot be restored), and the file lands in./stacks/data/backup/. Keep backups off the machine too.Updating. Change the number in
.env(APPSMITH_VERSION,OLLAMA_VERSION) according to the current releases on Appsmith's Docker Hub and Ollama's, and run (take a backup first):bashdocker compose pull docker compose up -d --remove-orphans docker compose logs -f appsmith --tail=50Do not change the major Postgres version just by changing the tag — that requires a separate procedure (see the Postgres documentation). Before jumping Appsmith between major versions, read the upgrade instructions in its documentation.
Monitoring.
docker compose psshows the state,docker stats --no-streamshows CPU and memory of the containers.
04Check
docker compose ps: Postgres ishealthy, Ollama and Appsmith are running.init.sqlran without errors, anddash_appcannot delete tables.- Appsmith opens through the tunnel and you have an administrator account.
- The database connection test succeeds and the four figures show values from the demo data.
- The
ollamaChatquery returns text inmessage.content. - The "New briefing" button stores a row in
briefingsand the text appears on screen. - Only
127.0.0.1:8080is published. - There is a database backup and an Appsmith backup.
Quiz
1. Which Postgres address do you enter in Appsmith in this stack?
2. Why does the dashboard log in with the dash_app role rather than the database owner?
3. Why does the body sent to /api/chat contain "stream": false?
4. Which query should NOT be run by setInterval every 30 seconds?
05What's next
06Sources
- Appsmith: install using Docker — image, ports,
/appsmith-stacks, 8 GB memory,cs.appsmith.com, Community or Commercial. - Appsmith: licence (Apache 2.0) · appsmith-ce on Docker Hub — version v2.4.3 and architectures (arm64).
- Appsmith: PostgreSQL · connecting to a database in Docker — connection fields, container name as the host.
- Appsmith: query settings — Run behavior, timeout 10 s up to 60 s.
- Appsmith: setInterval() · passing parameters to queries · telemetry · appsmithctl.
- Ollama: the /api/chat API 🔒 local — messages,
stream,keep_alive,options. - Postgres on Docker Hub · Ollama on Docker Hub — tags and architectures (arm64).
- Docker Compose: GPU support · llama3.1 🔒 local — model size.