Skip to main content
Get your Anchor instance running in minutes using Docker. This guide covers deployment with pre-built images and building from source.

Prerequisites

Before you begin, ensure you have Docker and Docker Compose installed on your system.

Deployment Options

Pre-built Image

Fastest way to deploy using official images from GitHub Container Registry

Build from Source

Build and customize the image from source code

Option 1: Using Pre-built Image

This is the recommended method for most users.
1

Create docker-compose.yml

Create a docker-compose.yml file in your preferred directory:
services:
  anchor:
    image: ghcr.io/zhfahim/anchor:latest
    container_name: anchor
    restart: unless-stopped
    ports:
      - "3000:3000"
    volumes:
      - anchor_data:/data

volumes:
  anchor_data:
2

Start the container

Run the following command to start Anchor:
docker compose up -d
3

Access the application

Open your browser and navigate to:
http://localhost:3000
You should see the Anchor login page. Create your first account to get started!
The default configuration uses an embedded PostgreSQL database stored in the /data volume. This works out of the box without any additional setup.

Option 2: Building from Source

If you want to build from source or customize the image:
1

Clone the repository

git clone https://github.com/zhfahim/anchor.git
cd anchor
2

Start the container

The included docker-compose.yml will build the image from source automatically:
docker compose up -d
3

Access the application

Open http://localhost:3000 in your browser.

Configuration Options

Most users can skip this step - defaults work out of the box. Add these to the environment section in your docker-compose.yml if needed:
VariableRequiredDefaultDescription
APP_URLNohttp://localhost:3000Base URL where Anchor is served
JWT_SECRETNo(auto-generated)Auth token secret
PG_HOSTNo(empty)External Postgres host (leave empty for embedded)
PG_PORTNo5432Postgres port
PG_USERNoanchorPostgres username
PG_PASSWORDNopasswordPostgres password
PG_DATABASENoanchorDatabase name
USER_SIGNUPNo(not set)Sign up mode: disabled, enabled, or review. If not set, admins can control it via the admin panel
OIDC_ENABLEDNoEnable OIDC authentication
OIDC_PROVIDER_NAMENo"OIDC Provider"Display name for the login button
OIDC_ISSUER_URLWhen OIDC enabledBase URL of your OIDC provider
OIDC_CLIENT_IDWhen OIDC enabledOIDC client ID
OIDC_CLIENT_SECRETNoOIDC client secret. Omit for public client (PKCE)
DISABLE_INTERNAL_AUTHNofalseHide local login form when OIDC is enabled (OIDC-only mode)
services:
  anchor:
    image: ghcr.io/zhfahim/anchor:latest
    container_name: anchor
    restart: unless-stopped
    ports:
      - "3000:3000"
    volumes:
      - anchor_data:/data
    environment:
      - APP_URL=https://notes.example.com
      - USER_SIGNUP=review
      - OIDC_ENABLED=true
      - OIDC_PROVIDER_NAME=Pocket ID
      - OIDC_ISSUER_URL=https://pocketid.example.com
      - OIDC_CLIENT_ID=your-client-id

volumes:
  anchor_data:
If you plan to expose Anchor to the internet, make sure to:
  • Use a reverse proxy with HTTPS (like Nginx or Caddy)
  • Update APP_URL to your public domain
  • Configure appropriate firewall rules

Next Steps

Mobile App

Download the Android app and connect it to your instance

OIDC Setup

Configure single sign-on with OpenID Connect

Admin Panel

Learn about user management and system settings

View Source

Contribute to the project on GitHub

Build docs developers (and LLMs) love