Getting Started

Set up your own LibreDiary instance in minutes. Choose between Docker for a quick start or manual installation for full control.

Prerequisites

Before installing LibreDiary, ensure you have the following tools installed on your system.

Node.js

>= 20.0.0

JavaScript runtime for the application server

Install →

pnpm

>= 9.0.0

Fast, disk space efficient package manager

Install →

Docker

>= 24.0 (optional)

Container runtime for the quick start deployment method

Install →

PostgreSQL

>= 15

Relational database for persistent data storage

Install →

Docker Quick Start

The fastest way to get LibreDiary running. Docker handles all dependencies automatically.

  1. Create a project directory

    bash
    mkdir librediary && cd librediary
  2. Create a docker-compose.yml file

    docker-compose.yml
    version: "3.8"
    
    services:
      librediary:
        image: ghcr.io/akaal-creatives/librediary:latest
        container_name: librediary
        ports:
          - "3000:3000"
        environment:
          DATABASE_URL: postgres://libre:libre@db:5432/librediary
          SECRET_KEY: your-secret-key-here
          NODE_ENV: production
        depends_on:
          - db
        restart: unless-stopped
    
      db:
        image: postgres:15-alpine
        container_name: librediary-db
        environment:
          POSTGRES_USER: libre
          POSTGRES_PASSWORD: libre
          POSTGRES_DB: librediary
        volumes:
          - pgdata:/var/lib/postgresql/data
        restart: unless-stopped
    
    volumes:
      pgdata:
  3. Start the services

    bash
    docker compose up -d
  4. Open LibreDiary in your browser

    text
    http://localhost:3000

    LibreDiary will be available at http://localhost:3000. The first user to register will become the admin.

Manual Setup

For full control over your installation, follow these step-by-step instructions to set up LibreDiary from source.

  1. Clone the repository

    bash
    git clone https://github.com/Akaal-Creatives/LibreDiary.git
    cd LibreDiary
  2. Install dependencies

    bash
    pnpm install
  3. Set up the database

    bash
    # Create a PostgreSQL database
    createdb librediary
    
    # Run database migrations
    pnpm db:migrate
  4. Configure environment variables

    bash
    # Copy the example environment file
    cp .env.example .env
    
    # Edit the .env file with your settings
    # At minimum, set DATABASE_URL and SECRET_KEY

    See the Configuration section below for all available environment variables.

  5. Start the development server

    bash
    pnpm dev

    The application will start on http://localhost:3000 by default.

  6. Build for production

    bash
    pnpm build
    pnpm start

    For production deployments, use the build command followed by start.

Configuration

LibreDiary is configured through environment variables. Copy .env.example to .env and adjust the values to match your environment.

VariableDescription
DATABASE_URLPostgreSQL connection string
SECRET_KEYSecret key for session encryption and JWT signing
NODE_ENVApplication environment
PORTPort the server listens on
HOSTHost address to bind to
STORAGE_PROVIDERFile storage backend (local, s3, minio)
S3_BUCKETS3 bucket name (when using S3/MinIO storage)
S3_REGIONS3 region (when using S3 storage)
OPENROUTER_API_KEYAPI key for AI writing features via OpenRouter
SMTP_HOSTSMTP server for email notifications
SMTP_PORTSMTP server port
.env
# Required
DATABASE_URL=postgres://user:password@localhost:5432/librediary
SECRET_KEY=change-me-to-a-secure-random-string

# Optional
NODE_ENV=production
PORT=3000
STORAGE_PROVIDER=local

# AI features (optional)
OPENROUTER_API_KEY=sk-or-v1-your-key-here

System Requirements

LibreDiary is designed to be lightweight. Here are the minimum and recommended specifications for self-hosting.

Minimum

  • CPU1 vCPU
  • RAM1 GB
  • Storage10 GB SSD
  • OSLinux (Ubuntu 22.04+, Debian 12+), macOS, or Windows with WSL2

Recommended

  • CPU2+ vCPUs
  • RAM2 GB+
  • Storage20 GB+ SSD
  • OSUbuntu 22.04 LTS or Debian 12

Supported Browsers

  • Chrome / Chromium 90+
  • Firefox 90+
  • Safari 15+
  • Edge 90+

Need more details?

Check the full documentation on GitHub for advanced configuration, API reference, and deployment guides.