FlureeLabs

fluree publish

Publish a local ledger to a remote server. Creates the ledger on the remote if it doesn't exist, pushes all local commits, and configures upstream tracking for subsequent push/pull.

Usage

fluree publish <REMOTE> [LEDGER] [OPTIONS]

Arguments

ArgumentDescription
<REMOTE>Remote name (e.g., "origin")
[LEDGER]Ledger name (defaults to active ledger)

Options

OptionDescription
--remote-name <NAME>Remote ledger name (defaults to local ledger name)

Description

fluree publish is the reverse of fluree clone. It takes a locally-created ledger and pushes it to a remote server in a single operation:

  1. Checks if the ledger exists on the remote (GET /exists)
  2. Creates it if not (POST /create)
  3. Pushes all local commits (POST /push)
  4. Configures upstream tracking so subsequent fluree push and fluree pull work

This is intended for the "create locally, deploy to server" workflow. If the remote ledger already has data (t > 0), the command will fail — use fluree push instead for incremental updates.

Examples

# Publish active ledger to origin
fluree publish origin

# Publish a specific ledger
fluree publish origin mydb

# Publish with a different name on the remote
fluree publish origin mydb --remote-name production-db

# Typical workflow: create locally, develop, then publish
fluree create mydb
fluree insert mydb -e '{"@id": "ex:test", "ex:name": "Test"}'
fluree publish origin mydb

Prerequisites

  • A remote must be configured: fluree remote add origin <url>
  • The remote must support the Fluree HTTP API (see Server implementation guide)
  • A valid auth token if the remote requires authentication: fluree auth login --remote origin

After Publishing

Once published, the ledger has upstream tracking configured. Use standard sync commands:

# Push new local commits to remote
fluree push

# Pull remote changes
fluree pull

See Also

  • push - Push incremental commits to upstream
  • pull - Pull changes from upstream
  • clone - Clone a remote ledger locally (reverse of publish)
  • remote - Manage remote server configuration
  • upstream - Manage upstream tracking
  • export - Export ledger as .flpack for file-based transfer