# Pterodactyl Integration

Integrate PteroCA with your Pterodactyl Panel to enable automatic server provisioning.

{% hint style="warning" %}
**Required for Server Provisioning**

Pterodactyl integration is required to provision servers. Without this integration, PteroCA can only operate as a storefront - customers can browse products but servers won't be created.
{% endhint %}

## Overview

This integration connects PteroCA to Pterodactyl Panel, allowing:

* Automatic server creation when customers purchase products
* Server management through PteroCA client area
* SSO (Single Sign-On) to Pterodactyl Panel
* Server status and resource monitoring
* Automatic server suspension and deletion

## Integration Steps

Follow these guides in order to complete the integration:

### 1. [PteroCA Pterodactyl Addon](https://docs.pteroca.com/core-configuration/pterodactyl-integration/addon-installation)

Install the PteroCA addon on your Pterodactyl Panel. This addon enables PteroCA-specific features and API endpoints.

**Required**: Yes - must be installed before other steps

### 2. [API Configuration](https://docs.pteroca.com/core-configuration/pterodactyl-integration/api-configuration)

Create an API key in Pterodactyl Panel with the required permissions and configure it in PteroCA.

**Required**: Yes - needed for server provisioning

### 3. [Allowed Origins](https://docs.pteroca.com/core-configuration/pterodactyl-integration/allowed-origins)

Configure CORS (Cross-Origin Resource Sharing) settings to allow PteroCA to communicate with Pterodactyl.

**Required**: Yes - prevents API connection errors

### 4. [SSO Setup](https://docs.pteroca.com/core-configuration/pterodactyl-integration/sso-setup)

Enable Single Sign-On to allow users to access Pterodactyl Panel directly from PteroCA without separate login.

**Required**: No - optional convenience feature

## Quick Setup

For the fastest integration:

1. Install the Pterodactyl addon
2. Create API key with all read & write permissions
3. Run PteroCA configuration wizard:

   ```bash
   php bin/console pteroca:system:configure
   ```
4. Enter Pterodactyl URL and API key when prompted

## Verification

Test that integration works:

1. Create a test product in PteroCA
2. Purchase the product as a test user
3. Verify server appears in Pterodactyl Panel
4. Check server has correct resources

## Troubleshooting

**Common issues:**

* API connection refused: Check allowed origins configuration
* Servers not creating: Verify API key has correct permissions
* SSO not working: Check SSO secret matches on both sides

For detailed troubleshooting, see individual integration pages.

## Related Documentation

* [Pterodactyl Settings](https://docs.pteroca.com/core-configuration/core-configuration/pterodactyl-settings) - Admin panel settings for Pterodactyl
* [Quick Start](https://docs.pteroca.com/quick-start/quick-start) - Fast setup guide
* [Core Configuration](https://docs.pteroca.com/core-configuration/core-configuration) - Other system settings


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pteroca.com/core-configuration/pterodactyl-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
