> For the complete documentation index, see [llms.txt](https://data-programs.gitbook.io/singularity/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://data-programs.gitbook.io/singularity/installation/deploy-to-production.md).

# Deploy to production

Singularity uses `sqlite3` as its default database backend due to its ease of setup. However, when transitioning to a production environment, especially if you're planning to use multiple workers or intend to serve retrievals behind a load balancer, it's recommended to switch to a more robust database backend. You can configure the backend by setting the `$DATABASE_CONNECTION_STRING` environment variable.

## Supported Database Backends

* **PostgreSQL**:\
  Connection String Example:\
  `postgres://user:pass@example.com:5432/dbname`

## Using Docker Compose for Deployment

If you'd like to quickly deploy Singularity along with a PostgreSQL backend, consider using the provided Docker Compose template:

```bash
wget https://raw.githubusercontent.com/data-preservation-programs/singularity/main/docker-compose.yml
docker-compose up
```

Executing the above commands will set up a PostgreSQL database and launch the necessary Singularity services, including the API and a dataset worker.

## Filecoin RPC Endpoint

For the deal-pusher and deal-tracker, we recommend running your own [Forest](https://github.com/ChainSafe/forest) node as the Filecoin RPC endpoint rather than relying on shared public gateways, which are prone to rate limits and reliability gaps under production load.


---

# 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://data-programs.gitbook.io/singularity/installation/deploy-to-production.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.
