> For the complete documentation index, see [llms.txt](https://docs.cheqd.io/product/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cheqd.io/product/advanced/did-registrar/did-registrar-setup.md).

# Setup DID Registrar

Setup and configure cheqd's DID Registrar to start writing Decentralized Identifiers (DIDs) and DID-Linked Resources (DLRs) on cheqd.

## Setting up cheqd DID Registrar

This page describes how to use and set up the [cheqd DID Registrar](https://github.com/cheqd/did-registrar) software package.

If you do not want to install anything and just want to test it using our testnet, you can load the REST API endpoint for [registrar](https://did-registrar-staging.cheqd.net) in your browser.

You should run your own registrar to perform DID Operations on the Mainnet.

## Setup

### Environment variable configuration

Environment variables needed for the Registrar are

1. `FEE_PAYER_MAINNET_MNEMONIC` : The cosmos payer mnemonic for the Cheqd Mainnet
2. `FEE_PAYER_TESTNET_MNEMONIC` : The cosmos payer mnemonic for the Cheqd Testnet. Set your own: the account must hold testnet CHEQ to pay fees, see [Testnet Faucet](/product/network/tools/testnet-faucet.md).
3. `LOCAL_STORE_TTL` (default: `600`): The time in seconds for the registrar to store data in cache
4. `PORT` (default: `3000`): The port number

Clone the repository

```bash
git clone git@github.com:cheqd/did-registrar.git
cd did-registrar
```

***

## Running a DID Registrar Using Docker

Build Docker container image using Dockerfile:

```bash
docker build --target cheqd-did-registrar . --tag did-registrar:local
```

Run the Docker container (modify according to your own build tags and other desired parameters):

```bash
docker run -it did-registrar:local
```

***

## Running a DID Registrar Locally

```bash
npm install
npm run build
npm start 
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.cheqd.io/product/advanced/did-registrar/did-registrar-setup.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
