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

# Getting Started

> This guide will help you quickly get the Anchor Platform (TESTNET only) with a business reference running locally using Docker Compose.

This guide will help you quickly get the Anchor Platform (TESTNET only) with a business reference running locally using Docker Compose.

Please note that this is not meant to be run in production.

## Prerequisites

* [Docker](https://www.docker.com/get-started) and Docker Compose installed
* [Stellar CLI](https://github.com/stellar/stellar-cli) installed

## Quick Start

### 1. Clone the Anchor Platform repository

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
git clone https://github.com/stellar/anchor-platform
```

### 2. Navigate to the quick-run directory

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
cd anchor-platform/quick-run
```

### 3. Start all services

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
./ap_start.sh
```

### 4. Verify the platform is running

Wait a few moments for services to initialize, then verify the platform is responding:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl http://localhost:8080/.well-known/stellar.toml
```

You should see the Stellar TOML configuration file returned.

### 5. Check service status

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
docker-compose ps
```

All services should show as "Up" in the status column.

## What's Included

The `quick-run` setup includes:

* **docker-compose.yaml** - Complete service definitions with all dependencies
* **dev.env** - Pre-configured environment variables
* **config/** - Required configuration files:
  * `assets.yaml` - Asset definitions
  * `clients.yaml` - Client configurations
  * `reference-config.yaml` - Reference server settings
  * `stellar.localhost.toml` - SEP-1 TOML file

> [!TIP]
>
> For more information about configuring assets and client wallets, see the [Assets and Client Wallets](https://developers.stellar.org/docs/platforms/anchor-platform/admin-guide/assets-and-client-wallets.md) guide.

## Testing with Stellar Demo Wallet

You can test the Anchor Platform using the [Stellar Demo Wallet](https://demo-wallet.stellar.org):

1. Open the [Stellar Demo Wallet](https://demo-wallet.stellar.org) in your browser.
2. Click on **"Generate keypair for new account (testnet only)"** button.
3. Click on the **"Create Account"** button next to the PUBLIC key.
4. You should now see `XLM` available under the **Balances** section, indicating your account is loaded.
5. Click on **"Add home domain"** and enter the following URL:
   ```
   http://localhost:8080
   ```
   This connects the demo wallet to your local Anchor Platform instance running on port 8080.
6. You should now be able to perform SEP transactions (deposits, withdrawals, etc.) with your local Anchor Platform instance.

## Customizing Configuration

To modify settings:

1. Edit `dev.env` for environment variables
2. Edit files in `config/` for service-specific configurations
3. Restart services: `docker-compose restart`

## Stopping Services

To stop all services:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
docker-compose down
```

## How to implement your business callback server

Once you have the Anchor Platform running, you can replace the reference server with your own business callback server implementation. This allows you to implement your own business logic for handling deposits, withdrawals, and other anchor operations.

### 1. Shutdown the reference business server

After the Anchor Platform is started and running, stop the reference server service:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
docker-compose stop reference-server
```

This stops the reference server while keeping the Anchor Platform and other services running. The platform will continue to operate, but it will no longer receive callbacks from the reference server.

### 2. Implement and run your own reference server

Implement your own callback server that implements the Anchor Platform callback API.

You can use the [kotlin-reference-server](https://github.com/stellar/anchor-platform/tree/develop/kotlin-reference-server) as a reference implementation to understand the required endpoints and data structures.

Ensure your callback server is accessible at `http://localhost:8091` (or the configured endpoint) and that the Anchor Platform can reach it.

Your server should:

* Listen on port **8091** (or configure the platform to use a different port)
* Implement the required callback endpoints as specified in the Anchor Platform API documentation
* Handle business logic for:
  * Fee calculation
  * Exchange rate determination
  * Transaction status updates
  * Customer information (KYC) management
  * Deposit and withdrawal processing

### 3. Test your integration using the demo wallet

Follow the steps described in the [Testing with Stellar Demo Wallet](#testing-with-stellar-demo-wallet) section above, and verify that your server correctly handles deposit, withdrawal, and other SEP operations initiated from the wallet.
