Back to Apps
Affine (Community)

Deploy Affine (Community) on Your Own Server

Affine is a next-gen knowledge base that brings planning, sorting, and creating all together.

πŸ“¦ Other

Want to deploy Affine (Community) on your server faster? Try Senate with one-command setup, automatic HTTPS and monitoring.

Get Started

What is Affine (Community)?

Affine - A next-gen knowledge base that brings planning, sorting, and creating all together.

Learn more

Self-Host Affine (Community)

Follow these steps to deploy on your own server.

1

Install Docker

Skip this step if Docker is already installed on your server.

curl -fsSL https://get.docker.com | sh
2

Configure

Customize the settings below. Defaults work for most cases.

General
3

Deploy

Copy the configuration and run it on your server.

services:
  affine:
    image: ghcr.io/toeverything/affine:0.25.5
    environment:
      AFFINE_INDEXER_ENABLED: "false"
      AFFINE_SERVER_EXTERNAL_URL: ""
      AFFINE_SERVER_HOST: ""
      AFFINE_SERVER_HTTPS: "true"
      DATABASE_URL: postgres://affine:23cf0508f6d042caaf8c3610a491a272@affine-postgres:5432/affine
      MAILER_HOST: ""
      MAILER_PASSWORD: ""
      MAILER_PORT: ""
      MAILER_SENDER: ""
      MAILER_USER: ""
      NODE_ENV: production
      REDIS_SERVER_HOST: affine-redis
    volumes:
      - affine-db-data:/root/.affine/config
      - affine-db-data:/root/.affine/storage
    depends_on:
      - affine-redis
      - affine-postgres
      - affine-migration
  affine-migration-delete-me-after-install:
    image: ghcr.io/toeverything/affine:0.25.5
    environment:
      AFFINE_INDEXER_ENABLED: "false"
      DATABASE_URL: postgres://affine:23cf0508f6d042caaf8c3610a491a272@affine-postgres:5432/affine
      REDIS_SERVER_HOST: affine-redis
    volumes:
      - affine-db-data:/root/.affine/config
      - affine-db-data:/root/.affine/storage
    depends_on:
      - affine-redis
      - affine-postgres
  affine-postgres:
    image: pgvector/pgvector:pg16
    environment:
      PGDATA: /var/lib/postgresql/data/pgdata
      POSTGRES_DB: affine
      POSTGRES_HOST_AUTH_METHOD: trust
      POSTGRES_INITDB_ARGS: --data-checksums
      POSTGRES_PASSWORD: 23cf0508f6d042caaf8c3610a491a272
      POSTGRES_USER: affine
    volumes:
      - affine-db-data:/var/lib/postgresql/data
  affine-redis:
    image: redis
    volumes:
      - affine-db-data:/data
volumes:
  affine-db-data: {}

Then run:

docker compose up -d
4

Access

Once started, access your app at http://localhost:3010

Why Self-Host Affine (Community)?

Full Data Ownership

Your data stays on your servers. No third-party access.

No Monthly Fees

Pay only for your server. No per-seat or usage charges.

Complete Control

Customize, backup, and scale on your own terms.

Privacy & Compliance

Meet GDPR, HIPAA, or internal security requirements.

Technical Details

Docker Image

ghcr.io/toeverything/affine:${affine_version}

Official Docs

docs.affine.pro

Want to go faster?

Try Senate! Senate handles Docker, HTTPS, updates, and monitoring for you. Deploy any of our 300+ apps with a single command.

Install on any Linux server:

sh -c "$(curl -sSL https://get.senate.sh)"