Skip to main content
In this guide, you set up a working Midaz environment. You then run the core workflow behind any financial application on the platform. You create an organization, a ledger, and accounts, and then process your first transaction. By the end, you have a running ledger ready for your use case. This can be payments, lending, marketplace settlement, or internal treasury.

Prerequisites


Before you begin, install these tools:
Midaz runs on macOS (Apple Silicon and Intel) and Linux (amd64). On Windows, run it through WSL2.

Step 1: Clone the repository


Clone the Midaz repository and move into the project directory.

Step 2: Set up environment files


Midaz uses .env files to configure each component. Generate them from the provided examples:
This command copies .env.example to .env in each component directory. The default values work for local development. You do not need to change them.
Docker must run before this step. make set-env also generates the LCRYPTO_* CRM keys through a Docker one-shot container. The command fails if Docker is unavailable.

Step 3: Start the infrastructure


Start the supporting services that Midaz needs: PostgreSQL, MongoDB, Valkey, RabbitMQ, Redpanda, and OpenTelemetry.
Wait until the containers are up. Check their status with:
Infrastructure services use the following default ports:

Step 4: Start Midaz


Midaz runs as a single Ledger service that includes the onboarding and transaction domains. Start it with:
This command starts the infrastructure, runs the ledger and Tracer migration containers, and then starts the ledger and Tracer services. All ledger APIs are available on port 3002. Check that Midaz responds:
You should receive a 200 OK response.

Step 5: Create an organization


An organization represents the business entity behind the financial operation: your company, a client, or a regulated institution. In production, it maps to the legal entity that holds your ledgers, accounts, and transactions.
For the complete endpoint specification, see Create an Organization.
Save the id returned in the response. You use it in the next steps as {organization_id}.

Step 6: Create a ledger


A ledger is an isolated book of records within an organization. You can create separate ledgers for different financial domains, such as payments, fee collection, or settlement. Each ledger has its own accounts and transaction history.
For the complete endpoint specification, see Create a Ledger.
Save the returned id as {ledger_id}.

Step 7: Create an asset


An asset defines the unit of value tracked in the ledger. This can be a fiat currency like BRL or USD. It can also be loyalty points, crypto tokens, securities, or any custom unit your business tracks. You must create at least one asset before you create accounts.
For the complete endpoint specification, see Create an Asset.

Step 8: Create accounts


Accounts represent the participants or buckets in your financial flow: a customer wallet, a revenue pool, a merchant account, or an internal reserve. Each account links to a single asset and follows double-entry accounting rules. You need at least two accounts to process a transaction: one to debit (source) and one to credit (destination).
For the complete endpoint specification, see Create an Account.
Midaz created the source account @external/BRL when you created the BRL asset. Create a destination account:

Step 9: Process your first transaction


This is the core action: it moves value between accounts with full traceability. Midaz records every transaction as a balanced operation. It debits the source and credits the destination, so your books stay consistent by design.
For the complete endpoint specification, see Create a Transaction using JSON.
This transaction sends "1000" from @external/BRL to @customer-001. Midaz stores monetary values as decimal strings and does not apply an asset-specific scale.Your integration defines the display and rounding rules for BRL amounts. Do not parse monetary values as binary floating point.

Step 10: Verify the balance


Check the destination account balance to confirm the transaction.
For the complete endpoint specification, see Retrieve a Balance by Account Alias.
The returned balance should reflect the credited amount. At this point, you have a working ledger that processes real transactions.

Explore the API


Midaz can serve its OpenAPI 3.1 spec and interactive API documentation. The docs surface is off by default. To enable it, set OPENAPI_DOCS_ENABLED=true in components/ledger/.env and run make restart. Then access:
  • API docs: http://localhost:3002/docs
  • OpenAPI spec: http://localhost:3002/openapi.json (or /openapi.yaml)

Observability


Midaz ships with a preconfigured Grafana instance integrated with OpenTelemetry.
  • Grafana dashboard: http://localhost:3100
  • Default credentials: midaz / lerian
The local ledger configuration ships with telemetry off. To send telemetry to Grafana, set ENABLE_TELEMETRY=true in components/ledger/.env and run make restart.

Stopping Midaz


To stop all services:
To remove the Midaz containers and volumes, run the command below. It also runs docker system prune -f and docker volume prune -f, which affect every project on your machine:

Next steps


New to Midaz? Start with Midaz entities to understand organizations, ledgers, accounts, and transactions.

Creating transactions

Learn the different ways to create transactions, including JSON, inflow, and outflow, and when to use each.

Deploy to production

Deploy Midaz to Kubernetes using the official Helm chart.

Setting up CRM

Manage holders and alias accounts to connect real-world identities to your Midaz accounts.

Extend with plugins

Add Pix and other capabilities to your Midaz deployment.