> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xpaylabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy XPayLabs: Docker Compose Crypto Payment Quickstart

> Deploy XPayLabs with Docker Compose, configure your merchant token, and create your first crypto payment collection in under 15 minutes.

Deploy XPayLabs with Docker Compose and create your first collection order in under 15 minutes. By the end of this guide, you'll have a running crypto payment gateway on your own infrastructure with a working test collection.

## Prerequisites

* A server with **8GB RAM / 4 vCPU** (Ubuntu 22.04+ recommended)
* **Docker** and **Docker Compose** installed
* RPC endpoints for the blockchains you want to support (TRON, EVM, SUI)

***

## How to deploy XPayLabs in 4 steps

<Steps>
  <Step title="Deploy XPayLabs with Docker Compose">
    Clone the repository and start all services:

    ```bash theme={null}
    git clone https://github.com/yan253319066/XPayLabs-docker.git
    cd XPayLabs-docker
    docker compose up -d
    ```

    This starts all services including Java backends (xpay-user, xpay-merchant, xpay-eth, xpay-tron, xpay-sui), blockchain scanners, and the checkout UI. Verify everything is running:

    ```bash theme={null}
    docker compose ps
    ```

    All services should show a `Up` status.
  </Step>

  <Step title="Configure your merchant token">
    XPayLabs authenticates API requests using HMAC-SHA256 signatures. Your merchant token is generated in the gateway dashboard when you create your merchant account.

    <Note>
      The merchant token is a shared secret. It never appears in API requests directly — instead, you use it to sign request payloads. Store it securely and never commit it to version control.
    </Note>
  </Step>

  <Step title="Create a test collection">
    Send a `POST` request to create a collection order. The request body must include a `sign` field computed over the payload.

    ```bash theme={null}
    # Replace TOKEN with your merchant token
    curl --request POST \
      --url http://your-server:180/v1/order/createCollection \
      --header "Content-Type: application/json" \
      --data '{
        "sign": "generated_hmac_signature",
        "timestamp": 1717000000,
        "nonce": "unique_nonce_123",
        "data": {
          "amount": "100.00",
          "symbol": "USDT",
          "chain": "TRON",
          "orderId": "merchant_order_001"
        }
      }'
    ```

    See the [Authentication](/authentication) page for how to compute the `sign` value.
  </Step>

  <Step title="Verify the collection response">
    A successful response returns a deposit address and checkout URL:

    ```json theme={null}
    {
      "code": 200,
      "msg": "success",
      "data": {
        "address": "TWkKZkmuB8DpVeiMoHiKf99ZoFHzk73CqR",
        "amount": "100.00",
        "symbol": "USDT",
        "chain": "TRON",
        "orderId": "merchant_order_001",
        "expiredTime": 1717086400,
        "paymentUrl": "http://your-server/checkout?orderId=merchant_order_001"
      }
    }
    ```

    The `address` field is where your customer sends funds. The `paymentUrl` leads to a hosted checkout page with a QR code and payment instructions.
  </Step>
</Steps>

***

## What's Next?

<CardGroup cols={2}>
  <Card title="Authentication" icon="key" href="/authentication">
    Learn how the HMAC signing algorithm works and how to implement it in your language.
  </Card>

  <Card title="API Reference" icon="code" href="/api-reference/overview">
    Explore all endpoints for collections, payouts, and webhooks.
  </Card>
</CardGroup>

<Tip>
  During development, use testnet networks (TRON Shasta, ETH Sepolia, BSC Testnet) to avoid real gas costs. See the [Testing guide](/guides/testing) for testnet configuration and test token faucets.
</Tip>
