Skip to content
CloudTAK Documentation
GitHub

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.x is 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.

Terminal window
sudo apt update
sudo apt install -y git build-essential curl \
postgresql postgresql-client postgresql-contrib \
postgis postgresql-18-postgis-3

For Node.js, using nvm tends to be the least painful option during development, and avoids the older nodejs package in the Ubuntu archive:

Terminal window
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
source ~/.nvm/nvm.sh
nvm install 26
nvm use 26
node --version
npm --version

If 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.

Terminal window
sudo systemctl enable --now postgresql
sudo systemctl status postgresql

If 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 postgis extension
Terminal window
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_etl
CREATE EXTENSION IF NOT EXISTS postgis;
SQL

At 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/.

Terminal window
git clone https://github.com/dfpc-coe/CloudTAK.git
cd CloudTAK
cd api
npm install
cd ../app
npm 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:

Terminal window
cd CloudTAK/api
npm run dev

In the second terminal, start the web dev server from the app/ directory:

Terminal window
cd CloudTAK/app
npm run serve

On 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:

Terminal window
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/:

Terminal window
npm run lint
npm test

Web client, from app/:

Terminal window
npm run lint
npm run check
npm test

The 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:

Terminal window
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:

Terminal window
cd CloudTAK/app
npm run serve

Then 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.