Standalone admin panel with task results storage in SQLite or Postgres database
| Tasks Page | Task Details Page |
|---|---|
![]() |
![]() |
- Import and connect the middleware to the broker:
...
from taskiq.middlewares.taskiq_admin_middleware import TaskiqAdminMiddleware
broker = (
RedisStreamBroker(
url=redis_url,
queue_name="my_lovely_queue",
)
.with_result_backend(result_backend)
.with_middlewares(
TaskiqAdminMiddleware(
url="http://localhost:3000", # the url to your taskiq-admin instance
api_token="supersecret", # any secret enough string
taskiq_broker_name="mybroker",
)
)
)
...-
Pull the image from GitHub Container Registry:
docker pull ghcr.io/taskiq-python/taskiq-admin:latest -
Replace
TASKIQ_ADMIN_API_TOKENwith any secret enough string and run:
docker run -d --rm \
-p "3000:3000" \
-v "./taskiq-admin-data/:/usr/database/" \
-e "TASKIQ_ADMIN_API_TOKEN=supersecret" \
--name "taskiq-admin" \
"ghcr.io/taskiq-python/taskiq-admin:latest"- Go to
http://localhost:3000/tasks
services:
queue:
build:
context: .
dockerfile: ./Dockerfile
container_name: my_queue
command: taskiq worker app.tasks.queue:broker --workers 1 --max-async-tasks 20
environment:
- TASKIQ_ADMIN_URL=http://taskiq_admin:3000
- TASKIQ_ADMIN_API_TOKEN=supersecret
depends_on:
- redis
- taskiq_admin
taskiq_admin:
image: ghcr.io/taskiq-python/taskiq-admin:latest
container_name: taskiq_admin
ports:
- 3000:3000
environment:
- TASKIQ_ADMIN_API_TOKEN=supersecret
volumes:
- admin_data:/usr/database/
volumes:
admin_data:cp env-example .env, enter.envfile and fill in all needed variables- run
make devto run it locally in dev mode - run
make prodto run it locally in prod mode
Environment variables for DB setup:
TASKIQ_ADMIN_DB_DRIVER: required, one ofsqliteorpostgresTASKIQ_ADMIN_DB_FILE_PATH: required whenTASKIQ_ADMIN_DB_DRIVER=sqliteTASKIQ_ADMIN_DB_URL: required whenTASKIQ_ADMIN_DB_DRIVER=postgres
Task name search uses a case-insensitive substring match. On postgres it is backed by a
pg_trgm GIN index, which taskiq-admin creates on startup.
This is a performance optimization, not a requirement: if the extension cannot be created, search keeps returning the same results, it just does a sequential scan over the tasks table. A warning is logged once at startup when that happens.
pg_trgm ships with the standard postgresql-contrib package (included in the official
postgres Docker images) and is a trusted extension since postgres 13, so the database owner
can create it without superuser rights. If the role in TASKIQ_ADMIN_DB_URL is neither owner
nor superuser, create it once by hand:
CREATE EXTENSION IF NOT EXISTS pg_trgm;Let's assume we have a task 'do_smth', there are all states it can embrace:
queued- the task has been sent to the queue without an errorrunning- the task is grabbed by a worker and is being processedsuccess- the task is fully processed without any errorsfailure- an error occured during the task processingabandoned- taskiq-admin sets all 'running' tasks as 'abandoned' if there was a downtime between the time these tasks were in 'running' state and the time of next startup of taskiq-admin
- Run
pnpm installto install all dependencies - Run
pnpm db:pushto create the sqlite database if needed - Run
pnpm devto run the project

