A newer version of this documentation is available.

View Latest


    The cbdocloader tool is used to load a group of JSON documents in a given directory or in a single .zip file into a Couchbase bucket.


    The basic syntax is:

    cbdocloader  -n [host]:8091 -u [Administrator] -p [password]
    		-b [bucket-name] [source-file]


    When loading documents and any associated design documents for views, use a directory structure similar to the following:

    /design_docs    // which contains all the design docs for views.
    /docs           // which contains all the raw json data files. This can contain other sub directories too.

    All JSON files to upload must contain well-formatted JSON. File names should exclude spaces.

    Types of errors:

    • Files are not well-formatted

    • Credentials are incorrect

    • RAM quota for a new bucket to contain the JSON is too large given the current quota for Couchbase Server

    When uploading both JSON documents and design documents, be aware that the design documents are uploaded after all JSON documents.

    This tool is found in the following locations, depending on the platform:

    Operating system Location




    C:\Program Files\Couchbase\Server\bin\cbdocloader

    Mac OS X

    /Applications/Couchbase Server.app/Contents/Resources/couchbase-core/bin/cbdocloader


    The following are the command options:

    Table 1. cbdocloader options
    Option Description

    -h --help

    Show this help message and exit.

    -u [username], --user=[username]

    REST username of the cluster. It can be specified in environment variable CB_REST_USERNAME.

    -p [password], --password=[password]

    REST password of the cluster. It can be specified in environment variable CB_REST_PASSWORD.

    -b [bucket-name], --bucket=[bucket-name]

    Specific bucket name. The default is default bucket. Bucket will be created if it does not exist.

    -n [host]:[port] --node=[host]:[port]

    Node address. The default port is 8091.

    -s [quota]

    RAM quota for the bucket in MB. The default is 100MB.

    The cbdocloader tool is typically used during the initial Couchbase Server install.


    The following is an example of uploading JSON from a .zip file:

    cbdocloader -n -u Administrator -p password -b mybucket ../samples/gamesim.zip