Install with Docker
You can install Bag of Words with a single docker command. By default, it will use SQLite as the database. You can also configure it to use PostgreSQL by passing
BOW_DATABASE_URL environment variable.
To use PostgreSQL, you need to set the
BOW_DATABASE_URL environment variable.
For example: BOW_DATABASE_URL=postgresql://postgres:postgres@localhost:5432/bagofwordsUpdate
- Re-run the same
docker run --pull always ...command to fetch and start the latest image. - Optionally, pull explicitly and restart:
Install with Docker Compose
Run Bag of Words with Docker Compose and Caddy (built-in TLS on port 443). We recommend using the canonical files from the repo to avoid drift:
docker-compose.yaml: https://github.com/bagofwords1/bagofwords/blob/main/docker-compose.yamlCaddyfile: https://github.com/bagofwords1/bagofwords/blob/main/Caddyfile
Steps
- Make sure Docker and Docker Compose are installed.
-
Clone the repo:
-
Create a
.envfile (for domain and credentials). Example:GenerateBOW_ENCRYPTION_KEYwith OpenSSL: -
Start services:
-
Point your domain to the server’s public IP:
- Create an A record for
yourdomain.com→ your instance public IP. - Caddy will automatically obtain/renew the TLS certificate and serve on port 443.
- Create an A record for
-
Open
https://yourdomain.com
Caddy is included by default as a reverse proxy on port 443. If you prefer to run without Caddy, remove the
caddy service from docker-compose.yaml and expose the app directly on port 3000. For local, no-SSL testing, you can also use docker-compose.dev.yaml.Update
Other configurations
You can also configure additional settings in the bow-config.yaml file.
Install with Kubernetes
You can install Bag of Words on a Kubernetes cluster. The Helm chart can deploy the app with a bundled PostgreSQL instance or connect to an external managed database such as AWS Aurora with IAM authentication.
1. Add the Helm Repository
2. Install or Upgrade the Chart
Here are a few examples of how to install or upgrade the Bag of Words Helm chart: Deploy with a bundled PostgreSQL instance:Deploy with AWS Aurora and IAM Authentication
When using a managed database like AWS Aurora PostgreSQL, the chart skips the bundled PostgreSQL subchart and connects directly to your Aurora cluster. Passwords are never stored — short-lived IAM tokens are generated at runtime for every new database connection. Prerequisites:- An Aurora PostgreSQL cluster with IAM database authentication enabled
- A database user created with:
GRANT rds_iam TO <username> - An IAM role/policy with
rds-db:connectpermission - In EKS: an IRSA (IAM Roles for Service Accounts) annotation on the pod’s service account so the app can assume the IAM role
When
database.auth.provider is set to aws_iam, the bundled PostgreSQL subchart is automatically skipped. The app uses boto3 to call generate_db_auth_token() before each new connection, so tokens rotate automatically and no static database password is needed.Update
AWS Aurora Configuration
Bag of Words supports connecting to AWS Aurora PostgreSQL using IAM database authentication. This eliminates static database passwords entirely — the application generates short-lived tokens (valid for 15 minutes) at connection time using AWS IAM.
How it works
- The app’s service account assumes an IAM role (via IRSA in EKS, or instance profile on EC2)
- On every new database connection, the app calls
generate_db_auth_token()to get a temporary password - The token is used as the PostgreSQL password — established connections are not affected when it expires
- SSL is required (
requireorverify-full)
AWS Setup
1. Enable IAM authentication on the Aurora cluster:rds-db:connect:
bow-config.yaml for Aurora (non-Kubernetes)
If you are running Bag of Words on EC2 or ECS (not Kubernetes), you can configure Aurora IAM auth directly inbow-config.yaml:
rds-db:connect policy attached.
Google OAuth
To enable Google OAuth authentication, configure the following parameters in your bow config (or in env/k8s configmap):- Callback URL:
https://yourbaseurl.com/api/auth/google/callback - Scopes:
/auth/userinfo.email,/auth/userinfo.profile,openid - Enable People API
OpenID Connect (OIDC)
For Okta
- Set a new OIDC application: web
- Set callback URL
https://your-base-bow-url.com/api/auth/okta/callback
