Developing CloudTAK
Set up a local development environment for the CloudTAK API and web client on Ubuntu 26.04.
CloudTAK can be developed locally without Docker, and that is usually the easiest way to iterate on code changes.
These steps assume Ubuntu 26.04 LTS. If you are on macOS, the same flow works with Homebrew-managed packages. If you are on Windows, the simplest route is to use WSL2 with Ubuntu 26.04 and follow the same commands there.
What you need
Before you start, make sure you have:
git- Node.js
26.x(24.xis the minimum supported version) npm- PostgreSQL
18 - PostGIS
3
CloudTAK’s local API server expects a PostgreSQL database and uses PostGIS-backed tables in its migrations, so a basic PostgreSQL install should include the PostGIS extension as well.
Ubuntu 26.04 ships PostgreSQL 18 and PostGIS 3.6 in its default archive, so no third-party apt repositories are required. The production container images run on Node.js 26, so use the same major version locally.
1. Install system dependencies on Ubuntu 26.04
If you already have Node.js 26.x, PostgreSQL, and PostGIS installed, you can skip this section.
sudo apt updatesudo apt install -y git build-essential curl \ postgresql postgresql-client postgresql-contrib \ postgis postgresql-18-postgis-3For Node.js, using nvm tends to be the least painful option during development, and avoids the older nodejs package in the Ubuntu archive:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bashsource ~/.nvm/nvm.shnvm install 26nvm use 26node --versionnpm --versionIf you are on macOS, install PostgreSQL/PostGIS with Homebrew and use either Homebrew or nvm for Node.js. On Windows, WSL2 is strongly preferred over a native setup if you want the least amount of friction.
2. Start PostgreSQL
Make sure the PostgreSQL service is running before you try to start CloudTAK.
sudo systemctl enable --now postgresqlsudo systemctl status postgresqlIf status shows the service is active, you are ready to create a development database.
3. Create a basic local database
For local development, a dedicated database user is usually easier than relying on the default postgres account.
The following example creates:
- a role named
cloudtak - a database named
tak_ps_etl - the required
postgisextension
sudo -u postgres psql <<'SQL'DO $$BEGIN IF NOT EXISTS (SELECT FROM pg_roles WHERE rolname = 'cloudtak') THEN CREATE ROLE cloudtak LOGIN PASSWORD 'cloudtak'; END IF;END$$;
ALTER ROLE cloudtak CREATEDB;
SELECT 'CREATE DATABASE tak_ps_etl OWNER cloudtak'WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'tak_ps_etl')\gexec
\c tak_ps_etlCREATE EXTENSION IF NOT EXISTS postgis;SQLAt this point you should have a working local database that CloudTAK can connect to.
4. Clone the repository and install dependencies
The repository contains two packages you need for a basic local server: the API in api/ and the web client in app/.
git clone https://github.com/dfpc-coe/CloudTAK.gitcd CloudTAK
cd apinpm install
cd ../appnpm install
cd ..For day-to-day development, use the web development server instead of building the frontend bundle.
5. Create a local API config file
The local API process reads its .env file from the api/ directory, and in this project that file is JSON rather than shell-style KEY=value format.
Create api/.env with content like this:
{ "POSTGRES": "postgres://cloudtak:cloudtak@localhost:5432/tak_ps_etl", "SigningSecret": "cloudtak-local-dev", "API_URL": "http://localhost:5001", "PMTILES_URL": "http://localhost:5001"}You can keep this file minimal for local development. If StackName is not set, CloudTAK will treat the run as a local test-style environment.
Named environment files are also supported: npm run dev -- --env local loads api/.env-local instead of api/.env.
6. Start the CloudTAK development servers
Run the API server and the web development server in separate terminals.
In the first terminal, start the API from the api/ directory:
cd CloudTAK/apinpm run devIn the second terminal, start the web dev server from the app/ directory:
cd CloudTAK/appnpm run serveOn first startup, the API will connect to PostgreSQL, apply its migrations, and populate a small amount of default data if the database is empty.
When both processes are running successfully:
- the API is available at
http://localhost:5001 - the web UI is available at
http://localhost:8080
Open http://localhost:8080 in your browser for normal frontend development. The web dev server proxies /api requests to the local API on port 5001.
7. A quick sanity check
If you want to verify the database is reachable before starting the app, this is usually enough:
psql "postgres://cloudtak:cloudtak@localhost:5432/tak_ps_etl" -c 'SELECT PostGIS_Version();'If that returns a version string, the database side is ready.
8. Lint, type-check and test
Before opening a pull request, run the same checks the container build runs.
API, from api/:
npm run lintnpm testWeb client, from app/:
npm run lintnpm run checknpm testThe API test suite needs the local PostgreSQL instance from step 3; each test file clones a template database so the files can run in parallel.
9. Common issues
PostgreSQL connection errors
If CloudTAK cannot connect to PostgreSQL:
- confirm PostgreSQL is running
- confirm the username, password, database name, and port in
api/.env - make sure the database actually exists
PostGIS extension errors
If startup fails with a PostGIS-related migration error, run this once and try again:
sudo -u postgres psql -d tak_ps_etl -c 'CREATE EXTENSION IF NOT EXISTS postgis;'The frontend looks out of date
If you changed frontend code and the UI does not reflect it yet, make sure the web dev server is running:
cd CloudTAK/appnpm run serveThen refresh the browser. If needed, restart the web dev server.
Wrong Node.js version
If npm install fails with engine or native build errors, confirm node --version reports v26 or v24.
The nodejs package in the Ubuntu archive is older than CloudTAK requires; use nvm as shown in step 1.
10. Optional: full local stack with Docker Compose
If you mainly want to get the whole project running, including the tiles, events, retention and media services, the repository also includes Docker Compose support.
See Building Images for how to build the images locally, with or without plugins, and the Docker Compose Deployment guide for running them.
That is still a good option for a disposable local environment, but for day-to-day development the direct api/ and app/ workflow above is usually easier to understand and debug.