Skip to main content

Overview

The metadb init command creates a new Metadb data directory and configuration file. This is the first step when setting up a new Metadb instance.

Syntax

metadb init [options]

Options

-D, --dir
string
required
Path to the data directory to create. This directory will store configuration and temporary data.
metadb init -D /home/metadb/data
-v, --verbose
boolean
Enable verbose output to see detailed information during initialization.
metadb init -D data --verbose
--trace
boolean
Enable extremely verbose output for debugging (requires METADB_DEV=on).

What It Does

When you run metadb init, the command:
  1. Creates the specified data directory if it doesn’t exist
  2. Generates a metadb.conf configuration file in the data directory
  3. Sets up the directory structure for Metadb operations

Configuration File

The generated metadb.conf file will have this structure:
[main]
host = 
port = 
database = 
superuser = 
superuser_password = 
systemuser = 
systemuser_password = 
sslmode = 

Required Configuration

After running init, you must edit metadb.conf to provide:
host
string
required
PostgreSQL server hostname
port
integer
required
PostgreSQL server port (typically 5432)
database
string
required
Database name (must be metadb or start with metadb_)
superuser
string
required
Database superuser account (e.g., postgres)
superuser_password
string
required
Password for the superuser account
systemuser
string
required
Database user that owns the Metadb database
systemuser_password
string
required
Password for the systemuser account
sslmode
string
required
SSL mode for database connection (should be require or stronger)

Example

metadb init -D data

Example Configuration

After initialization, edit data/metadb.conf:
[main]
host = db.example.com
port = 5432
database = metadb
superuser = postgres
superuser_password = zpreCaWS7S79dt82zgvD
systemuser = mdbadmin
systemuser_password = ZHivGie5juxGJZmTObHU
sslmode = require
Metadb assumes that the database, superuser, and systemuser already exist in PostgreSQL. Create these before starting the server.

Next Steps

After initialization and configuration:
  1. Ensure PostgreSQL is properly configured
  2. Verify database users and permissions exist
  3. Start the server with metadb start

Build docs developers (and LLMs) love