Research preview — APIs may change. GitHub
Local development
This guide walks you through running Astral on your machine. By the end, you will have a working local instance that responds to geocomputation requests.Prerequisites
- Node.js 20+ — the service uses the
--env-fileflag, which requires Node 20 - Docker — for PostgreSQL with PostGIS
- pnpm — the monorepo uses pnpm workspaces
Clone and install
Start PostgreSQL + PostGIS
The repo includes a development Docker Compose file that runs PostgreSQL with PostGIS:Port conflicts
If port 5432 is already in use by another PostgreSQL instance, create adocker-compose.override.yml that maps to a different port (e.g., 5434:5432) and update your DATABASE_URL accordingly:
DATABASE_URL=postgresql://postgres:postgres@localhost:5434/astral in your environment file.
Environment setup
.env.local with your configuration. You will need a SIGNER_PRIVATE_KEY — any Ethereum private key works for development. You can generate one with openssl rand -hex 32.
The important fields:
| Variable | Description | Example |
|---|---|---|
DATABASE_URL | PostgreSQL connection string | postgresql://postgres:postgres@localhost:5432/astral |
PORT | HTTP server port | 3004 |
SIGNER_PRIVATE_KEY | Ethereum private key for signing results | 0xac0974bec... |
CHAIN_ID | Default chain ID | 84532 (Base Sepolia) |
Start the service
npm run dev script may not work reliably. The command above is the most reliable way to start the service.
You should see output indicating the server is listening on the configured port.
Health check
Confirm the service is running:Smoke test
Run a distance computation between the Eiffel Tower and a point across the Seine:result field with a numeric value, everything is working.
Platform notes
Apple Silicon (M1/M2/M3)
Apple Silicon (M1/M2/M3)
PostGIS Docker images may need an explicit platform flag. If the container fails to start, add This runs under Rosetta emulation, which is slower but functional.
platform: linux/amd64 to the postgres service in your compose file:Common port conflicts
Common port conflicts
These ports may collide with other local services:
Use the
| Port | Used by | Common conflict |
|---|---|---|
| 5432 | PostgreSQL | Other Postgres instances, Homebrew Postgres |
| 3004 | Astral service | Other dev servers |
| 3000-3003 | Other monorepo packages | Next.js, React dev servers |
docker-compose.override.yml approach for database port conflicts, and change PORT in .env.local for service port conflicts.