How to Install NocoDB on a VPS with Docker: A Collaborative Spreadsheet from Your Database
Small teams often keep important data in a spreadsheet passed back and forth: one file, many versions, and nobody sure which one is current. Once that data needs to feed another app or be filled in by several people at once, the spreadsheet hits its limit. NocoDB offers a tidy middle ground: a real relational database behind the scenes, with a spreadsheet interface in front that anyone can use without writing SQL.
This guide installs NocoDB on a VPS with Docker Compose alongside Postgres, creates the first super admin account, builds one sample base, then invites one teammate into it. By the end, you have a shared data workspace anyone on the team can fill in, with an API other apps can use later if needed.
One note on the database choice: NocoDB can run on its built-in SQLite with no extra service, and that is fine for a quick look. This guide goes straight to Postgres, because team data shared by several people deserves a database built for concurrent access and tidy backups — not a single SQLite file sitting inside the app folder.
Before you start: what you need
- A VPS with Docker and Docker Compose v2 installed.
- Port
8080free on the VPS, since that is NocoDB's default port. - An email address and password for the first account — the first user to sign up becomes the super admin, so protect this account with a strong password.
- An access plan: for team use, put NocoDB behind an HTTPS reverse proxy, not a raw port
8080open to the internet.
Check Docker and Compose:
docker --version
docker compose versionExpected result: both commands print version numbers with no errors.
Step 1: create the project folder and the secrets
Create the NocoDB project folder and move into it:
mkdir -p ~/nocodb/nc_data
cd ~/nocodbThe nc_data folder is where NocoDB stores its application data on the host, including attachments uploaded to tables. The main database itself lives in the separate Postgres volume defined in the Compose file.
Now generate two strong secrets — one for the database password, one for NocoDB's JWT secret. The JWT secret is what NocoDB uses to sign login tokens; if its value changes midway, every active login session becomes invalid, so set it once and store it safely:
openssl rand -hex 32Run that command twice, and store both results somewhere safe. Expected result: two long, different random hexadecimal strings. You will use them in the next step.
Step 2: write the Compose file
Create docker-compose.yml with a text editor, for example nano docker-compose.yml, and fill it with this configuration. Replace the sample values your-postgres-password and your-jwt-secret with the two strings from Step 1:
services:
nocodb:
image: nocodb/nocodb:latest
container_name: nocodb
restart: unless-stopped
depends_on:
- postgres
ports:
- 8080:8080
environment:
- NC_DB=pg://postgres:5432?u=nocodb&p=your-postgres-password&d=nocodb
- NC_AUTH_JWT_SECRET=your-jwt-secret
volumes:
- ./nc_data:/usr/app/data
postgres:
image: postgres:latest
container_name: nocodb-postgres
restart: unless-stopped
environment:
- POSTGRES_USER=nocodb
- POSTGRES_PASSWORD=your-postgres-password
- POSTGRES_DB=nocodb
volumes:
- postgres_data:/var/lib/postgresql/data
volumes:
postgres_data:In short: the image nocodb/nocodb:latest is the official NocoDB image; NC_DB tells NocoDB to use Postgres with the connection format pg://host:port?u=user&p=password&d=database — note the host is written as postgres, the name of the Postgres service on the same Docker network, not localhost, because localhost inside the NocoDB container points at that container itself; NC_AUTH_JWT_SECRET is the secret that signs login tokens; the volume ./nc_data:/usr/app/data stores NocoDB's application data; and the named volume postgres_data stores all Postgres data at /var/lib/postgresql/data.
Do not share this file in a public repository while it still holds the password and secret. For a tidier setup, move both values into a .env file in the same folder and reference them as ${VARIABLE_NAME} in the Compose file.
Step 3: start the stack and wait until it is ready
Start both containers in the background, then check their status:
docker compose up -d
docker compose ps
docker logs -f nocodbExpected result: both containers show as running, and the NocoDB logs show the app serving on port 8080. Press Ctrl+C to leave the log view. The first run is usually slower than usual because NocoDB prepares its initial schema in Postgres — if the page is not up yet, wait a minute and refresh before concluding something is broken.
Step 4: sign up as super admin
Open a browser and go to http://YOUR-VPS-IP:8080. NocoDB shows the sign-up page. Enter your email and password, then sign up.
Expected result: you land in the NocoDB dashboard as super admin, with an empty workspace ready to fill. This first account holds full control over every workspace, so do not share its credentials with team members — teammates get invited later with their own accounts.
The diagram above sums up the architecture: the team's browsers reach NocoDB on port 8080, NocoDB stores metadata and data in Postgres through the NC_DB variable, and attachments land in the /usr/app/data folder on the host.
Step 5: create the first base and table
A base is NocoDB's project container, and the tables inside it work like spreadsheet sheets:
- Create a new base, for example named "Office Inventory".
- Inside that base, create a table named "Items" with fields
Name(text),Quantity(number), andCondition(choice: Good, Needs Repair, Broken). - Add a few sample rows, for example three items actually present in your room.
- Try other views of the same table: switch to Gallery to see items as cards, or to Form to see an input form you can share with others without giving access to the whole table.
Expected result: the data shows up in all those views without you writing a single line of SQL, because every view is just a different way of looking at the same table.
Step 6: invite a teammate with the right role
Shared data only works when the right people can fill it in — and people who do not need to change it cannot break it. In NocoDB, invite team members from the workspace or base settings, with a fitting role:
- Owner — full control, including deleting the base. Only for you and whoever truly runs the project.
- Editor — can add and change data, but cannot change structure or settings.
- Commenter — can comment without changing data.
- Viewer — can only look.
For a teammate tasked with filling in inventory data, the Editor role is enough. Expected result: that teammate receives the invitation, signs in with their own account, and can edit rows in the "Items" table without being able to change the table structure or workspace settings.
Common errors and how to fix them
| Symptom | Likely cause | Fix |
|---|---|---|
Page at YOUR-VPS-IP:8080 will not open | Container not ready yet, or port 8080 already in use | Run docker compose ps and docker logs nocodb; on a port conflict, change the mapping to 8081:8080 and open port 8081 |
| NocoDB fails to connect to the database | Wrong NC_DB, or Postgres not ready when NocoDB started | Make sure the host in NC_DB is written as postgres (the service name), not localhost; check docker logs nocodb-postgres, then restart NocoDB with docker compose restart nocodb |
| All users suddenly have to log in again | NC_AUTH_JWT_SECRET changed | Restore the secret to its original value; if the secret genuinely has to change, warn the team that all sessions will end |
| Old data gone after an update | Postgres volume not mounted | Make sure the volumes block for postgres_data is in the Compose file; data lives in that volume, not inside the container |
| NocoDB feels slow on a small install | Tight VPS resources for two containers at once | Check docker stats; Postgres and NocoDB on one small VPS need enough RAM for both to run together |
| Attachments not saved after a restart | The ./nc_data volume is wrong or not mounted | Check the mapping ./nc_data:/usr/app/data and make sure the host folder ~/nocodb/nc_data exists |
Updating NocoDB
Because data sits in volumes, updating means pulling the newest image and recreating the containers:
cd ~/nocodb
docker compose pull
docker compose up -d
docker compose psExpected result: both containers are running again, login still works, and bases and tables are intact. Before a major update, back up the Postgres volume and the nc_data folder — together they hold everything in your NocoDB. Do not delete the postgres_data volume while updating, since that is where all table data lives.
Summary
| Part | Value used |
|---|---|
| Image | nocodb/nocodb:latest (official) |
| Database image | postgres:latest |
| Port | 8080 |
| Database variable | NC_DB=pg://postgres:5432?u=nocodb&p=...&d=nocodb |
| JWT variable | NC_AUTH_JWT_SECRET (generated with openssl rand -hex 32) |
| Application data volume | ./nc_data:/usr/app/data |
| Database volume | postgres_data:/var/lib/postgresql/data |
| First account | Becomes super admin automatically |
| Restart | unless-stopped |
Final checklist
- ☐ The
nocodbandnocodb-postgrescontainers show asrunningindocker compose ps. - ☐ The NocoDB page opens on port
8080and the first sign-up succeeds. - ☐ The first account holds super admin status.
- ☐ The "Office Inventory" base and "Items" table were created.
- ☐ The Gallery and Form views were tried on the same table.
- ☐ One teammate was invited with the Editor role.
- ☐ The JWT secret and Postgres password are stored somewhere safe.
- ☐ Production access goes through an HTTPS reverse proxy, not raw port
8080.
Which data in your team gets messiest when it is managed through spreadsheets sent back and forth? Tell us in the comments, because the answer points at the first base worth moving to NocoDB.
Baca juga: the Rnevio article "MinIO di VPS: Storage S3 Self-Host untuk Backup dan File Aplikasi" covers self-hosted file storage that pairs well with a database like this, while the companion guide in this batch is available at the PocketBase guide to a complete backend in a single binary.


Diskusi
Ada pertanyaan atau pengalaman yang ingin dibagikan?
Komentar ditinjau sebelum ditampilkan. Mari berdiskusi dengan sopan dan sesuai topik.
Tulis komentar