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

# Binary Deployment

> Deploy MCP Gateway using binary files

## Supported Platforms

Currently supports binary deployment for the following platforms:

<CardGroup cols={2}>
  <Card title="Linux AMD64" icon="linux">
    Suitable for x86\_64 architecture Linux systems
  </Card>

  <Card title="Linux ARM64" icon="linux">
    Suitable for ARM64 architecture Linux systems
  </Card>
</CardGroup>

You can view and download the latest binary files at [GitHub Releases](https://github.com/amoylab/unla/releases).

## Deployment Steps

<Steps>
  <Step title="Create Directory and Download Configuration">
    ```bash theme={null}
    mkdir -p unla/{configs,data}
    cd unla/
    curl -sL https://raw.githubusercontent.com/amoylab/unla/refs/heads/main/configs/apiserver.yaml -o configs/apiserver.yaml
    curl -sL https://raw.githubusercontent.com/amoylab/unla/refs/heads/main/configs/mcp-gateway.yaml -o configs/mcp-gateway.yaml
    curl -sL https://raw.githubusercontent.com/amoylab/unla/refs/heads/main/.env.example -o .env
    ```
  </Step>

  <Step title="Adjust PID File Path (macOS Users)">
    <Note>
      On macOS, `/var/run/mcp-gateway.pid` may not have write permissions, so the path needs to be adjusted.
    </Note>

    ```bash theme={null}
    sed -i 's|/var/run/mcp-gateway.pid|./data/mcp-gateway.pid|g' .env
    ```
  </Step>

  <Step title="Download Binary Files">
    Choose the appropriate binary file based on your system architecture:

    **Linux AMD64:**

    ```bash theme={null}
    LATEST_VERSION=$(curl -s https://api.github.com/repos/amoylab/unla/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
    curl -sL "https://github.com/amoylab/unla/releases/download/${LATEST_VERSION}/mcp-gateway-linux-amd64" -o mcp-gateway
    chmod +x mcp-gateway
    ```

    **Linux ARM64:**

    ```bash theme={null}
    LATEST_VERSION=$(curl -s https://api.github.com/repos/amoylab/unla/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
    curl -sL "https://github.com/amoylab/unla/releases/download/${LATEST_VERSION}/mcp-gateway-linux-arm64" -o mcp-gateway
    chmod +x mcp-gateway
    ```
  </Step>

  <Step title="Start Service">
    ```bash theme={null}
    ./mcp-gateway
    ```
  </Step>
</Steps>

## Configuration Guide

### Environment Variables File

The downloaded `.env` file contains all necessary configuration items. Main configurations include:

<AccordionGroup>
  <Accordion icon="database" title="Database Configuration">
    Configure database connection information for storing chat messages and gateway configurations
  </Accordion>

  <Accordion icon="bell" title="Notification Configuration">
    Configure notification methods for configuration updates (signal, api, redis, etc.)
  </Accordion>

  <Accordion icon="key" title="Authentication Configuration">
    Configure JWT secret keys and super admin account information
  </Accordion>
</AccordionGroup>

### Configuration Files

* `configs/apiserver.yaml`: API server configuration
* `configs/mcp-gateway.yaml`: MCP Gateway core configuration

For detailed configuration instructions, please refer to the [Configuration Documentation](/en/configuration/apiserver).

## Notes

<Warning>
  Binary deployment requires you to manage service startup, stop, and monitoring yourself. It is recommended to use process management tools such as systemd or supervisor in production environments.
</Warning>

### systemd Service Configuration Example

You can create a systemd service file to manage MCP Gateway:

```ini theme={null}
[Unit]
Description=MCP Gateway
After=network.target

[Service]
Type=simple
User=mcpgateway
WorkingDirectory=/opt/unla
ExecStart=/opt/unla/mcp-gateway
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target
```

Save this file as `/etc/systemd/system/mcp-gateway.service`, then:

```bash theme={null}
sudo systemctl daemon-reload
sudo systemctl enable mcp-gateway
sudo systemctl start mcp-gateway
```

### Firewall Configuration

Ensure the following ports are accessible:

* `5235`: MCP Gateway main service port
* `5335`: Management port (internal access only)

<Tip>
  If you need a Web management interface, it is recommended to deploy API Server and Web frontend simultaneously, or use the [All-in-One Docker deployment](/en/deployment/docker#all-in-one-deployment) method.
</Tip>
