Skip to content
Get started
Bastionary › Quick start

Quick start

By Bastionary

Bastionary is free, open-source software that you run yourself. This guide gets a server running and makes a first API call. There is nothing to sign up for.

1. Get Bastionary

Download the latest release from the releases on the Git forge, or clone the repository, then unpack it and change into the project folder.

2. Configure

You need PostgreSQL 16 and Python 3.12 (or Docker). Copy the example environment file and set at least these values:

cp .env.example .env
BASTION_DATABASE_URL=postgresql+asyncpg://user:password@localhost/bastionary
BASTION_JWT_SECRET=<64-character random hex string>
BASTION_CORS_ORIGINS=["https://your-app.example.com"]
BASTION_SUPERADMIN_EMAIL=admin@example.com
BASTION_SUPERADMIN_PASSWORD=<a strong password>
Generate BASTION_JWT_SECRET yourself and never commit your .env file. Use a long random value, for example openssl rand -hex 32.

3. Run it

With Docker Compose

The repository ships a docker-compose.yml that starts PostgreSQL, Redis and the API:

docker compose up -d

From source

cd app
python -m venv venv
venv/bin/pip install -r requirements.txt
venv/bin/uvicorn main:app --port 8400

On Windows use venv\Scripts\pip and venv\Scripts\uvicorn.

4. Check that it works

curl http://localhost:8400/health

Interactive API documentation is served at http://localhost:8400/docs, and GET /api/v1/commands lists every command with its JSON schema.

5. Make your first call

Every operation is a named command sent to one endpoint. LICENSE.VALIDATE needs no user session, so it is the simplest call to try:

curl -X POST http://localhost:8400/api/v1/execute \
  -H 'Content-Type: application/json' \
  -d '{"command":"LICENSE.VALIDATE","params":{"key":"YOUR-LICENSE-KEY"}}'

6. Put it behind HTTPS

Run a reverse proxy such as Caddy in front of port 8400 so your server is reachable at an address like https://auth.example.com. The knowledge base article Self-hosting your auth: a deployment checklist covers backups, upgrades and monitoring.

Call it from your framework

Bastionary speaks plain HTTP and JSON, so no SDK is required. See Call the Bastionary API from Next.js, React, Python and Go.

Next steps