Skip to Content
almyty docs — v1
Self-Hosting

Self-Hosting

almyty can be self-hosted using Docker Compose for single-server deployments or Kubernetes with Kustomize for production clusters.

Docker Hub

Official images are published to Docker Hub:

docker pull almyty/api:latest docker pull almyty/frontend:latest
ImageBaseDescription
almyty/apinode:24-alpineBackend API server
almyty/frontendnginx:1.25-alpineFrontend SPA served via nginx

Tags: latest (most recent master build), vX.Y.Z (releases), sha-XXXXXXX (per-commit).

Docker Compose

The repository includes a docker-compose.yml that runs all services.

Quick start

git clone https://github.com/almyty/almyty.git cd almyty cp .env.example .env # edit with your values docker-compose up -d

The frontend is available at http://localhost:8080 and the backend API at http://localhost:4000.

Services

ServiceImagePort (host)Port (container)
postgrespostgres:16-alpine54325432
redisredis:7-alpine63796379
backendalmyty/api40003000
frontendalmyty/frontend80808080

Building from source

If you need custom builds instead of pulling from Docker Hub:

docker build -t almyty/api ./backend docker build -t almyty/frontend ./frontend

Both Dockerfiles are multi-stage. The backend builds on node:24-alpine and produces a minimal production image. The frontend builds the Vite app on node:24-alpine and copies the output into nginx:1.25-alpine.

Kubernetes

The repository provides Kustomize base manifests with three overlays.

Overlays

OverlayPurpose
developmentLocal k8s (minikube, kind). Single replicas, no TLS.
stagingPre-production. Managed Postgres, ENCRYPTION_KEY wired.
productionFull production. Multiple replicas, TLS via cert-manager, resource limits.

Deploy

# Development kubectl apply -k k8s/overlays/development # Staging kubectl apply -k k8s/overlays/staging # Production kubectl apply -k k8s/overlays/production

TLS

The production overlay includes a cert-manager ClusterIssuer for Let’s Encrypt. Set DOMAIN in the overlay’s configmap to your domain. Certificates are provisioned automatically.

Required environment variables

VariableDescriptionExample
DATABASE_HOSTPostgreSQL hostnamelocalhost
DATABASE_PORTPostgreSQL port5432
DATABASE_USERNAMEPostgreSQL useralmyty
DATABASE_PASSWORDPostgreSQL password
DATABASE_NAMEPostgreSQL database namealmyty
DB_SSLEnable SSL for managed databasestrue or false
REDIS_HOSTRedis hostnamelocalhost
REDIS_PORTRedis port6379
JWT_SECRETSecret for signing JWT tokensRandom 64+ char string
ENCRYPTION_KEYAES-256 key for encrypting credentialsRandom 32-byte hex string

Optional variables

VariableDescriptionDefault
PORTBackend listen port3000
FRONTEND_URLFrontend origin for CORShttp://localhost:3002
VITE_API_BASE_URLAPI origin for the frontend (cross-domain deploys)(same origin)
ANALYTICS_RETENTION_DAYSHow long to keep request/audit logs90
BULL_REDIS_HOSTSeparate Redis for BullMQ (if desired)Falls back to REDIS_HOST
MAIL_HOSTSMTP host for outbound email
MAIL_PORTSMTP port587
MAIL_USERSMTP username
MAIL_PASSSMTP password

Health check endpoints

The backend exposes three health endpoints:

EndpointPurposeChecks
GET /healthFull healthDatabase, Redis, disk, memory
GET /health/liveLiveness probeProcess is running
GET /health/readyReadiness probeDatabase and Redis are reachable

Kubernetes probes

livenessProbe: httpGet: path: /health/live port: 3000 initialDelaySeconds: 10 periodSeconds: 15 readinessProbe: httpGet: path: /health/ready port: 3000 initialDelaySeconds: 5 periodSeconds: 10

Upgrades

docker-compose pull docker-compose up -d

TypeORM runs pending migrations automatically on startup (migrationsRun: true). Back up the database before upgrading.